google.com, pub-3534375712831849, DIRECT, f08c47fec0942fa0 MTH643 Assignment 2 Solution Fall 2021 2022 Download in Word File Free
Latest Updates
Loading...

MTH643 Assignment 2 Solution Fall 2021 2022 Download in Word File Free



Instructions: Write the code of the given problems in the Script File of MATLAB and then copy the code on
the LMS assignment module directly. Also, copy the output of the program.
Question:


Solve the following differential equations using
1. ode45 command
2. dsolve command
Then plot the solutions from both commands in the same window by keeping the marker * (Asterisk) of
second curve.


Solution:

MTH643 Assignment 2 Solution

Solved By: Abdul Hadi E Services

 

 


clear all

close all

clc

eq1=@(t,y)-y+2*exp(2*t)*cos(t);

tlimit= [0,3];

y0=-5;

[t, y]=ode45(eq1, tlimit, y0);

plot(t,y)

hold on

syms y(t)


eq2=diff(y,t)==-y+2*exp(2*t) *cos(t);

cond=y(0)==-5;

ysol(t)=dsolve(eq2, cond);

Final=matlabFunction(ysol(t));

fplot(Final, tlimit,'*')

hold off



Download MTH643 Assignment in word


Download File Now


 

Want more info, please press the below button




`

Post a Comment

0 Comments