Advertisement
Guest User

GUIA 10 PNG 2018-1

a guest
May 29th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Octave 0.87 KB | None | 0 0
  1. TAREA10
  2. --------------------------------------------------------------------------------------
  3. EJERCICIO 1)
  4. %%%%%%%%%% ARCHIVO 'f.m' %%%%%%%%%%%%%%%
  5. function xdot = f (x,t)
  6. xdot=-exp(-t)*x^2;
  7. endfunction
  8. %%%%%%%%%% CONSOLA OCTAVE %%%%%%%%%%%%%%
  9. > x=lsode("f",2,(t=linspace(0,5,50)'));
  10. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  11.  
  12. a) RECONSTRUIR LA ECUACION:
  13.  
  14. x'(t) = -e(-t)*x^2(t) ; x(0) = 2
  15.  
  16. b) GRAFICAMOS EN EL INTERVALO (0,5)
  17.  
  18. << https://imgur.com/a/kC4C6RW >>
  19.  
  20. --------------------------------------------------------------------------------------
  21. EJERCICIO 2)
  22.  
  23. %%%%%%%%%% CONSOLA MATLAB %%%%%%%%%%%%%%
  24. >> f=inline('x*y^2+y');
  25. >> [x,y] = ode45(f,[0 0.5],1);
  26. >> plot(x,y)
  27. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  28.  
  29. GRAFICO:
  30.  
  31. << https://imgur.com/a/qajQv93 >>
  32. --------------------------------------------------------------------------------------
  33. EJERCICIO 3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement