logo

Applications of Differential and Difference Equations – MAT2002 Lab

5 Pages807 Words364 Views
   

Added on  2020-11-09

Applications of Differential and Difference Equations – MAT2002 Lab

   Added on 2020-11-09

ShareRelated Documents
APPLICATIONS OF DIFFERENTIALAND DIFFERENCE EQUATIONS –MAT2002LAB ASSIGNMENT – 05NAME: S. UDAY KIRANREGNO.: 18MIS0050FACULTY NAME: ARUNA.KSLOT: L47+L48EXPERIMENT – 5AZ-transforms and their applications for solvingDifference equationsQUESTION 1:Solve yn+2 −4yn+1 + 3yn = n(2^n), n ≥ 0 y0 = 0, y1 = 0 using Z-transform. Plot the solutionAIM:To find the solution of the difference equation using the initial conditions given and Z-transform MATLAB CODE:clear allclcsyms n z y(n) YA=input('Enter y(n+2),y(n+1),y(n) coeff in vector form');
Applications of Differential and Difference Equations – MAT2002 Lab_1
f=input('Enter the non-homogeneous part f(x): ');cond=input('Enter the initial conditions in form [y(0),y(1)]: ')a=A(1);b=A(2);c=A(3);eqn=ztrans(a*y(n+2)+b*y(n+1)+c*y(n)-f)y0=cond(1);dy0=cond(2);eqn=subs(eqn,{str2sym('ztrans(y(n),n,z)'),str2sym('y(0)'),str2sym('y(1)')},{Y,y0,dy0});Y=solve(eqn,Y);y=simplify(iztrans(Y,z,n))m=0:10;disp('The solution of the differential equation : ')disp(y);y=subs(y,n,m)stem(y)INPUT:Enter y(n+2),y(n+1),y(n) coeff in vector form[1 -4 3]Enter the non-homogeneous part f(x): 2*(2^n)Enter the initial conditions in form [y(0),y(1)]: [0 0]OUTPUT:The solution of the differential equation : 3^n - 2*2^n + 1y =[ 0, 0, 2, 12, 50, 180, 602, 1932, 6050, 18660, 57002]
Applications of Differential and Difference Equations – MAT2002 Lab_2

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Applications of Differential and Difference Equations(MAT2002)
|5
|905
|532

Engineering Maths and Modelling
|10
|1347
|81

Maths Integration
|14
|1224
|49

AVL Tree, Set Intersection Algorithms, Sloppy Inc. Communication, Array Search
|9
|2413
|78

Desklib SEO Suggestions
|9
|2414
|194

Assignment on Numerical Methods
|7
|835
|361