Solving trigonometric /hyperbolic equation using symbolic math toolbox
조회 수: 6 (최근 30일)
이전 댓글 표시
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
RahulTandon
2015년 7월 7일
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;
답변 (2개)
chadi cream
2018년 3월 4일
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
Walter Roberson
2015년 7월 8일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!