Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. format long
  2. kvoter = [];
  3. kvoterrk = [];
  4.  
  5. for n=1000:1000:10000
  6. [t1,y1] = feuler([0.5,0]',5, 1*n);
  7. [t2,y2] = feuler([0.5,0]',5, 2*n);
  8. [t4,y4] = feuler([0.5,0]',5, 4*n);
  9. kvotnogcalc = (y1(end,1)-y2(end,1))/(y2(end,1)-y4(end,1));
  10. kvoter = [kvoter, kvotnogcalc];
  11. end
  12.  
  13. for n=1000:1000:10000
  14. [t1,y1] = rk4([0.5,0]',5, 1*n);
  15. [t2,y2] = rk4([0.5,0]',5, 2*n);
  16. [t4,y4] = rk4([0.5,0]',5, 4*n);
  17. kvotnogcalcrk = (y1(end,1)-y2(end,1))/(y2(end,1)-y4(end,1));
  18. kvoterrk = [kvoterrk, kvotnogcalcrk];
  19. disp(y1(end,1))
  20. disp(y2(end,1))
  21. disp(y4(end,1))
  22. end
  23.  
  24. table1 = table(kvoter(1:2:end)',kvoterrk(1:2:end)')
  25. writetable(table1,'kvottabell.xlsx')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement