Solving trigonometric /hyperbolic equation using symbolic math toolbox
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am trying to find roots of the equation:
cosh(x)*cos(x)+1 = 0
I try 2 methods using symbolic math one is using solve function and other using poles function
1)
>> syms x
>> solve((1+cos(x)*cosh(x))==0)
ans =
-212.05750411731104359622842837137
2)
>> poles(1/(1+cosh(x)*cos(x)),x,0,20*pi)
Warning: Cannot determine the poles.
> In sym.poles at 106
ans =
[ empty sym ]
I know that the answer is
x = ±1.87510406871196...
x = ±4.69409113297417...
x = ±7.85475743823761...
x = ±10.9955407348755...
ans so on...
When I substitute x = -212.05750411731104359622842837137 in the equation it is not satisfied.
Why can't I get the values of x in the defined range using symbolic math? what do i need to correct in my code?
Thanks
Trupti
PS : I am using Matlab 2012b
1 Commento
RahulTandon
il 7 Lug 2015
do you mind a grafical answer to your problem? it gives a clear answer!
syms x; clf; ezplot('cosh(x)+cos(x)+1'); grid on;
Risposte (2)
chadi cream
il 4 Mar 2018
k=100; S=zeros(k,1);
for n=1:k sol=vpasolve((1+cos(t)*cosh(t))==0,'random', true); S(n,1)=sol; end S=unique(S) S=sort(S)
0 Commenti
Walter Roberson
il 8 Lug 2015
This is the defined behaviour for solve(): when numeric values have to be returned then unless the equation is a polynomial, only a single answer will be returned.
To find numeric roots within a particular range, use vpasolve(). You might have to call it repeatedly to find multiple roots in the range.
0 Commenti
Vedere anche
Categorie
Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!