global theta r bore stroke P1 T1 y shaft rod epsilon V1 n a theta_s theta_d Qin range
[th,P] = ode45(@pressure,range,P1);
plot(th,P)
function [V,dV] = vol(theta)
global r ;
V = (1/r) + ((r-1)*(1-cos(theta)))/2*r ;
dV = ((r-1)/2*r )*sin(theta);
end
function [dxb] =burnfrac(theta)
global theta_s theta_d n a ;
xb = 1- exp(-a*(((theta-theta_s)*(1/theta_d))^n ));
if theta>theta_s && theta<(theta_s+theta_d)
dxb= n*(a/theta_d)*(1-xb)*((theta-theta_s)/theta_d)^(n-1);
else
dxb=0;
end
end
function [dP]= pressure(theta,P)
global Qin y ;
[V ,dV] = vol(theta);
dxb=burnfrac(theta);
dQ= Qin *dxb ;
dP= - y* P/V * dV + ((y-1)/V) * dQ;
dW= P*dV;
end
function [dW]= work(theta,P)
global Qin y ;
[V ,dV] = vol(theta)
dxb=burnfrac(theta);
dQ= Qin *dxb ;
dP= - y* P/V * dV + ((y-1)/V) * dQ
dW= P*dV
end
0 Comments
Sign in to comment.