Professional Documents
Culture Documents
Clear@y, xD
Clear@y, xD
Clear@y, xD
Clear@y, xD
Clear@y, xD
2 jyoti.nb
Clear@y, xD
DSolve::bvnul : For some branches of the general solution, the given boundary conditions lead to an empty solution. ‡
::y@xD ® 1+ - 16 + x2 >>
Clear@y, xD
Clear@y, xD
ClearAll
ClearAll
Clear@y, xD
Clear@y, xD
DSolve@
8y '''@xD - 6 * y ''@xD + 11 * y '@xD - 6 * y@xD Š 0, y@0D Š 0, y '@0D Š 0, y ''@0D Š 3<, y@xD, xD
::y@xD ® ãx H- 1 + ãx L2 >>
3
2
Clear@y, xD
Plot@
Evaluate@y@xD •. sol •. 8C@1D ® Range@- 15, 15D, C@2D ® Range@- 15, 15D<D, 8x, - 5, 5<D
20
10
-4 -2 2 4
-10
-20
::y@xD ® -
1
+ C@1D CosB 2 xF + C@2D SinB 2 xF>>
2
Plot@
Evaluate@y@xD •. sol1 •. 8C@1D ® Range@- 10, 10D, C@2D ® Range@- 10, 10D<D, 8x, - 5, 5<D
10
-4 -2 2 4
-5
-10
-15
Plot@Evaluate@y@xD •. sol2 •. 8C@1D ® Range@- 5, 5D, C@2D ® Range@- 5, 5D<D, 8x, - 7, 7<D
-6 -4 -2 2 4 6
-2
-4
-6
Plot@
Evaluate@y@xD •. sol3 •. 8C@1D ® Range@- 10, 10D, C@2D ® Range@- 10, 10D<D, 8x, - 10, 10<D
4000
2000
-10 -5 5 10
-2000
-4000
jyoti.nb 5
Manipulate@Plot@Hx ^ 3L * C@1D + C@2D • Hx ^ 4L, 8x, - 6, 6<D, 8C@1D, 1, 4<, 8C@2D, 0, 10<D
Plot@
Evaluate@y@xD •. sol4 •. 8C@1D ® Range@- 10, 10D, C@2D ® Range@- 10, 10D<D, 8x, - 10, 10<D
500
-10 -5 5 10
-500
6 jyoti.nb
Plot@Evaluate@y@xD •. sol5 •. 8C@1D ® Range@- 3, 3D, C@2D ® Range@- 3, 3D<D, 8x, - 3, 3<D
150
100
50
-3 -2 -1 1 2 3
-50
-100
-150
jyoti.nb 7
Plot@Evaluate@y@xD •. sol6 •.
8C@1D ® Range@- 5, 5D, C@2D ® Range@- 5, 5D, C@3D ® Range@- 5, 5D<D, 8x, - 5, 5<D
300
200
100
-4 -2 2 4
-100
-200
-300
Plot@Evaluate@y@xD •. sol7 •.
8C@1D ® Range@- 5, 5D, C@2D ® Range@- 5, 5D, C@3D ® Range@- 5, 5D<D, 8x, - 5, 5<D
30
20
10
-4 -2 2 4
-10
-20
-30
Plot@Evaluate@y@xD •. sol8 •.
8C@1D ® Range@- 5, 5D, C@2D ® Range@- 5, 5D, C@3D ® Range@- 5, 5D<D, 8x, - 5, 5<D
400
200
-4 -2 2 4
-200
-400
Plot@Evaluate@y@xD •. sol9 •.
8C@1D ® Range@- 5, 5D, C@2D ® Range@- 5, 5D, C@3D ® Range@- 5, 5D<D, 8x, - 5, 5<D
30
20
10
-4 -2 2 4
-10
-20
-30
::y@xD ® >>
C@1D C@2D Log@xD C@3D Log@xD2
+ +
x x x
10 jyoti.nb
Plot@Evaluate@y@xD •. sol10 •.
8C@1D ® Range@- 5, 5D, C@2D ® Range@- 5, 5D, C@3D ® Range@- 5, 5D<D, 8x, - 5, 5<D
15
10
-4 -2 2 4
-5
-10
-15
, 8x, - 5, 5<F,
C@1D C@2D Log@xD C@3D Log@xD2
ManipulateBPlotB + +
x x x
8C@1D, - 5, 5<, 8C@2D, - 5, 5<, 8C@3D, - 5, 5<F
jyoti.nb 11
25
20
15
10
20 40 60 80 100
The expected population of the world in 100 years from 1990 is 29.0119 billion.
Question: When sugar is dissolved in water, the amount of sugar A, which remains undis-
solved after t minutes satisfies the differential equation dA/dt=-0.5A. Find an expression for
A in terms of t and decipt it graphically.
DSolve@A '@tD Š - 0.5 A@tD, A@tD, tD
99A@tD ® ã-0.5 t C@1D==
12 jyoti.nb
Plot @8Exp@- 0.5 tD, 2 * Exp@- 0.5 tD, 3 * Exp@- 0.5 tD<, 8t, 0, 100<D
0.0007
0.0006
0.0005
0.0004
0.0003
0.0002
0.0001
20 40 60 80 100
k = 1000
1000
x¢ @tD Š x@tD -
x@tD2
1000
::x@tD ® >>
1000 ãt x0
1000 - x0 + ãt x0
jyoti.nb 13
800
600
400
200
2 4 6 8 10
1150
1100
1050
2 4 6 8 10
r=2
2
k = 1000
1000
x¢ @tD Š 2 x@tD -
x@tD2
500
::x@tD ® >>
1000 ã2 t x0
1000 - x0 + ã2 t x0
14 jyoti.nb
800
600
400
200
2 4 6 8 10
K = 10
10
H = 9 • 10
9
10
::x@tD ® >>
9 - 9 ã4 t•5 - x0 + 9 ã4 t•5 x0
9 - ã4 t•5 - x0 + ã4 t•5 x0
jyoti.nb 15
9.00010
9.00005
9.00000
8.99995
10 20 30 40 50
R=2
2
K = 10
10
H = 9 • 10
9
10
x¢ @tD Š
1 9
- + 10 x@tD - x@tD2
5 2
82 t 82 t 82 t
::x@tD ® >>
9-9ã 5 - 10 x0 + 82 x0 + 10 ã 5 x0 + 82 ã 5 x0
82 t 82 t 82 t
10 + 82 - 10 ã 5 + 82 ã 5 - 2 x0 + 2 ã 5 x0
16 jyoti.nb
9.52769
9.52769
9.52769
9.52769
9.52769
10 20 30 40 50
k2 = 0.1386
0.1386
sol = NDSolve@8de1, de2, x@0D Š 1, y@0D Š 0<, 8x@tD, y@tD<, 8t, 0, 20<D
88x@tD ® InterpolatingFunction@880., 20.<<, <>D@tD,
y@tD ® InterpolatingFunction@880., 20.<<, <>D@tD<<
jyoti.nb 17
0.8
0.6
Gastro-Intestinal Tract
0.4
Bloodstream
0.2
5 10 15 20
Description:
The initial concentration of the pill in the gastro intestinal tract is same as the
initial concentration of the pill, that is, 1. And therefore, the first graph starts at 1
on the y-axis. The concentration of the pill in the gastro-intestinal tract decreases
as the drug diffuses into the bloodstream. Thus, the graph showing concentra-
tion in the gastro-intestinal tract decreases, and the corresponding graph of the
bloodstream increases. Finally, after a certain time, the concentration of drug in
the bloodstream also starts decreasing.
Case of a Course of Pills:
K1 = 1.386
1.386
K2 = 0.1386
0.1386
SOL = NDSolve@8DE1, DE2, u@0D Š 0, v@0D Š 0<, 8u@tD, v@tD<, 8t, 0, 20<D
88u@tD ® InterpolatingFunction@880., 20.<<, <>D@tD,
v@tD ® InterpolatingFunction@880., 20.<<, <>D@tD<<
18 jyoti.nb
4
Gastro-Intestinal Tract
3 Bloodstream
5 10 15 20
Description:
Both the graphs start from zero, since the initial concentration of the drug in both,
the gastro-intestinal tract and the bloodstream is zero. There is a constant inges-
tion rate=1. As the pill is taken at certain constant intervals of time, gradually the
concentration of the drug in both the chambers reaches a certain fixed value. Till
the time the pill continues to be taken at such constant intervals, the body main-
tains a constant concentration of the drugs.
jyoti.nb 19
C¢ @tD Š H3 - C@tDL
12
7
99C@tD ® ã-12 t•7 I- 3 + CO + 3 ã12 t•7 M==
3.4
3.3
3.2
3.1
3.0
2.9
2.8
2 4 6 8 10
20 jyoti.nb
cin = 4;
v = 25;
F = 60;
de = D@C@tD, tD Š HF • vL * Hcin - C@tDL
sol = DSolve@8de, C@0D Š CO<, C@tD, tD
Plot @Evaluate@C@tD •. sol •. CO ® Range@- 20, 30DD, 8t, 0, 10<D
C¢ @tD Š H4 - C@tDL
12
5
99C@tD ® ã-12 t•5 I- 4 + CO + 4 ã12 t•5 M==
4.005
4.000
3.995
2 4 6 8 10
jyoti.nb 21
V = 28;
de1 = D@C@tD, tD Š HH1 + 6 Sin@2 * Pi * tDL * H10 - C@tDLL • V
sol1 = DSolve @8de1, C@0D Š co<, C@tD, tD
Plot @Evaluate @C@tD •. sol1 •. co ® Range @2, 20DD, 8t, 0, 10<D
::C@tD ® ã >>
3 t 3 t 3 Cos@2 p tD 3 Cos@2 p tD
- - +
28 p 28 10 ã 28 p 28 - 10 ã 28 p + co ã 28 p
20
15
10
2 4 6 8 10
22 jyoti.nb
V = 28;
de1 = D@C@tD, tD Š HH1 + Cos@2 * Pi * tDL * H10 - C@tDLL • V
sol1 = DSolve @8de1, C@0D Š co<, C@tD, tD
Plot @Evaluate @C@tD •. sol1 •. co ® Range @2, 20DD, 8t, 0, 10<D
::C@tD ® ã >>
t Sin@2 p tD t Sin@2 p tD
- - +
28 56 p - 10 + co + 10 ã 28 56 p
20
15
10
2 4 6 8 10
V = 28;
de1 = D@C@tD, tD Š HH1 + 4 Tan@2 * Pi * tDL * H10 - C@tDLL • V
sol1 = DSolve @8de1, C@0D Š co<, C@tD, tD
Plot @Evaluate @C@tD •. sol1 •. co ® Range @2, 20DD, 8t, 0, 10<D
20
15
10
2 4 6 8 10
PRACTICAL 8
jyoti.nb 23
PRACTICAL 8
PREDATOR PREY MODEL
a) LOTKA- VOLTERRA MODEL
b1 = 1;
a2 = 0.5;
c1 = 0.01;
c2 = 0.005;
sol = NDSolve@8de1, de2, x@0D Š 200, y@0D Š 80<, 8x@tD, y@tD<, 8t, 0, 50<D
88x@tD ® InterpolatingFunction@880., 50.<<, <>D@tD,
y@tD ® InterpolatingFunction@880., 50.<<, <>D@tD<<
200
150
Prey
Predator
100
50
10 20 30 40 50
a2 = 0.5;
c1 = 0.01
0.01
24 jyoti.nb
c2 = 0.005
0.005
p1 = 0.1;
p2 = 0.1;
sol = NDSolve@8de1, de2, x@0D Š 200, y@0D Š 80<, 8x@tD, y@tD<, 8t, 0, 20<D
88x@tD ® InterpolatingFunction@880., 20.<<, <>D@tD,
y@tD ® InterpolatingFunction@880., 20.<<, <>D@tD<<
200
180
160
140
Prey
120 Predator
100
80
60
5 10 15 20
b1 = 1;
a2 = 0.5;
c1 = 0.01;
c2 = 0.005;
k = 1000;
x¢ @tD Š 1 -
x@tD
x@tD - 0.01 x@tD y@tD
1000
jyoti.nb 25
sol = NDSolve@8de1, de2, x@0D Š 120, y@0D Š 80<, 8x@tD, y@tD<, 8t, 0, 100<D
88x@tD ® InterpolatingFunction@880., 100.<<, <>D@tD,
y@tD ® InterpolatingFunction@880., 100.<<, <>D@tD<<
120
110
Prey
100
Predator
90
20 40 60 80 100
b2 = 0.5;
b3 = 0.5;
c1 = 0.01;
c2 = 0.01;
c3 = 0.01;
c4 = 0.01;
sol = NDSolve@8de1, de2, de3, x@0D Š 200, y@0D Š 180, z@0D Š 100<,
8x@tD, y@tD, z@tD<, 8t, 0, 10<D;
800
600
prey1
400 Prey2
Predator
200
b1 = 1;
b2 = 0.5;
b3 = 0.5;
c1 = 0.01;
c2 = 0.01;
c3 = 0.01;
c4 = 0.01;
sol = NDSolve@8de1, de2, de3, x@0D Š 200, y@0D Š 180, z@0D Š 100<,
8x@tD, y@tD, z@tD<, 8t, 0, 10<D;
400
300
prey1
Prey2
200
Predator
100
1 2 3 4 5
PRACTICAL 9
BATTLE MODEL
a2 = 0.0106
0.0106
sol = NDSolve@8de1, de2, r@0D Š 66 454, b@0D Š 18 274<, 8r@tD, b@tD<, 8t, 0, 20<D;
Plot@Evaluate@8r@tD, b@tD< •. solD, 8t, 0, 20<, PlotRange ® All, PlotStyle ® 8Red, Blue<D
60 000
50 000
40 000
30 000
20 000
10 000
5 10 15 20
Plot@Evaluate@8r@tD, b@tD< •. solD, 8t, 0, 10<, PlotRange ® All, PlotStyle ® 8Red, Blue<D
100
80
60
40
20
2 4 6 8 10
350
300
250
200
red army
150 blue army
100
50
5 10 15 20 25 30
30 jyoti.nb
60
50
40
red army
30
blue army
20
10
5 10 15 20 25 30