Solving trigonometric /hyperbolic equation using symbolic math toolbox

6 Ansichten (letzte 30 Tage)
VS
VS am 23 Okt. 2013
Beantwortet: chadi cream am 4 Mär. 2018
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 Kommentar
RahulTandon
RahulTandon am 7 Jul. 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;

Melden Sie sich an, um zu kommentieren.

Antworten (2)

chadi cream
chadi cream am 4 Mär. 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)

Walter Roberson
Walter Roberson am 8 Jul. 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.

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by