How can I solve an ODE that involves a variable parameter?

I need to solve the next ODE:
dT/dz = h*A*(T-t)/(m*cp).
The parameter "A" is also a function of z, A=f(z) and I already know that function so I am able to calculate A for any value of z. By using the solver ode45, the problem is that I don't know at which "z" I need to evaluate the function A since the solver uses a random step to solve the differencial equation. Any suggestions?

1 件のコメント

Star Strider
Star Strider 2016 年 3 月 12 日
Significantly more detail would be inestimably helpful!

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

回答 (1 件)

Torsten
Torsten 2016 年 3 月 14 日

0 投票

The actual value of z is transfered to the function where you define your differential equation. Thus you only have to evaluate A at this specific z:
dTdz = myfun(z,T)
A=@(z)...;
t=...;
m=...;
cp=...;
h=...;
dTdz=h*A(z)*(T-t)/(m*cp)
Best wishes
Torsten.

カテゴリ

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

質問済み:

2016 年 3 月 12 日

回答済み:

2016 年 3 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by