SharedSessió 2.sagewsOpen in CoCalc
Xt=range(0,120,30);
Yt=[85,73,64,58];
i=var("i");
taula=points([Xt[i],Yt[i]] for i in range(0,len(Xt)));
show(taula);

t=var("t");
f=function("f",t);
T0=var("T0");
k=var("k");
Te=var("Te");
sol=desolve(diff(f(t),t)+k*(f(t)-Te)==0,[f,t],[0,T0]);
show(sol);


$\displaystyle {\left(\mathit{Te} e^{\left(k t\right)} + T_{0} - \mathit{Te}\right)} e^{\left(-k t\right)}$
t=var("t");
f=function("f", t);
T0=85;
k=var("k");
Te=15;
solucio=desolve(diff(f(t),t)+k*(f(t)-Te)==0, [f,t], [0,T0]) #Solució general de l'edo
show(solucio);
n(1/175);
n(3/580);
n(1/245);
k=(1/175+3/580+1/245)/3;
show(k);
n(solucio(300,709/142100)); #Valor de T al cap de 5 mins
solucio2=solve(solucio==35, t); #t=142100*log(7/2)/709=109,04382101858133
show(solucio2);


$\displaystyle 5 \, {\left(3 \, e^{\left(k t\right)} + 14\right)} e^{\left(-k t\right)}$
0.00571428571428571 0.00517241379310345 0.00408163265306122
$\displaystyle \frac{709}{142100}$
30.6686519621892
[$\displaystyle t = \frac{\log\left(\frac{7}{2}\right)}{k}$]
t=var("t");
f=function("f", t);
T0=85;
k=var("k");
Te=15;
equacio=solucio(600,k);
show(equacio);


$\displaystyle 5 \, {\left(3 \, e^{\left(600 \, k\right)} + 14\right)} e^{\left(-600 \, k\right)}$
t=var("t");
f=function("f",t);
T0=85;
k=709/142100;
Te=15;
q=var("q");
sol2=desolve(diff(f(t),t)+k*(f(t)-Te)-q==0,[f,t],[0,T0]);
show(sol2);
eq=sol2.subs(t=600);
solve(eq==30, q);


$\displaystyle \frac{5}{709} \, {\left({\left(28420 \, q + 2127\right)} e^{\left(\frac{709}{142100} \, t\right)} - 28420 \, q + 9926\right)} e^{\left(-\frac{709}{142100} \, t\right)}$
[q == 709/28420*(3*e^(4254/1421) - 14)/(e^(4254/1421) - 1)]