clc, cleara1=28*7*400; %%ft^2
po=40.6; %%psi
dpio=9; %%psiqf=1525; %%gpm
qo=qf;pp=16.4; %%psiqp=1234; %%gpmdepr1=24.9; %%psidelp=depr1-pp; %%psidelpr2=18.2; %%psiPH=360; %%ft
lp=2.76*.264/(60)^2*14.5; %%gal/m*min^2/psi
k2=1.75*10^-4*60^1.67*14.5/264.172^1.67; %%psi/(gal/min)^1.67
k3=2.27*10^-2; %%(m^3/h)^.6/m^2
g=32.17; %%ft/s^2
rhoh20=62.4; %%lbs/ft^3
pf=rhoh20*g*PH*1.488*.000145; %%psidpo=pf-po; %%psieqns=ro_cp_model(lp,qo,dpio,k3,k2,dpo);function dpq=ro_cp_model(lp,qo,dpio,k3,k2,dpo)syms jjw dp(x) Q(x)eqns=[diff(Q,x,1)==-(lp(dp-qo*dpio/Q*exp(jjw/(k3*Q^.4))))*am, diff(dp,x,1)==-k2*Q];conditions=[dp(0)==dpo Q(0)==qo];dpq=vpa(dsolve(eqns,conditions));end Error using symfun/subsindex (line 157)Indexing values must be positive integers, logicals,or symbolic variables.Error in ro_cp_model (line 4)eqns=[diff(Q,x,1)==-(lp(dp-qo*dpio/Q*exp(jjw/(k3*Q^.4))))*am,diff(dp,x,1)==-k2*Q];Error in mhlro (line 20)eqns=ro_cp_model(lp,qo,dpio,k3,k2,dpo); >>
I would like to show a matrix of the anwsers of the two diff. equations with the only uknown value beng jjw.
Best Answer