how to solve following differential equation.

3 ビュー (過去 30 日間)
uday
uday 2014 年 4 月 22 日
回答済み: Mischa Kim 2014 年 4 月 22 日
f'''+1/2*f*f''=0;
numerical value of f is to be calculated. Please provide code for solving it.

回答 (1 件)

Mischa Kim
Mischa Kim 2014 年 4 月 22 日
Uday, use one of the ode solvers:
function myODE()
IC = [0 0 1];
[t,X] = ode45(@ODEf,[0 10],IC);
f = X(:,1);
plot(t,f,'r')
xlabel('t')
ylabel('f')
grid
end
function df = ODEf(t, f)
df = zeros(3,1);
f1 = f(1);
f2 = f(2);
f3 = f(3);
df = [ f2;...
f3;...
-0.5*f1*f3];
end

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by