Advertisement
Guest User

Untitled

a guest
Oct 9th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Octave 0.53 KB | None | 0 0
  1. t=0:0.05:3; %s
  2. h0=1.5; %m
  3. T0=298.15
  4.  
  5. function dhdt=dhdt(h)
  6.    %Cantidades constantes:
  7.    A=1; %m^2
  8.    Cv1=0.02;
  9.    Cv2=0.02;
  10.    rho=1000;
  11.    g=9.8;
  12.    R=8.314;
  13.    w=28.85;
  14.    cv=722;
  15.  
  16.  
  17.    %Parametros
  18.  
  19.    P1=150000;
  20.    P3=100000;
  21.    P0=100000;
  22.    ng=150;
  23.    M=ng*w*(1/1000);
  24.    Vt=5;
  25.  
  26.  
  27.    %Ecuaciones
  28.  
  29.    Vg=Vt-A*h(1);
  30.    P0=ng*R*h(2)/Vg;
  31.    P2=rho*g*h(1)+P0;
  32.    F1=Cv1*sqrt(P1-P2);
  33.    F2=Cv2*sqrt(P2-P3);
  34.    dhdt(1)=(F1-F2)/A;
  35.    dhdt(2)=(P0/(M*cv))*(F1-F2);
  36.    
  37.    endfunction
  38.  
  39.  
  40. h=lsode("dhdt",[1.5,T0],t);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement