Solve the differential equation numerically using matlab

回答 (1 件)

Torsten
Torsten 2015 年 8 月 31 日

1 投票

fun=@(t,y)2*t*y;
Tspan = [0 2];
y0=1;
[T,Y] = ode45(fun,Tspan,y0);
plot(T,Y(:,1));
Best wishes
Torsten.

7 件のコメント

Ahamed Zajith
Ahamed Zajith 2015 年 8 月 31 日
編集済み: Ahamed Zajith 2015 年 8 月 31 日
Thank you sir. but i am a beginner,have an alternative methods for this ?
Walter Roberson
Walter Roberson 2015 年 8 月 31 日
That is the beginner version.
Are you asking for the "beginner" version, or are you asking for the homework version in which you need to calculate it without using the ode functions?
Ahamed Zajith
Ahamed Zajith 2015 年 8 月 31 日
thank you, i need a code without using ode function sir
Walter Roberson
Walter Roberson 2015 年 8 月 31 日
If you have the symbolic toolbox then
dsolve('Dy=2*x*y', 'x')
Ahamed Zajith
Ahamed Zajith 2015 年 8 月 31 日
its great.Thank you sir.
Torsten
Torsten 2015 年 8 月 31 日
... but this is not a numerical solution.
Best wishes
Torsten.
Walter Roberson
Walter Roberson 2015 年 8 月 31 日
For some reason what runs through my mind is the classic, "So nail it to a wall then."

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

製品

質問済み:

2015 年 8 月 31 日

コメント済み:

2015 年 8 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by