How to solve two differential equation systems sequentially?

I have two differential equation systems. Solving procedure should start with the first one and solve it with a initial condition. Then, when the solution reaches a threshold, it should switch to the second system and used the final states of the first system as initial conditions of the second system. I have modeled both systems in Simulink. How can I linked them together properly? I used switches and if but it didn't work properly.

1 件のコメント

Walter Roberson
Walter Roberson 2016 年 6 月 14 日
If you were doing it at the MATLAB level, I would suggest using event functions to detect that the threshold had been reached and terminate the first ode.

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

回答 (1 件)

Ruwini
Ruwini 2025 年 5 月 15 日

0 投票

𝑑𝑓^𝑥/𝑑𝑡= −|𝑞|^1/2*𝑘2^2*𝑓^𝑥−𝑖𝑑𝑓^𝑦/𝑑𝑞−𝑓^𝑥/2𝑇1=0 (1)
𝑑𝑓^𝑦/𝑑𝑡= −|𝑞|^1/2*𝑘2^2*𝑓^𝑦+𝑖𝑑𝑓^𝑥/𝑑𝑞−𝑓^𝑦/2𝑇1+𝛺𝑅𝑓^𝑧=0 (2)
𝑑𝑓^𝑧/𝑑𝑡= −|𝑞|^1/2^𝑘2^2*𝑓𝑧−𝛺𝑅*𝑓^𝑦−𝑓^𝑧/𝑇1=0 I want ode45 MATLAB code for solving this

1 件のコメント

Torsten
Torsten 2025 年 5 月 15 日
編集済み: Torsten 2025 年 5 月 15 日
Your notation is not standard.
What is q ? A second independent variable ?
What does f^x, f^y, f^z mean ?
Is i the imaginary unit ?
What are the values of the parameters used ?
Does f^x/2T1 mean f/(2*T1) ?
So many questions ...

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

カテゴリ

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

質問済み:

2016 年 6 月 14 日

編集済み:

2025 年 5 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by