How to solve differential equation with variable input parameters

How to solve differential equation: zdot = (w*v*z)+1. where w=constant, v= velocity array of size 10, z is the initial condition=0. The solution for the first step is the z value for the next step.

 採用された回答

Torsten
Torsten 2017 年 6 月 29 日

1 投票

z0=0
z1=z0+dt*(w*v1*z1+1) -> z1=(z0+dt)/(1-dt*w*v1)
z2=z1+dt*(w*v2*z2+1) -> z2=(z1+dt)/(1-dt*w*v2)
...
In general:
Use the recursion
z(i+1)=(z(i)+dt)/(1-dt*w*v(i+1)) (i=1,...,9)
with
z(1)=0
Best wishes
Torsten.

3 件のコメント

Swagato Das
Swagato Das 2017 年 6 月 29 日
Thank you. The solution provided is working fine.But I was looking for a solution using functions, such as 'ode'. This is only a small part of the equation to be solved.
Torsten
Torsten 2017 年 6 月 29 日
編集済み: Torsten 2017 年 6 月 29 日
Then, with your time-dependent vector v, you can adapt the example "ODE with Time-Dependent Terms" provided under
https://de.mathworks.com/help/matlab/ref/ode45.html
Best wishes
Torsten.
Swagato Das
Swagato Das 2017 年 6 月 29 日
Thank you sir..

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

その他の回答 (0 件)

カテゴリ

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

製品

質問済み:

2017 年 6 月 29 日

編集済み:

2017 年 6 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by