I want to solve the Equation numerically
but I don't know how to write the code.
D is a square Matrix with constant values.

3 件のコメント

Alan Stevens
Alan Stevens 2020 年 7 月 2 日
If D has constant values you have a set of simultaneous linear differential equations. Do you have a set of conditions for the fi?
christoph weihs
christoph weihs 2020 年 7 月 2 日
I have the conditions that f and f' have to be 0 for i=0 and f' is ->1 for i->n
Walter Roberson
Walter Roberson 2020 年 7 月 2 日

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

 採用された回答

Alan Stevens
Alan Stevens 2020 年 7 月 2 日

0 投票

Here is some example code using arbitrary data:
f0 = [0; 1; 2]; % initial conditions
tspan = [0 2]; % integration limits
[t, f] = ode45(@rates,tspan,f0); % ode solver
plot(t,f) % plot results
% function that calculates rates of change of f
function dfdt = rates(~,f)
D = [1 2 3; 0.4 0.2 -0.1; 1.6 1.7 -1.8];
dfdt = D*f;
end
Is this the sort of thing you are looking for (obviously you would need to enter your own data).

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Numerical Integration and Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by