Need to numerically solve the differential equation below and plot T vs t which goes like radiative cooling curve.
dT/dt= -Q(T^4-T0^4)/3*L*T where T =1000K, T0=300K, Q=1.38e-23 and L=1e-4 m.
Thank you in advance!

 Respuesta aceptada

Star Strider
Star Strider el 2 de Feb. de 2021

0 votos

Tv=1000; % K
T0=300; % K
Q=1.38e-23;
L=1e-4; % m.
syms T(t)
DE = diff(T) == -Q*(Tv^4-T0^4)/3*L*T;
DEs = dsolve(DE, T(0)==T0)
figure
fplot(DEs, [0 1E+16])
grid
xlabel('$t$', 'Interpreter','latex')
ylabel('$T(t)$', 'Interpreter','latex')
title(['$T(t) = ' latex(DEs) '$'], 'Interpreter','latex')
Or, use ode45.

6 comentarios

Emma K.
Emma K. el 2 de Feb. de 2021
Hi, T and Tv are the same but when I do that, the graph turns to be kind of linear instead of a curve. Again why do you have 1E+16 in the fplot command line? Thank you
Walter Roberson
Walter Roberson el 2 de Feb. de 2021
If T0 and Tv are the same then Tv^4 - T0^4 would be 0, and the right hand side of the differential equation would be 0, which implies a linear equation.
Emma K.
Emma K. el 2 de Feb. de 2021
No,I wrote T and Tv are the same not T and T0.
Star Strider
Star Strider el 2 de Feb. de 2021
‘... T and Tv are the same ...
Not really. Here, ‘T’ is the function and ‘Tv’ is one value (as is ‘T0’).
When plotted, it appears linear over relatively short intervals for ‘t’, while over longer intervals (such as I use here, and the answer to your other question about it), it has the expected exponential decay.
To do a true numerical integration, you will likely want to use ode45. This code demonstrates a symbolic integration, and what the correct plot looks like.
Emma K.
Emma K. el 4 de Feb. de 2021
Thank you Strider, a little tweak helped resolved the problem.
Star Strider
Star Strider el 4 de Feb. de 2021
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Mathematics and Optimization en Centro de ayuda y File Exchange.

Preguntada:

el 2 de Feb. de 2021

Comentada:

el 4 de Feb. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by