Advertisement
Guest User

Untitled

a guest
Oct 11th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Octave 0.41 KB | None | 0 0
  1. t=0:1:30; %s
  2. V0=1.5; %m3
  3. CA0=2.5; %mol/m3
  4. CB0=0; %mol/m3
  5.  
  6. function modelo5=modelo5(C) % C=[V CA CB]
  7.     F1=2.5; %m3/s
  8.     A=2; %m2
  9.     F2=0.5*(c(1)/A); %m3/s
  10.     CA1=1.5; %mol/m3
  11.     CB1=1; %mol/m3
  12.  
  13.     modelo5(1)=F1-F2
  14.     modelo5(2)=(F1*CA1-F2*C(2)-C(2)*(F1-F2))/C(1)
  15.     modelo5(3)=(F1*CB1-F2*C(3)-C(3)*(F1-F2))/C(1)
  16. endfunction
  17.  
  18. res=lsode("modelo5",[VB,CA0,CB0],t) (octave)
  19. res=ode45("modelo5",t,[V0,CA0,CB0]) (matlab)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement