Untitled
unknown
plain_text
a month ago
751 B
3
Indexable
Q= 1e6; %[W] Fin= 8; %[kmol/s] cp= 2.5; %[kJ/kmol*K] m= 100; %[kmol] Tin= 300; %[K] deltaT= 30; %[K] deltat= 150; %[s] T0= 350; tspan= [0 400]; [t, T] = ode45(@(t,T) variazione_temperatura(t, T), tspan, T0) figure; plot(t, T, 'b-', 'LineWidth', 1.5); hold on; %plot([0 deltat], [Tin Tin], 'r--', ... %[deltat 300], [Tin + deltaT Tin+deltaT], 'r--', 'LineWidth', 1); xlabel('Time (s)'); ylabel('Temperature (K)'); title('variazione temperatuera'); grid on; function dTdt= variazione_temperatura(t, T) Q= 1e6; %[W] Fin= 8; %[kmol/s] cp= 2.5; %[kJ/kmol*K] m= 100; %[kmol] Tin= 300; %[K] deltaT= 30; %[K] deltat= 150; %[s] if t<150 Tin2= Tin; else Tin2= Tin+ deltaT; end dTdt= Q/m*cp-Fin/m*(T-Tin2); end
Editor is loading...
Leave a Comment