octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

error: 'work' undefined near line xx column 1


From: LFK
Subject: error: 'work' undefined near line xx column 1
Date: Tue, 2 Jul 2013 13:50:10 -0700 (PDT)

Hello there,

I'm new at Octave and I'm getting this error. Every time I try to execute my
code it doesn't work and I get this message, but every time with a diferent
line. What does this error mean?

Here is the code:

#Programa para soluo e sistemas de EDO
#PBR saida a 1 atm
clear all;
#-----------------------------------------------------------------------
#Definio das equaes diferenciais por uma Function-------
#-----------------------------------------------------------------------
function  dxdw = fun(w,x)
#Identificao das variveis ---------------------------------------
x_conv=x(1);
P=x(2);
#if(P<=0);
        #quit
#endif
#varável independente
#-----------------------------------------------------------------------
#Definio de parmetros------------------------------------------
k=2.72493; 
Ka=0.43917; 
Kw=2.65334;
ya0=1;
p0=15; #atm
pa0=15; #atm
delta=0;
dt=4*2.54e-2; #m
dp=5e-3; #m
rhoc=1; #kg/l
phi=0.62; #porosidade do leito
v0=45000/60; #l/min
T=393; #K
R=0.082; #l*atm/mol*K
G=60000; #kg/m^2*min
mhig=2.78e-5*60; #kg/m*min

#-----------------------------------------------------------------------
#Equaes auxiliares------------------------------------------------
#pt0=yt0*p0;

#epson=delta*yt0;
#tethah=yh0/yt0;
#tethab=yb0/yt0;
pa=pa0*(1-x_conv)*(P/p0);
pw=pa0*(0.5*x_conv)*(P/p0);
ra=-k*pa/((1+pa*Ka+pw*Kw)^2);
ca0=p0/(R*T);
fa0=ca0*v0;
ast=(3.14*dt^2)/4; #m^2
u=(v0/1000)/(ast); #v0 m^3/min #u m/min                                      
rho0=(G/u)/1000; #kg/l
alpha=((2*G)/(rho0*rhoc*ast*phi^3))*(((150*(1-phi)*mhig)/dp^2)+((1.75*G)/dp));
#-----------------------------------------------------------------------
#Definio da EDO--------------------------------------------------
#dxdt(1)=......
#dxdt(2)=......
#   :           :
#dxdt(n)=......
dxdw(1)=-(ra*1000)/fa0; # *1000 para ra em mol/kgcat min
dxdw(2)=-(alpha/2)*(p0/P);
#----------------------------------------------------------------------
endfunction


#Definio dos valores dos argumentos-------------------------
#----------------------------------------------------------------------
#Vetor com intervalo de integrao------------------------------
wi=15; #kg de catalizador
wf=30; #kg de catalizador
w0=[wi wf];
#----------------------------------------------------------------------
#Vetor com as condies iniciais----------------------------------
x10=0; #conversão na entrada do reator
x20=15; #Pressão na entrada do reator
#x20=....
# :      :
#xn0=....
x0=[x10 x20];
#----------------------------------------------------------------------
#Soluo do Sistema de EDOs-----------------------------------
[w,x]=ode45(@fun,w0,x0)

#x1=x(:,1);
#x2=x(:,2);
#x3=x(:,3);
# :    :
#xn=x(:,n);

#subplot(1,2,1)
#plot(w,x1,";Conversão;")
#subplot(1,2,2)
#plot(w,x2,";Pressão;")



--
View this message in context: 
http://octave.1599824.n4.nabble.com/error-work-undefined-near-line-xx-column-1-tp4655134.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]