difficult inequality to solve

조회 수: 2 (최근 30일)
bk97
bk97 2017년 1월 25일
댓글: Walter Roberson 2017년 1월 26일
abs((cos(x)+1/2*x^2)-1)*x^4)<=1/24, does anybody have any idea how to solve this on matlab or write down some possible codes?

채택된 답변

Niels
Niels 2017년 1월 25일
편집: Niels 2017년 1월 25일
since your function is even it is symmetric and it is monotone for x>0 or x<0
use fzero
>> f=@(x)((cos(x)+1./2.*x.^2)-1).*x.^4 - 1/24 % subtract the value to transform it into an issue of roots
>> solution=abs(fzero(f,0))
solution =
1.0042
>> range=[-solution solution]
range =
-1.0042 1.0042
  댓글 수: 19
bk97
bk97 2017년 1월 26일
alright thank you for the code about complex value! So could you please tell me if the code with the abs that @Niels has written before does work correctly for real solutions? And what is the conclusion for that
Walter Roberson
Walter Roberson 2017년 1월 26일
The +/- -1.004205445912837 I show occurs when the imaginary component is 0. It is a higher precision version of the value that Niels posted. The code Niels posted is fine.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by