現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
difficult inequality to solve
1 回表示 (過去 30 日間)
古いコメントを表示
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
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 件のコメント
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.
Niels
2017 年 1 月 25 日
maybe you meant
(cos(x)+1./ ->(2.*x.^2)<-)-1
and not
(cos(x)+ (1./2) .*x.^2)-1 ??
Niels
2017 年 1 月 25 日
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.
Walter Roberson
2017 年 1 月 26 日
Are you looking for real valued solutions or complex valued solutions?
Walter Roberson
2017 年 1 月 26 日
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 件)
参考
タグ
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)