Solutions to Differential and Difference Equations
Verified
Added on ย 2020/11/09
|5
|905
|532
AI Summary
This assignment provides solutions to differential and difference equations, including MATLAB code and output for questions on solving homogeneous systems of first-order and second-order differential equations by matrix method, series solutions of ordinary differential equations, and more.
Contribute Materials
Your contribution can guide someoneโs learning journey. Share your
documents today.
Experiment:4A Solution of homogeneous system of first order and second order differential equations by matrix method QUESTION1: Solve the system of differential equations y0 1 = 4y1 + y2 , y0 2 = 3y1 + 2y2, with the initial conditions y1(0) = 2, y2(0) = 0. AIM: finding solution of given differential equation with the help of given intial conditions given MATLAB CODE: clc clearall closeall symst c1 c2 A=input('Enter a squarematrix:'); [v,d]=eig(A) y1=c1*exp(d(1)*t) y2=c2*exp(d(4)*t) X=v*[y1;y2] IC=input('Enter ICsinthe form[t0,x1(t0),x2(t0)]:'); eq1=subs(X(1),IC(1))-IC(2); eq2=subs(X(2),IC(1))-IC(3); [c1,c2]=solve(eq1,eq2); X=subs(X) Applications of Differential and Difference Equations(MAT2002) Instructor: Dr. Aruna. KFall Semester2019-20 Department of Mathematics, School of advanced sciences
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
OUTPUT: X = (3*exp(5*t))/2+exp(t)/2 (3*exp(5*t))/2 - (3*exp(t))/2 QUESTION 2 : Solve the system of differential equation yโโ1 = 2y1+y2, yโโ2 = y1+2y2, with the initial conditions y1(0) = 0,yโ1(0) = 1, y2(0) = 1,yโ2(0) = 0.
AIM: To find the functions of y1(x) and y2(x) MATLAB CODE: clc clearall closeall symst x1(t) x2(t)Dx1(t)Dx2(t) A=input('Enter a squarematrix:'); [p,d]=eig(A); eq1=dsolve(['D2x1=',num2str(d(1)),'*x1']); eq2=dsolve(['D2x2=',num2str(d(4)),'*x2']); X=[eq1;eq2] X=p*X OUTPUT: X = (2^(1/2)*(C1*exp(3^(1/2)*t)+C2*exp(- 3^(1/2)*t)))/2 - (2^(1/2)*(C2*exp(t)+ C1*exp(-t)))/2 (2^(1/2)*(C2*exp(t)+C1*exp(-t)))/2+ (2^(1/2)*(C1*exp(3^(1/2)*t)+C2*exp(- 3^(1/2)*t)))/2 Experiment: 4B Series solutions of ordinary differential equations
QUESTION 1 : Find thefirstfive terms in the power series solution of the differential equation yโโ+ x2* y = 0 with the initial conditions y(0) = 1, yโ(0) = 2 AIM: To find the power series of the given differential equations MATLAB CODE: clc clearall closeall symsx a0 a1 a2 a3a4a5ABt p=input('enter p:'); q=input('enter q:'); r=input('enter r:'); z=input('enter point:') a = [a0 a1 a2 a3 a4a5] y = sum(a.*(x-z).^[0:5]) dy = diff(y) d2y = diff(dy) de = collect(p*d2y+q*dy+r*y,(x-z)) de=subs(de,x-z,t) coef=coeffs(de,t); A2=solve(coef(1),a2) A3=solve(coef(2),a3) A4=subs(solve(coef(3),a4),a2,A2) A5=subs(solve(coef(4),a5),{a2,a3},{A2,A3}) y=subs(y,{a2,a3,a4,a5},{A2,A3,A4,A5}) soln=coeffs(y,[a1a0]) gs=A*soln(1)+B*soln(2) IC=input('Enter ICsinvectorform[xy(x) dy(x)]: '); eq1=subs(gs,x,IC(1))-IC(2); eq2=subs(diff(gs),x,IC(1))-IC(3); [A B]=solve(eq1,eq2)
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser