To Find The Homogenous System of First Order and Second Order Differential Equations by Matrix Method
To Find The Homogenous System of First Order and Second Order Differential Equations by Matrix Method
To Find The Homogenous System of First Order and Second Order Differential Equations by Matrix Method
AIM:
To find the homogenous system of first order and second order differential
equations by matrix method.
Mathematical Background:
OUTPUT:
4A2.
MATLABCODE:
clc
clear all
syms k t x1(t) x2(t)
for n=1:length(A)
p(:,n)=null(subs(I,k,eigen_value(n)));
end
x1= dsolve(eqn1,cond1);
eqn2 = diff(x2,t,2)-eigen_value(2)*x2==F1(2);
cond2 = [x2(0)==inc1(2),Dx2(0)==inc2(2)];
x2 = dsolve(eqn2,cond2);
Y = p*[x1;x2];
disp('y1(t)=');
disp(Y(1));
disp('y2(t)=');
disp(Y(2));
OUTPUT:
2.
AIM:
To find the first five terms in the power series solution of the differential equation
y’’+2y’+2y =0.
Mathematical Background:
The power series method is used to seek a power series solution to certain
differential equations. In general, such a solution assumes a power series with
unknown coefficients, then substitutes that solution into the differential equation to find
a recurrence relation for the coefficients.
MATLAB CODE:
clc
clear all;
syms x d0 d1 d2 d3 d4
coe=input('enter coeff of d2y dy and y:');
n=input('Number of terms in the series');
y=d0+d1*x+d2*x^2+d3*x^3+d4*x^4;
DE=coe(1)*diff(y,x,2)+coe(2)*diff(y,x)+coe(3)*y;
coeffs_x=fliplr(coeffs(DE,x,'All'));
d2=solve(coeffs_x(1),d2);
d3=subs(solve(coeffs_x(2),d3));
d4=subs(solve(coeffs_x(3),d4));
disp('First 5 terms in the series solution of DE:');
disp(collect(subs(y),[d0,d1]))
OUTPUT: