Advertisement
albert828

TS L6

May 19th, 2020
1,360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.60 KB | None | 0 0
  1. function ster_6
  2. close all;
  3. tspan = [0.0  10.0];
  4. x0 = [1.5  0 0 7];
  5.  
  6. u = 5;
  7.  
  8. options_ode = odeset('RelTol',1e-6,'AbsTol',1e-6);
  9. [tsol,xsol] = ode45(@(t,x) peniciline(t,x,u), tspan, x0, options_ode);
  10.  
  11. x2 = xsol(:,2);
  12. x4 = xsol(:,4);
  13. wskaznik_jakosci = x2(end)*x4(end)
  14.  
  15. function dx = peniciline(t,x,u)
  16. dx = zeros(4,1);
  17. h1 = 0.11*(x(3)/(0.006*x(1) + x(3)));
  18. h2 = 0.0055*(x(3)/(0.0001 + x(3)*(1 + 10*x(3))));
  19. dx(1) = h1*x(1) - u*(x(1)/(500*x(4)));
  20. dx(2) = h2*x(1) - 0.01*x(2) - u*(x(2)/(500*x(4)));
  21. dx(3) = -h1*x(1)/0.47 - h2*x(1)/1.2 - x(1)*((0.029*x(3))/(0.0001 + x(3)));
  22. dx(4) = u/500;
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement