0% found this document useful (0 votes)
153 views

Practical-2: Plotting of Third Order Solution Family of Differential Equation

The document solves four third-order differential equations and plots the solutions. It uses DSolve to find the general solution to each equation as an exponential function. Specific solutions are plotted by assigning values to the constants of integration.

Uploaded by

nidhikoshalia
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)
153 views

Practical-2: Plotting of Third Order Solution Family of Differential Equation

The document solves four third-order differential equations and plots the solutions. It uses DSolve to find the general solution to each equation as an exponential function. Specific solutions are plotted by assigning values to the constants of integration.

Uploaded by

nidhikoshalia
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/ 4

Practical-2

Plotting of third order solution family of differential


equation
d3 y d2 y dy
Question 1: Solve third order differential equation 3
-5 +8 - 4y =0 and plot its any
dx dx2 dx
three solutions.
Solution:

I n [ ] : = Needs["PlotLegends`"]
sol = DSolve[y '''[x] - 5 y ''[x] + 8 y '[x] - 4 y[x]  0, y[x], x]
sol1 = Evaluate[y[x] /. sol〚1〛 /. {C[1]  1, C[2]  0.5, C[3]  2 / 3}]
sol2 = Evaluate[y[x] /. sol〚1〛 /. {C[1]  - 1 / 2, C[2]  0, C[3]  1}]
sol3 = Evaluate [y[x] /. sol〚1〛 /. {C[1]  - 1, C[2]  - 4, C[3]  2}]
Plot[{sol1, sol2, sol3}, {x, - 5, 3}, PlotRange  {- 30, 30},
PlotStyle  {{Red, Thickness[0.01]}, {Green, Thick},
{Purple, Thickness[0.02]}}, PlotLegend  {sol1, sol2, sol3}]
O u t [ ] =

y[x]  x 1 + 2 x 2 + 2 x x 3 

O u t [ ] =
2
x + 0.5 2 x + 2 x x
3
O u t [ ] =
x
- + 2 x x
2
O u t [ ] =

- x - 4  2 x + 2  2 x x
O u t [ ] =
30

20

10

-4 -2 2
2
2 x x + x + 0.5 
-10
3

x
2 x x - -20
2
-30
2 2 x x -  x - 4  2 x

d3 y d2 y dy
Question 2: Solve third order differential equation 3
+3 -25 +21y =0 and plot its any
dx dx2 dx
four solutions.
2 NIDHI P2.nb

Solution:

I n [ ] : =

Needs["PlotLegends`"]
sol = DSolve[y '''[x] + 3 y ''[x] - 25 y '[x] + 21 y[x]  0, y[x], x]
sol1 = Evaluate[y[x] /. sol〚1〛 /. {C[1]  1, C[2]  0, C[3]  2}]
sol2 = Evaluate [y[x] /. sol〚1〛 /. {C[1]  - 1 / 2, C[2]  0, C[3]  1}]
sol3 = Evaluate[y[x] /. sol〚1〛 /. {C[1]  - 1, C[2]  - 4, C[3]  2}]
sol4 = Evaluate[y[x] /. sol〚1〛 /. {C[1]  - 0.5, C[2]  - 2, C[3]  1}]
Plot[{sol1, sol2, sol3, sol4}, {x, - 0.5, 0.5},
PlotStyle  {{Red, Thickness[0.01]}, {Green, Thick}, {Purple, Thickness[0.02]},
{Orange, Thickness[0.01]}}, PlotLegend  {sol1, sol2, sol3, sol4}]
O u t [ ] =

y[x]  -7 x 1 + x 2 + 3 x 3 
O u t [ ] =

-7 x + 2 3 x
O u t [ ] =
1
- -7 x + 3 x
2
O u t [ ] =

- -7 x - 4 x + 2 3 x
O u t [ ] =

- 0.5 -7 x - 2 x + 3 x
O u t [ ] =
20

10

-0.4 -0.2 0.2 0.4


- 7 x + 2  3 x
1 -10
3 x - - 7 x
2

--7 x - 4 x +
-20
-7 x
-0.5  -2

d3 y d2 y dy
Question 3: Solve third order differential equation 3
-4 -25 +28y =0 and plot its any
dx dx2 dx
four solutions .
solution:
NIDHI P2.nb 3

I n [ ] : = Needs["PlotLegends`"]
eqn = y '''[x] - 4 * y ''[x] - 25 * y '[x] + 28 * y[x]
sol = DSolve[eqn  0, y[x], x]
sol1 = Evaluate[y[x] /. sol〚1〛 /. {C[1]  1, C[2]  0, C[3]  2}]
sol2 = y[x] /. sol〚1〛 /. {C[1]  - 2, C[2]  10, C[3]  3}
sol3 = y[x] /. sol〚1〛 /. {C[1]  - 1, C[2]  - 4, C[3]  20}
sol4 = y[x] /. sol〚1〛 /. {C[1]  - 0.5, C[2]  - 2, C[3]  1}
Plot[{sol1, sol2, sol3, sol4}, {x, - 0.5, 0.5},
PlotStyle  {{Red, Thickness[0.01]}, {Green, Thick}, {Purple, Thickness[0.02]},
{Orange, Thickness[0.01]}}, PlotLegend  {sol1, sol2, sol3, sol4}]
O u t [ ] =

28 y[x] - 25 y′ [x] - 4 y′′ [x] + y(3) [x]


O u t [ ] =

y[x]  -4 x 1 + x 2 + 7 x 3 
O u t [ ] =

-4 x + 2 7 x
O u t [ ] =

- 2 -4 x + 10 x + 3 7 x
O u t [ ] =

- -4 x - 4 x + 20 7 x
O u t [ ] =

- 0.5 -4 x - 2 x + 7 x
O u t [ ] =

80

60

40
- 4 x + 2  7 x
20
-2 -4 x + 10 

--4 x -0.4
- 4 x + -0.2 0.2 0.4

-0.5 -4 x - 2

d3 y d2 y dy
Question 4: Solve third order differential equation - 13 +19 +33y = cos(2 x) and plot
dx3 dx2 dx
its any four solutions.
Solution:
4 NIDHI P2.nb

I n [ ] : =

eqn = y '''[x] - 13 * y ''[x] + 19 * y '[x] + 33 * y[x] - Cos[2 x]


sol = DSolve[eqn  0, y[x], x]
sol1 = Evaluate[y[x] /. sol〚1〛 /. {C[1]  1, C[2]  0, C[3]  2}]
sol2 = y[x] /. sol〚1〛 /. {C[1]  10, C[2]  3, C[3]  6}
sol3 = y[x] /. sol〚1〛 /. {C[1]  - 1, C[2]  - 7, C[3]  0.7}
sol4 = y[x] /. sol〚1〛 /. {C[1]  - 10.5, C[2]  2, C[3]  1}
Plot[{sol1, sol2, sol3, sol4}, {x, 4, 6},
PlotStyle  {{Red, Thickness[0.01]}, {Green, Thick}, {Purple, Thickness[0.02]},
{Orange, Thickness[0.01]}}, PlotLegend  {sol1, sol2, sol3, sol4}]
O u t [ ] =

- Cos[2 x] + 33 y[x] + 19 y′ [x] - 13 y′′ [x] + y(3) [x]


O u t [ ] =
17 Cos[2 x] + 6 Sin[2 x]
y[x]  -x 1 + 3 x 2 + 11 x 3 + 
1625
O u t [ ] =
17 Cos[2 x] + 6 Sin[2 x]
-x + 2 11 x +
1625
O u t [ ] =
17 Cos[2 x] + 6 Sin[2 x]
10 -x + 3 3 x + 6 11 x +
1625
O u t [ ] =
17 Cos[2 x] + 6 Sin[2 x]
- -x - 7 3 x + 0.7 11 x +
1625
O u t [ ] =
17 Cos[2 x] + 6 Sin[2 x]
- 10.5 -x + 2 3 x + 11 x +
1625
O u t [ ] =

4 × 1027

3 × 1027

2 × 1027
-x + 2 11 x +

27
110
× 10
- x + 3  3

--x - 7 3 x
4.5 5.0 5.5 6.0
-10.5 -x + 2

You might also like