Solving trigonometric /hyperbolic equation using symbolic math toolbox
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
RahulTandon
le 7 Juil 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;
Réponses (2)
chadi cream
le 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 commentaires
Walter Roberson
le 8 Juil 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 commentaires
Voir également
Catégories
En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!