ODE function return additional time dependent values
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
구구
am 28 Aug. 2023
Beantwortet: Ayush Anand
am 6 Sep. 2023
The equation I'm integrating is M x'' = F, which is the basic rigid body equation of motion and also performs transient heat conduction analysis.
Adding temperature to the ODE variables would add too many degrees of freedom, so I want to analyze that part separately.
However, in order to perform the transient heat conduction analysis, I need the previous time step and the temperature at that time, is there any way to get these values as additional output variables from the ODE function at specific time step?
1 Kommentar
Torsten
am 28 Aug. 2023
Adding temperature to the ODE variables would add too many degrees of freedom, so I want to analyze that part separately.
If you can start the thermal model from the solution of the rigid body model, you can also solve both of them combined.
Akzeptierte Antwort
Ayush Anand
am 6 Sep. 2023
Hi,
I understand you are integrating the rigid body equation of motion and perform transient heat conduction analysis alongside and want to know if there is a way to get previous timestep and temperature as additional output variables from the ODE function.
This can be implemented using the “OutputFcn” option in the ODE solvers such as “ode45”. This would involve defining a custom function and storing previous timestep and previous temperature values in an array every timestep. This custom function can then be passed as the “OutputFcn” argument with the solver.
For more information on ODE solvers, please refer to the following resources:
- https://in.mathworks.com/matlabcentral/answers/312549-get-variable-out-of-ode-45 (This answer explains how to extract extra parameters from the ode45 differential equation solver)
- https://in.mathworks.com/matlabcentral/answers/97074-how-do-i-solve-an-ode-with-time-dependent-parameters-in-matlab (How to solve an ode with time-dependent parameters in MATLAB)
I hope this helps!
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!