Clear Filters
Clear Filters

Solving trigonometric /hyperbolic equation using symbolic math toolbox

3 views (last 30 days)
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 Comment
RahulTandon
RahulTandon on 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;

Sign in to comment.

Answers (2)

chadi cream
chadi cream on 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)

Walter Roberson
Walter Roberson on 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.

Community Treasure Hunt

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

Start Hunting!