0% found this document useful (0 votes)
27 views2 pages

Core-4 Matlab (2022)

Fhgjjjk

Uploaded by

lm3546090
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views2 pages

Core-4 Matlab (2022)

Fhgjjjk

Uploaded by

lm3546090
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

MATLAB Command Window Page 1

>> % SOLUTION OD SECOND ORDER DIFFERENTIAL EQUATION

>> clear all

>> format long

>> equ1='D2y+3*Dy+2*y-24=0';

>> inits1='y(0)=10,Dy(0)=0';

>> y=dsolve(equ1,inits1,'x')

y=

2*exp(-2*x) - 4*exp(-x) + 12

>> x=linspace(0,1,10);

>> z=eval(vectorize(y));

>> plot(x,z)

>> title('SECOND ORDER DIFFERENTIAL EQUATION SOLUTION GRAPH');

SECOND ORDER DIFFERENTIAL EQUATION


10.9

10.8

10.7

10.6

10.5
Z

10.4

10.3

10.2

10.1

10
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
X--->
MATLAB Command Window Page 1

>> % SOLUTION OF LINEAR DIFFERENTIAL EQUATION

>> clear all

>> format long

>> equ2='Dy+5*y-3*exp(x)=0';

>> inits2='y(0)=0';

>> y=dsolve(equ2,inits2,'x');

>> y

y=

exp(x)/2 - exp(-5*x)/2

>> x=linspace(0,1,10);

>> z=eval(vectorize(y));

>> plot(x,z)

>> title('Solution of Linear differential Equation')

>> xlabel('X')

>> ylabel('Z')
Solution of Linear differential Equation
1.4

1.2

0.8
Z

0.6

0.4

0.2

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
X

You might also like