1. Consider the system of differential equations: y(a)a In the above, y is a (co
ID: 3739103 • Letter: 1
Question
1. Consider the system of differential equations: y(a)a In the above, y is a (column) vector function in t as g(t) (n()2(t).Vm(t)P, A is a constant coefficient matrix of size m X m, and va is the given initial vector. Here the subscript tp means transpose. Use the mid-point method, the explit trapezoid method, and the implicit trapezoid method to solve the system. . y midpoint-ivp-eys (n , a,b,A,ya). y -extrapez.ivp-sys (n,a,b,A,ya) y - imtrapez.ivp.sys(a, a.b.A.ya) , ya is the initial column vector. y is the column vector as the numerical approximations.Explanation / Answer
Following is the complet method:
m=size(A,1);
h=(b-a)/n;
% Initialization of x as column vectors and y as an array of m dimensional
% column vectors of size n, each row y(i,:) stores solution approx of y_i(t)
x=[a zeros(1,n)];
y=[ya zeros(m,n)];
% Calculation of x and y
for i=1:n
x(i+1)=x(i)+h;
y(:,i+1)=y(:,i)+h*A*y(:,i);
end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.