Guest User

Untitled

a guest
Jun 24th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. M=2;
  2. T=1;
  3. t = linspace(0,T,M+2);
  4. N = length(t);
  5.  
  6. U=zeros(M+2,1);
  7. U(1)=1;
  8. for i=1:M+1
  9. U(i+1)=((t(i+1)^3-t(i)^3)/3+U(i)*(1-2*(t(i+1)-t(i)))/(1+2*(t(i+1)-t(i))));
  10. end
  11. figure
  12. hold on
  13. plot(t,U)
  14. tmore=linspace(0,T,100);
  15. u=(8*tmore.^2-4.*tmore+31*exp(-4.*tmore)+1)/32;
  16.  
  17. plot(tmore,u,'c')
Add Comment
Please, Sign In to add comment