Answers for "Metod numerico"

0

Metod numerico

function [t,u,v] = MN01(f,g,a,b,n,u0,v0)
 
h = ____(b-a)/n___;
 
t = _____a:h:b_____;
 
u = zeros(1,n+1);
 
v = zeros(1,n+1);
 
u(1) = u0;
 
v(1) = v0;
 
for i = 1:n
 
    u(i+1) = u(i)+h*f(t(i),u(i),v(i));
 
    v(i+1) = v(i)+h*g(t(i),u(i),v(i));
 
    u(i+1) = u(i)+(h/2)*(f(t(i),u(i),v(i))+f(t(i+1),u(i+1),v(i+1)));
 
    v(i+1) =v(i)+(h/2)*(g(t(i),u(i),v(i))+g(t(i+1),u(i+1),v(i+1)));
 
end
Posted by: Guest on July-02-2021

Browse Popular Code Answers by Language