difficult inequality to solve
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
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?
채택된 답변
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
2017년 1월 25일
i didn't undertand what you did here. Can you be more accurate please?
Niels
2017년 1월 25일
if f(x)=b then subtract b so that f(x)-b=0 make this your new function
after that you can use fzero, cause the value you are looking for is the root of the new created function.
i made a mistake my friend the inequation is this abs(((cos(x)+1/2*x^2)-1)*x^4)<=1/24
Niels
2017년 1월 25일
you are missing a * before x^4
Niels
2017년 1월 25일
and the abs does not change anything
bk97
2017년 1월 25일
yes i'm sorry and looking forward to your answer!
Niels
2017년 1월 25일
the answer is still the same
Niels
2017년 1월 25일
maybe you meant
(cos(x)+1./ ->(2.*x.^2)<-)-1
and not
(cos(x)+ (1./2) .*x.^2)-1 ??
bk97
2017년 1월 25일
no if you put absolute to your first line it gives an error!
nope
it does not:
>> f=@(x)abs(((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))
range=[-solution solution]
f =
function_handle with value:
@(x)abs(((cos(x)+1./2.*x.^2)-1).*x.^4)-1/24
solution =
1.0042
range =
-1.0042 1.0042
Niels
2017년 1월 25일
since your function is >0 for all x the abs does not change anything anyway, so it is pretty unnecessary
bk97
2017년 1월 25일
alright thank you a lot my friend. Whenever you have time check another question that i made because i get an error in this link:http://www.mathworks.com/matlabcentral/answers/321923-runge-kutta-4th-order
Walter Roberson
2017년 1월 25일
The abs() makes a difference if you are expecting complex numbers for input.
bk97
2017년 1월 25일
so what you propose?
Walter Roberson
2017년 1월 26일
Are you looking for real valued solutions or complex valued solutions?
bk97
2017년 1월 26일
complex valued
There are an infinity of complex solutions, symmetric in positive and negative real components, and symmetric in positive and negative imaginary components. The boundaries on the imaginary components are +/- -.9958714409867068 approximately and the boundaries on the real components are +/- -1.004205445912837 approximately.
The area is not circular in real and imaginary components, but it is approximately circular.
For any given real component inside the given range, there are two imaginary components that lead to solution; likewise for any given imaginary component within the range, there are two real components that lead to solution.
When I talk about infinity of solutions, I am referring just to the boundary; because if the inequality, everything within the boundary is included too.
The boundary is the solutions for
(1/2)*sqrt((2*cosh(2*b)+2*cos(2*a)+(4*a^2-4*b^2-8)*cos(a)*cosh(b)-8*a*b*sin(a)*sinh(b)+a^4+(2*b^2-4)*a^2+b^4+4*b^2+4)*(a^2+b^2)^4)-1/24
where a is the real component and b is the imaginary component.
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
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개)
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
태그
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
