Solve a second order differential equation
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
hi.i want to solve this second order differential equation in matlab an plot figure. can you help me please?
d2a/de2=(((((2+c2)./(1+c2)).*(Fu.^2))+1)*(a.^c2)-((2+c2)./(1+c2)).*(Fu.^2./a)-a.^(2+(2.*c2)))./( ((2+c2)/((3+c2).*(1+c2))).*Fu.^2 );
Fu=1
c2=0,0.5,1
採用された回答
Ameer Hamza
2020 年 11 月 4 日
This is a second-order ODE which can be solved using ode45(). See the example titled "Solve Nonstiff Equation" here: https://www.mathworks.com/help/matlab/ref/ode45.html#bu3uj8b
10 件のコメント
Mj
2020 年 11 月 4 日
thanks alot. i am beginner in matlab.is it possible for you to send me the code?
Ameer Hamza
2020 年 11 月 4 日
Can you write your equation in MATLAB form? Then It will be easier for me to write a solution.
Mj
2020 年 11 月 4 日
yes. the equation is :
x=(((((2+c2)./(1+c2)).*(Fu.^2))+1)*(a.^c2)-((2+c2)./(1+c2)).*(Fu.^2./a)-a.^(2+(2.*c2)))./( ((2+c2)/((3+c2).*(1+c2))).*Fu.^2 )
x=d2a/de2
Fu=1
c2=0,0.5,1
Ameer Hamza
2020 年 11 月 4 日
What are the initial conditions? Following code shows an example
Fu=1;
c2=0;
dAdt = @(t, A) [A(2);
(((2+c2)./(1+c2).*Fu.^2+1)*A(1).^c2-(2+c2)./(1+c2).*Fu.^2./A(1)-A(1).^(2+2.*c2)) ./( (2+c2)/((3+c2).*(1+c2)).*Fu.^2 )];
tspan = [-2 0];
IC = [1; -0.1];
[t, A] = ode45(dAdt, tspan, IC);
plot(t, A(:,1), '-o');
legend({'$\alpha$'}, 'Interpreter', 'latex', ...
'FontSize', 16, 'Location', 'best')
Mj
2020 年 11 月 4 日
does it need initial condition? what initial condition did you use in this code?
Ameer Hamza
2020 年 11 月 4 日
This is the line for initial condition
IC = [1; -0.1];
First is the value for alpha and second is for d_alpha. Initial condition is applied at left side of interval in tspan.
is it possible to solve this by fourth order Rung-kutta method?
Ameer Hamza
2020 年 11 月 4 日
ode45() also use RK-(4,5) algorithm as desribed here: https://www.mathworks.com/help/matlab/ref/ode45.html#bu0200e-1
Mj
2020 年 11 月 4 日
i put my initial condition instead of yours, but it did not give me the righ figure.
IC = [0.75; 0];
The alpha value as the initial condition is 0.75. But I do not have d-Alpha in the same place. Elsewhere, d-alpha value is zero.
do you know what should i do?
excuse me because of my boring questions.
Ameer Hamza
2020 年 11 月 4 日
This is the solution according to the equation you shared. Check if there is a mistake in writing the equation.
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Ordinary Differential Equations についてさらに検索
参考
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)
