Documentos de Académico
Documentos de Profesional
Documentos de Cultura
P1
P1
function Posicion=d2(ti,v,y,p,Vw);
Posicion=v;
endfunction
function Presion=d3(ti,v,y,p,Vw);
Presion=(-((p)/(0.002-Vw))*(Ac*sqrt(abs((2*(p-P_atm))/(rho)))));
endfunction
function Volumenw=d4(ti,v,y,p,Vw)
Volumenw=(-Ac*sqrt(abs((2*(p-P_atm))/(rho))));
endfunction
//Par�metros
//Condiciones iniciales
Ftemp(2,3)=d3(t(i-1)+dt*0.5,V(i-1)+Ftemp(1,1)*0.5*dt,Y(i-1)+Ftemp(1,2)*0.5*dt,P(i-
1)+Ftemp(1,3)*0.5*dt,V_w(i-1)+Ftemp(1,4)*0.5*dt)
Ftemp(2,4)=d4(t(i-1)+dt*0.5,V(i-1)+Ftemp(1,1)*0.5*dt,Y(i-1)+Ftemp(1,2)*0.5*dt,P(i-
1)+Ftemp(1,3)*0.5*dt,V_w(i-1)+Ftemp(1,4)*0.5*dt)
Ftemp(4,2)=d2(t(i-1)+dt,V(i-1)+Ftemp(3,1)*dt,Y(i-1)+Ftemp(3,2)*dt,P(i-
1)+Ftemp(3,3)*dt,V_w(i-1)+Ftemp(3,4)*dt)
Ftemp(4,3)=d3(t(i-1)+dt,V(i-1)+Ftemp(3,1)*dt,Y(i-1)+Ftemp(3,2)*dt,P(i-
1)+Ftemp(3,3)*dt,V_w(i-1)+Ftemp(3,4)*dt)
Ftemp(4,4)=d4(t(i-1)+dt,V(i-1)+Ftemp(3,1)*dt,Y(i-1)+Ftemp(3,2)*dt,P(i-
1)+Ftemp(3,3)*dt,V_w(i-1)+Ftemp(3,4)*dt)
//Resultados
//Velocidad
V(i)=V(i-1)+dt*(Ftemp(1,1)+2*Ftemp(2,1)+2*Ftemp(3,1)+Ftemp(4,1))/6;
//Posicion
Y(i)=Y(i-1)+dt*(Ftemp(1,2)+2*Ftemp(2,2)+2*Ftemp(3,2)+Ftemp(4,2))/6;
// Volumen
V_w(i)=V_w(i-1)+dt*(Ftemp(1,4)+2*Ftemp(2,4)+2*Ftemp(3,4)+Ftemp(4,4))/6;
// Presion
P(i)=P(i-1)+dt*(Ftemp(1,3)+2*Ftemp(2,3)+2*Ftemp(3,3)+Ftemp(4,3))/6;
//Gr�ficas
// Velocidad
subplot(2,2,1)
xgrid
plot(t,V)
title("Curva de velocidad del cohete vs tiempo");
xlabel("Tiempo[s]");
ylabel("Velocidad[m/s]]");
subplot(2,2,2)
xgrid
end
//Posicion
plot(t,Y)
title("Curva de posici n del cohete vs tiempo");
xlabel("Tiempo[s]");
ylabel(" Posici n[m]");
subplot(2,2,3)
xgrid
//Presion
plot(t,P)
title("Curva de presi n del cohete vs tiempo");
xlabel("Tiempo[s]");
ylabel(" Presi n[Pa]");
subplot(2,2,4)//
xgrid
//Volumen
plot(t,V_w)
title("Curva de volumen de agua en el cohete vs tiempo");
xlabel("Tiempo[s]");
ylabel("Volumen[m3]");