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 Exchange์—์„œ General 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