Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Octave 0.63 KB | None | 0 0
  1. function conc=conc(C) %(C es un vector que contiene [V, CA, CB])
  2.     F1=2.5; %m3/s
  3.     A=1; %m2
  4.     F2=0.5*(C(1)/A); %m3/
  5.     CA1=1.5; %mol/m3
  6.     CB1=1; %mol/m3
  7.     conc(1)=F1-F2;
  8.     conc(2)=(F1*CA1-F2*C(2)-C(2)*(F1-F2))/C(1);
  9.     conc(3)=(F1*CB1-F2*C(3)-C(3)*(F1-F2))/C(1);
  10. endfunction
  11.  
  12. t=0:0.25:10;
  13. res=lsode("conc",[1.5,2.5,0],t);
  14. subplot(1,3,1)
  15. plot(t,res(:,1))
  16. xlabel("t, s","fontsize",15)
  17. ylabel("V, m^3","fontsize",15)
  18. subplot(1,3,2)
  19. plot(t,res(:,2))
  20. xlabel("t, s","fontsize",15)
  21. ylabel("C_A, mol/m^3","fontsize",15)
  22. subplot(1,3,3)
  23. plot(t,res(:,3))
  24. xlabel("t, s","fontsize",15)
  25. ylabel("C_B, mol/m^3","fontsize",15)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement