Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function res = SolveDiff(A, cur)
- res = cur;
- t = 0.2;
- for i=1:251
- k1 = t * A * cur;
- k2 = t * A * (cur + k1 / 2.0);
- k3 = t * A * (cur + k2 / 2.0);
- k4 = t * A * (cur + k3);
- next = cur + (1.0 / 6.0) * (k1 + 2.0 * k2 + 2.0 * k3 + k4);
- res = [res, next];
- cur = next;
- end;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement