Using ode45 for transient analysis

17 次查看(过去 30 天)
Hi,
Quite inexperinced with MATLAB so apologies if the question is obvious but:
I need to use matlab to do a transient analysis of a mixed mode heat transfer (radiation and convection), and calculate time taken for a mass of water to increase to a certain temperature. As temperature increases it changes the heat transfer properites.
The equation I'm trying to use to calculate time is as follows:
dt = (Mw * Cw * dT)/(Adisc * (e*(q2 + q3 - (2 * sig * T^4))-(alp2 + alp3)*(T - Tamb)))
Everything is a constant except 'T' which is the water temperature and will vary while the water is heated. Now my problem is using ode45, because it appears I need to input a time span 'tspan':
[t,y] = ode45(odefun,tspan,y0)
This 'tspan' requires the final time, however, I am obviously trying to calculate the final time so not sure how I should be doing this.
Any help apreciated.

采纳的回答

Torsten
Torsten 2019-4-8
First possibility:
Use the end time of integration big enough such that the water temperature surely exceeds the one you prescribe. Then read the time required to heat the water to the requested temperature from the t-T - plot.
Second possibility:
Use the event option of ODE45 to stop integration at the time where the water temperature reaches the one you request:
https://de.mathworks.com/help/matlab/math/ode-event-location.html

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

产品


版本

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by