Download as pdf or txt
Download as pdf or txt
You are on page 1of 39

Date 04 /01 /2019

Day - Friday

Test the sequence and series


convergence of sequence
ListPlotTable[1 /n, {n, 50}]
4
19
convergence of sequence

0.25

0.20

0.15

0.10

0.05

10 20 30 40 50

ListPlotTable[n ^ 3 +1, {n, 45}]

80 000

60 000

40 000

20 000

10 20 30 40
2 Km Swayla.nb

ListPlotTableSinn 3 Pi2, {n, 100}

1.0

0.5

20 40 60 80 100

-0.5

-1.0

ListPlotTable[Cos[1 /n], {n, 100}]


1.000

0.999

0.998

0.997

20 40 60 80 100

ListPlotTable[5 n ^ 2 /n, {n, 7}]

35

30

25

20

15

10

1 2 3 4 5 6 7
Km Swayla.nb 3

ListPlotTable [n ^ 2 /n +1, {n, 20}]

20

15

10

5 10 15 20

DiscretePlot[1 /n, {n, 1, 100}]


0.12

0.10

0.08

0.06

0.04

0.02

20 40 60 80 100

DiscretePlot[n ^ 2 /(n +1), {n, 1, 20}]

15

10

5 10 15 20
4 Km Swayla.nb

DiscretePlot[1 /n ^ 2, {n, 1, 100}]

0.007

0.006

0.005

0.004

0.003

0.002

0.001

20 40 60 80 100

DiscretePlot[n ^ n /n ^ 3, {n, 1, 60}]

1.5 × 1080

1.0 × 1080

5.0 × 1079

0 10 20 30 40 50 60

Sequence < 1 /n >

DiscretePlotIfMod[n, 2] ⩵ 0, (1 +1 /n), (-1 -1 /n), {n, 100}


1.5

1.0

0.5

20 40 60 80 100

-0.5

-1.0

-1.5

-2.0
Km Swayla.nb 5

DiscretePlotIfMod[n, 2] ⩵ 0, (n ^ 2 -1 /n), (n +1 /n), {n, 50}


2500

2000

1500

1000

500

0 10 20 30 40 50

DiscretePlotIfMod[n, 2] ⩵ 0, (n ^ 2 -n), (n ^ 2 +1), {n, 100}


10 000

8000

6000

4000

2000

20 40 60 80 100

DiscretePlotIfMod[n, 3] ⩵ 0, (1 +1 /n), (-1 -1 /n), {n, 100}

(convergent)

1.0

0.5

20 40 60 80 100

-0.5

-1.0

-1.5

-2.0
6 Km Swayla.nb

DiscretePlotIfMod[n, 3] ⩵ 0, (1 +n), (-1 -n), {n, 100}


100

50

20 40 60 80 100

-50

-100

DiscretePlotIfMod[n, 10] ⩵ 0, (n +1), (-1 -n), {n, 100}

divergent
100

50

20 40 60 80 100

-50

-100

Date 07 /01 /18

Cauchy ' s root test


Km Swayla.nb 7

an = 3 ^ n /5 ^ n;
ListPlotTableAbs[an]^ (1 /n), {n, 1, 100}
L = Limit Abs[an]^ (1 /n), n → ∞;
Print"lim Abs[an]^(1/n)=", L WhichL < 1, Print"Series S is convergent",
L > 1, Print"Series S is divergent", L = 1, Print"The test is failed"

1.2

1.0

0.8

0.6

0.4

0.2

20 40 60 80 100

3
lim Abs[an]^(1/n)=
5
Series S is convergent

Null2

an = 5 ^ n /3 ^ n;
ListPlotTableAbs[an]^ (1 /n), {n, 1, 100}
L = Limit Abs[an]^ (1 /n), n → Infinity;
Print"lL=Limit [Abs[an]^(1/n),n→∞]im Abs[an]^1/n=", L
WhichL < 1, Print"Series S is convergent", L > 1,
Print"Series S is divergent", L = 1, Print"The test is failed"
3.5

3.0

2.5

2.0

1.5

1.0

0.5

20 40 60 80 100

5
lL=Limit [Abs[an]^(1/n),n→∞]im Abs[an]^1/n=
3
Series S is divergent

Null2
8 Km Swayla.nb

an = (1 +1 /n)^ (n ^ 2);
ListPlotTableAbs[an]^ (1 /n), {n, 1, 100}
L = Limit Abs[an]^ (1 /n), n → Infinity;
Print"lL=Limit [Abs[an]^(1/n),n→∞]im Abs[an]^1/n=", L
WhichL < 1, Print"Series S is convergent", L > 1,
Print"Series S is divergent", L = 1, Print"The test is failed"

2.70

2.68

2.66

2.64

2.62

2.60

2.58

20 40 60 80 100

lL=Limit [Abs[an]^(1/n),n→∞]im Abs[an]^1/n=ⅇ

Series S is divergent

Null2

an = (1 +n /n ^ 2)^ (n ^ 3);
ListPlotTableAbs[an]^ (1 /n), {n, 1, 100}
L = Limit Abs[an]^ (1 /n), n → Infinity;
Print"lim Abs[an]^(1/n)=", L WhichL < 1, Print"Series S is convergent",
L > 1, Print"Series S is divergent", L = 1, Print"The test is failed"

1.5 × 1036

1.0 × 1036

5.0 × 1035

20 40 60 80 100

lim Abs[an]^(1/n)=∞

Series S is divergent

Null2
Km Swayla.nb 9

an = ((5 n -3 (n)^ 3)/(7 (n)^ 3 +1))^ (n);


ListPlotTableAbs[an]^ (1 /n), {n, 1, 100}
L = Limit Abs[an]^ (1 /n), n → Infinity;
Print"lL=Limit [Abs[an]^(1/n),n→∞]im Abs[an]^1/n=", L
WhichL < 1, Print"Series S is convergent", L > 1,
Print"Series S is divergent", L = 1, Print"The test is failed"

0.428

0.427

0.426

0.425

0.424

20 40 60 80 100

3
lL=Limit [Abs[an]^(1/n),n→∞]im Abs[an]^1/n=
7
Series S is convergent

Null2

10 /01 /2019
Thursday
10 Km Swayla.nb

Ratio Test by Plotting the ratio of nth and (n + 1) th


terms
an = 3 ^ n /5 ^ n; bn = (3)^ (n +1)/(5)^ (n +1);
ListPlotTableAbsbn an, {n, 1, 10}
L = Limit Absan bn, n → Infinity;
Print"lim Abs[bn/an]=", L WhichL < 1, Print"Series S is convergent",
L > 1, Print"Series S is divergent", L = 1, Print"the test is failed"

1.2

1.0

0.8

0.6

0.4

0.2

2 4 6 8 10

5
lim Abs[bn/an]=
3
Series S is divergent

Null2

an = 2 ^ n /n ^ 5; bn = 2 ^ (n +1)/(n +1)^ 5;
ListPlotTableAbsbn an, {n, 1, 10}
L = Limit Absan bn, n → Infinity;
Print"lim Abs[bn/an]=", L WhichL < 1, Print"Series S is convergent",
L > 1, Print"Series S is divergent", L = 1, Print"the test is failed"

1.2

1.0

0.8

0.6

0.4

0.2

2 4 6 8 10
Km Swayla.nb 11

1
lim Abs[bn/an]=
2
Series S is convergent

Null2

an = 3 ^ (n)/5 ^ (n); bn = 3 ^ (n +1)/5 ^ (n +1)

ListPlotTableAbsbn an, {n, 1, 10}


L = Limit Absan bn, n → Infinity;
Print"lim Abs[bn/an]=", L WhichL < 1, Print"Series S is convergent",
L > 1, Print"Series S is divergent", L = 1, Print"the test is failed"
3.5

3.0

2.5

2.0

1.5

1.0

0.5

2 4 6 8 10

3
lim Abs[bn/an]=
5
Series S is convergent

Null2
12 Km Swayla.nb

Conclusion:
n = Input"Enter number n for partial sum "
Fori= 1, i≤ n, i++, si = Sum 3 ^ i5 ^ i, i, 1, i;
t = Tablesi, i, n;
ListPlot[t]
10

1.5

1.0

0.5

2 4 6 8 10

Conclusion:
n = 500
Fori= 1, i≤ n, i++, si = Sum 3 ^ i5 ^ i, i, 1, i;
t = Tablesi, i, n;
ListPlot[t]
500

1.5

1.0

0.5

100 200 300 400 500


Km Swayla.nb 13

Conlusion:
n=5
Fori= 1, i≤ n, i++, si = Sum 2 ^ i7 ^ i, i, 1, i;
t = Tablesi, i, n;
ListPlot[t]
5

0.40

0.38

0.36

0.34

0.32

0.30

1 2 3 4 5

n = 10
Fori= 1, i≤ n, i++, si = Sum 3 ^ i2 ^ i, i, 1, i;
t = Tablesi, i, n;
ListPlot[t]
10

150

100

50

2 4 6 8 10

14 /01 /2019
VerifyBolzano WeierstrassTheorem Through Plottingof
Sequences and Hence IdentifyConvergent Subsequences from the Plot
and convergent from hence identifyplot sequences subsequences the
14 Km Swayla.nb

DiscretePlot(-1)n , {n, 50}


1.0

0.5

0 10 20 30 40 50

-0.5

-1.0

DiscretePlotSin3 n Pi2, {n, 50}


1.0

0.5

0 10 20 30 40 50

-0.5

-1.0

DiscretePlotTan 2 n Pi3, {n, 50}

1.5

1.0

0.5

0 10 20 30 40 50

-0.5

-1.0

-1.5
Km Swayla.nb 15

1 n
DiscretePlot 1 + , {n, 1, 100}
n
2.70

2.68

2.66

2.64

2.62

2.60

2.58

20 40 60 80 100

5n
DiscretePlot , {n, 50}
7n
0.12

0.10

0.08

0.06

0.04

0.02

0 10 20 30 40 50

1 n
DiscretePlot 1 + , {n, 1, 1000}
n

2.715

2.710

2.705

200 400 600 800 1000


16 Km Swayla.nb

1 m
Limit  1 + , m → Infinity
m

NPi
3.14159

1 1
DiscretePlotIfMod[n, 2] ⩵ 0, 1 + , -1 - , {n, 100}
n n
1.5

1.0

0.5

20 40 60 80 100

-0.5

-1.0

-1.5

-2.0

1 1
ListPlotTableIfMod[n, 2] ⩵ 0, 1 + , -1 - , {n, 1000}
n n
1.5

1.0

0.5

200 400 600 800 1000

-0.5

-1.0

-1.5

-2.0
Km Swayla.nb 17

1 1 1
DiscretePlotIfMod[n, 3] ⩵ 0, 1 - , -1 - , 1+ , {n, 100}
n n n
1.0

0.5

20 40 60 80 100

-0.5

-1.0

-1.5

-2.0

8. Finda value of N that willmake the followingin

n = 1;
i
Fori= 1, i≤ n, i++, IfAbs (0.5) -1 < 10-3 , Printi, n ++, Break

693

n = 1;
n
Fori= 1, i≤ n, i++, IfAbs n -1 < 10-3 , Printi, n ++, Break

20 / 02 / 2019 WEDNESDAY

Table[Fibonacci[n], {n, 20}]

TableFibonacci[n], {n, 20}


{1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765}

a[0] = 1
a[1] = 1
Fori= 1, i< 10, i++, ai+1 = ai-1+ai; Printai+1
1

1
18 Km Swayla.nb

13

21

34

55

89

fib[n_] := Modulef, f[1] = f[2] = 1; fi_ := fi-1+fi-2; f[n]

fib[20]

6765

fib[2]
1

fib[3]
2

fib[7]
13

fi-1+fi-2
avg[n_] := Modulef, f[1] = f[2] = 1; fi_ := fi = ; f[n]
2
Table[avg[n], {n, 10}]
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1}

22 /02 /2019 FRIDAY


14. For the followingsequence < an >, givenepsilon > 0 p inN,
Findm inN such that a_ (m = p) - a_m < epsilon.

k = Input"k"
j = Input"j"
n = 1;
(n +1) 1
a[n_] := ; e = ; p = 10j ;
n 2k
Fori= 1, i≤ n, i++, IfAbsai+p-ai < e, Printi, n ++, Break
5

26
Km Swayla.nb 19

k=5
j=3
n=1
(n +1) 1
a[n_] := ;e=; p = 10j ;
n 2k
Fori= 1, i≤ n, i++, IfAbsai+p-ai < e, Printi, n ++, Break

32

ClearAlla, k, j

k = Input"k";
Print"k=", k
j = Input"j"
Print"j=", j
n = 1;
(n +1) 1
a[n_] := ; e = ; p = 10j ;
n 2k
Fori= 1, i≤ n, i++, IfAbsai+p-ai < e, Printi, n ++, Break
k=5
5

j=5

32

25 /02 /2019 MONDAY

k = 5;
j = 5;
n = 1;
(-1)n 1
a[n_] := ;e= ; p = 10j ;
n 2k
Fori= 1, i≤ n, i++, IfAbsai+p-ai < e, Printi, n ++, Break
5

32
20 Km Swayla.nb

k=5
j=5
n = 1;
1 1
a[n_] := ; e = ; p = 10j ;
n 2k
Fori= 1, i≤ n, i++, IfAbsai+p-ai < e, Printi, n ++, Break
5

32

k = 5;
j = 5;
n = 1;
(-1)n 1
a[n_] := ; p = 10j ;
;e=
n 2k
Fori= 1, i≤ n, i++, IfAbsai+p-ai < e, Printi, n ++, Break
32

k = Input"k";
j = Input"j";
n = 1;
n +1 1
a[n_] := ; e = ; p = 10j ;
n 2k
Fori= 1, i≤ n, i++, IfAbsa2 i+p-a2 i < e, Printi, n ++, Break
16

k = Input"k"
j = Input"j"
n = 1;
1 1
a[n_] := Sum  ; p = 10j ;
, {r, 1, n}; e =
(r)! 2k
Fori= 1, i≤ n, i++, IfAbsa2 i+p-a2 i < e, Printi, n ++, Break
1

k = Input"k"
j = Input"j"
n = 1;
1 1
a[n_] := Sum  ; p = 10j ;
, {r, 1, n}; e =
(r)! 2k
Fori= 1, i≤ n, i++, IfAbsai+p-ai < e, Printi, n ++, Break
5

5
Km Swayla.nb 21

k = Input"k"
j = Input"j"
n = 1;
(-1)(r+1) 1
a[n_] := Sum  ; p = 10j ;
, {r, 1, n}; e =
r 2k
Fori= 1, i≤ n, i++, IfAbsai+p-ai < e, Printi, n ++, Break
5

16

25 /03 /2019

1
s = DSolvey ''[x]+y[x] ⩵ 0, y[0] ⩵ 1, y '[0] ⩵ , y, x
3
1
y → Function{x}, 3 Cos[x]+Sin[x]
3

Plot[y[x] /. s, {x, 0, 17}]

1.0

0.5

5 10 15

-0.5

-1.0

DSolve[{y ''[x]+2 y '[x]+y[x] ⩵ 0, y[0] ⩵ 2, y '[0] ⩵ 5}, y, x]


y → Function[{x}, ⅇ-x (2 +7 x)]

Plot[y[x] /. %, {x, -10, 10}]

-10 -5 5 10

-20 000

-40 000

-60 000
22 Km Swayla.nb

DSolve[{y ''[x]+2 y '[x]+y[x] ⩵ 0}, y, x]


y → Function[{x}, ⅇ-x C[1]+ⅇ-x x C[2]]

DSolve[{y ''[x]+2 y '[x]+y[x] ⩵ 0, y '[0] ⩵ a, y[0] ⩵ 1}, y, x] // Quiet


y → Function[{x}, ⅇ-x (1 +x +a x)]

1 1
PlotEvaluatey[x] /. % /. a → , a → , {a → 4}, {x, 0, 18}
13 2

0.8

0.6

0.4

0.2

5 10 15

DSolve[{y ''[x]+2 y '[x]+y[x] ⩵ 0, y '[0] ⩵ 5, y[0] ⩵ a}, y, x] // Quiet


y → Function[{x}, ⅇ-x (a +5 x +a x)]

1 1
PlotEvaluatey[x] /. % /. a → , a → , {a → 4}, {x, 0, 18}
13 2

2.0

1.5

1.0

0.5

5 10 15

NDSolvex ''[t]+0.15 x '[t]-x[t]+x[t]3 ⩵ 0.3 Cos[t], x[0] ⩵ -1, x '[0] ⩵ 1, x, {t, 0, 50}

Domain: {{0., 50.}}


x → InterpolatingFunction 
Output: scalar
Km Swayla.nb 23

p11 = PlotEvaluate[x[t] /. %], {t, 0, 50}

1.5

1.0

0.5

10 20 30 40 50

-0.5

-1.0

-1.5

DSolve[{y '''[x]+2 y ''[x]-y '[x] ⩵ 0, y ''[0] ⩵ a, y '[0] ⩵ 1, y[0] ⩵ 1}, y, x] // Quiet


1 -1+ 2 x
y → Function{x}, - ⅇ -4 +3 2 -2 a + 2 a -4 ⅇ2 2 x
-
4
2 x 2 x
2 ⅇ2 2 x
-2 a ⅇ2 2 x
- 2 a ⅇ2 2 x 1+ 1+
3 +4 ⅇ +4 a ⅇ 

PlotEvaluate[y[x] /. % /. {{a → 2}, {a → 1}, {a → 4}}], {x, 0, 17}

3000

2500

2000

1500

1000

500

5 10 15

DSolve[{y '''[x]+2 y ''[x]-y '[x] ⩵ 0, y ''[0] ⩵ 5, y '[0] ⩵ 1, y[0] ⩵ 1}, y, x] // Quiet


1 -1+ 2 x 2 x
2 -7 ⅇ2 2 x
2 ⅇ2 2 x 1+
y → Function{x}, - ⅇ -7 +4 -4 +12 ⅇ 
2
24 Km Swayla.nb

Plot[y[x] /. %, {x, 0, 17}]

4000

3000

2000

1000

5 10 15

NDSolve[{y '''[x]+2 y ''[x]-y '[x] ⩵ 0, y ''[0] ⩵ 5, y '[0] ⩵ 1, y[0] ⩵ 1}, y, {x, 0, 17}]

Domain: {{0., 17.}}


y → InterpolatingFunction 
Output: scalar

1
NDSolvey ''[x]+y[x] ⩵ 0, y[0] ⩵ 1, y '[0] ⩵ , y, {x, 0, 10}
3

Domain: {{0., 10.}}


y → InterpolatingFunction 
Output: scalar

26 /03 /2019
LAKE POLLUTION MODEL
f = 48;
v = 28;
cin= 3
f
DSolveC '[t] ⩵ *cin-C[t], C[0] ⩵ a, C, t // Quiet
v
3

C → Function{t}, ⅇ-12 t/7 -3 +a +3 ⅇ12 t/7 


Km Swayla.nb 25

p1 = Plot
Evaluate[C[t] /. % /. {{a → 10}, {a → 8}, {a → 6}, {a → 4}, {a → 2}, {a → 1}}], {t, 0, 10}

3.08

3.06

3.04

3.02

3.00

2.98

2.96

2 4 6 8 10

f = 48;
v = 28;
cin= 3
f
DSolveC '[t] ⩵ *cin-C[t], C[0] ⩵ 4, C, t // Quiet
v
3

C → Function{t}, ⅇ-12 t/7 1 +3 ⅇ12 t/7 

p2 = PlotEvaluate[C[t] /. %, {t, 0, 10}]

3.12

3.10

3.08

3.06

3.04

3.02

3.00
2 4 6 8 10
26 Km Swayla.nb

Show [p1, p2]

3.08

3.06

3.04

3.02

3.00

2.98

2.96

2 4 6 8 10

f = 48;
v = 28;
cin= 3;
f
DSolveC '[t] ⩵ *cin-C[t], C[0] ⩵ a, C, t // Quiet
v
C → Function{t}, ⅇ-12 t/7 -3 +a +3 ⅇ12 t/7 

p1 =
PlotEvaluate[C[t] /. % /. {{a → 12}, {a → 10}, {a → 8}, {a → 6}, {a → 2}, {a → 1}, {a → 3}}],
{t, 0, 8}, PlotRange → All

12

10

0 2 4 6 8

f = 48;
v = 28;
cin= 3
f
DSolveC '[t] ⩵ *cin-C[t], C[0] ⩵ 4, C, t // Quiet
v
3

C → Function{t}, ⅇ-12 t/7 1 +3 ⅇ12 t/7 


Km Swayla.nb 27

p2 = PlotEvaluate[C[t] /. %, {t, 0, 10}]

3.12

3.10

3.08

3.06

3.04

3.02

3.00
2 4 6 8 10

Show[p1, p2]

12

10

0 2 4 6 8 10

f = 48;
v = 28;
cin= 3;
DSolveC '[t] ⩵ f v*cin-C[t], C[0] ⩵ a, C, t // Quiet
C → Function{t}, ⅇ-12 t/7 -3 +a +3 ⅇ12 t/7 
28 Km Swayla.nb

p1 = PlotEvaluate[
C[t] /. % /. {{a → 12}, {a → 10}, {a → 8}, {a → 6}, {a → 4}, {a → 2}, {a → 1}, {a → 3}}],
{t, 0, 8}, PlotRange → All

12

10

0 2 4 6 8

DSolveC '[t] ⩵ f v*cin-C[t], C[0] ⩵ 4, C, t // Quiet


C → Function{t}, ⅇ-12 t/7 1 +3 ⅇ12 t/7 

p2 = PlotC[t] /. %, {t, 0, 6}, PlotRange → All, PlotStyle → Red

4.0

3.8

3.6

3.4

3.2

3.0
1 2 3 4 5 6

Show[p1, p2]

12

10

0 2 4 6 8
Km Swayla.nb 29

⇒ 27 /03 /2019

s1 = NDSolveC '[t] ⩵ 10 ^ 6 *1 +6 *Sin2 *Pi*t(28 *10 ^ 6)*


10 ^ 6 *10 +10 *Cos2 *Pi*t-C[t], C[0] ⩵ 10 ^ 6, C, {t, 0, 8}
p1 = PlotEvaluate[C[t] /. s1], {t, 0, 8}, PlotRange → All, PlotStyle → Blue

Domain: {{0., 8.}}


C → InterpolatingFunction 
Output: scalar

3.5 × 106

3.0 × 106

2.5 × 106

2.0 × 106

1.5 × 106

2 4 6 8

s2 = NDSolveC '[t] ⩵ 10 ^ 6 *1 +6 *Sin2 *Pi*t(28 *10 ^ 6)*


10 ^ 6 *10 +10 *Cos2 *Pi*t-C[t], C[0] ⩵ 2 *10 ^ 6, C, {t, 0, 8}
p2 = PlotEvaluate[C[t] /. s2], {t, 0, 8}, PlotRange → All, PlotStyle → Red

Domain: {{0., 8.}}


C → InterpolatingFunction 
Output: scalar

4.0 × 106

3.5 × 106

3.0 × 106

2.5 × 106

2 4 6 8
30 Km Swayla.nb

Show[p1, p2]

4.0 × 106

3.5 × 106

3.0 × 106

2.5 × 106

2.0 × 106

1.5 × 106

2 4 6 8

s3 = NDSolveC '[t] ⩵ 10 ^ 6 *1 +6 *Sin2 *Pi*t(28 *10 ^ 6)*


10 ^ 6 *10 +10 *Cos2 *Pi*t-C[t], C[0] ⩵ a, C, {t, 0, 8}
PlotEvaluate[C[t] /. s3 /. {{a → 10 ^ 6}, {a → 2 *10 ^ 6}, {a → 3 *10 ^ 6}}], {t, 0, 8}
NDSolve
1
C′ [t] ⩵ (-C[t]+1000000 (10 +10 Cos[2 π t])) 1 +6 Sin[2 π t], C[0] ⩵ a, C, {t, 0, 8}
28

5 × 106

4 × 106

3 × 106

2 × 106

2 4 6 8

01 /04 /2019

⇒ Equation Logistic
Km Swayla.nb 31

r = 1; k = 1000
s = DSolvey '[x] ⩵ r y[x] 1 -y[x]k, y[0] ⩵ y0, y[x], x;
PlotEvaluate[y[x] /. s /. y0 → Range[200, 1200, 100]], {x, 0, 8}, PlotRange → Full
1000

Solve::ifun : Inverse functions are being used by Solve, so some


solutions may not be found; use Reduce for complete solution information . 

1200

1000

800

600

400

200
2 4 6 8

r = 5; k = 1500
y[x]
s = DSolvey '[x] ⩵ r y[x] 1 - , y[0] ⩵ y0, y[x], x;
k
PlotEvaluate[y[x] /. s /. y0 → Range[200, 1200, 100]], {x, 0, 8}, PlotRange → Full
1500

1400

1200

1000

800

600

400

200
2 4 6 8
32 Km Swayla.nb

r = 5; k = 750
y[x]
s = DSolvey '[x] ⩵ r y[x] 1 - , y[0] ⩵ y0, y[x], x;
k
PlotEvaluate[y[x] /. s /. y0 → Range[200, 1200, 100]], {x, 0, 8}, PlotRange → Full
750

1200

1000

800

600

400

200
2 4 6 8

⇒ DRUG ASSIMULATION SINGLE COLD PILL

k1 = 1.3860;
k2 = 0.1386;
sol = NDSolvex '[t] ⩵ -k1 *x[t], y '[t] ⩵ k1 *x[t]-k2 *y[t], x[0] ⩵ 1, y[0] ⩵ 0,
{x[t], y[t]}, {t, 0, 15}
sol1 = PlotEvaluate{x[t], y[t]} /. sol, {t, 0, 15}, PlotStyle → Automatic 

Domain: {{0., 15.}}


x[t] → InterpolatingFunction [t],
Output: scalar

Domain: {{0., 15.}}


y[t] → InterpolatingFunction [t]
Output: scalar

1.0

0.8

0.6

0.4

0.2

2 4 6 8 10 12 14

⇒ 02 /04 /2019
Drug Assimulation Model -Course Cold Pill
Km Swayla.nb 33

k1 = 1.3860;
k2 = 0.1386;
sol = NDSolvex '[t] ⩵ 1 -k1 x[t], y '[t] ⩵ k1 x[t]-k2 y[t], x[0] ⩵ 0, y[0] ⩵ 0,
{x[t], y[t]}, {t, 0, 15}
PlotEvaluate{x[t], y[t]} /. sol, {t, 0, 15}, PlotRange → {0, 2}, PlotStyle → Automatic 

Domain: {{0., 15.}}


x[t] → InterpolatingFunction [t],
Output: scalar

Domain: {{0., 15.}}


y[t] → InterpolatingFunction [t]
Output: scalar

2.0

1.5

1.0

0.5

0 2 4 6 8 10 12 14
34 Km Swayla.nb

k1 = 1.5067;
k2 = 2.1386;
sol = NDSolvex '[t] ⩵ 1 -k1 x[t], y '[t] ⩵ k1 x[t]-k2 y[t], x[0] ⩵ 0, y[0] ⩵ 0,
{x[t], y[t]}, {t, 0, 25}
PlotEvaluate{x[t], y[t]} /. sol, {t, 0, 25}, PlotRange → {0, 2}, PlotStyle → Blue

Domain: {{0., 25.}}


x[t] → InterpolatingFunction [t],
Output: scalar

Domain: {{0., 25.}}


y[t] → InterpolatingFunction [t]
Output: scalar

2.0

1.5

1.0

0.5

0 5 10 15 20 25
Km Swayla.nb 35

k1 = 1.3860;
k2 = 0.1386;
sol = NDSolvex '[t] ⩵ 2 -k1 x[t], y '[t] ⩵ k1 x[t]-k2 y[t], x[0] ⩵ 0, y[0] ⩵ 0,
{x[t], y[t]}, {t, 0, 25}
PlotEvaluate{x[t], y[t]} /. sol, {t, 0, 25}, PlotRange → {0, 2}, PlotStyle → Automatic 

Domain: {{0., 25.}}


x[t] → InterpolatingFunction [t],
Output: scalar

Domain: {{0., 25.}}


y[t] → InterpolatingFunction [t]
Output: scalar

2.0

1.5

1.0

0.5

0 5 10 15 20 25

⇒ PREDATOR -PREY MODEL

β1 = 1;
c1 = 0.01;
c2 = .005;
α2 = .5;
x0 = 200;
y0 = 80;
sol = NDSolve[{x '[t] ⩵ β1 x[t]-c1 x[t] y[t],
y '[t] ⩵ c2 x[t] y[t]-α2 y[t], x[0] ⩵ x0, y[0] ⩵ y0}, {x[t], y[t]}, {t, 0, 25}];
PlotEvaluate{x[t], y[t]} /. sol, {t, 0, 25}, PlotStyle → Blue, Green

200

150

100

50

5 10 15 20 25
36 Km Swayla.nb

β1 = 1;
c1 = 0.01;
c2 = .005;
α2 = .5;
x0 = 250;
y0 = 100;
sol = NDSolve[{x '[t] ⩵ β1 x[t]-c1 x[t] y[t],
y '[t] ⩵ c2 x[t] y[t]-α2 y[t], x[0] ⩵ x0, y[0] ⩵ y0}, {x[t], y[t]}, {t, 0, 25}];
PlotEvaluate{x[t], y[t]} /. sol, {t, 0, 25}, PlotStyle → Blue, Green

250

200

150

100

50

5 10 15 20 25

03 /04 /2019

EpidemicModel of Influenza -
basicEpidemicModel
β = 2.18 *10 ^ -3;
γ = 0.44;
s0 = 762;
I0 = 1;
sol = NDSolve[{s '[t] ⩵ -β s[t] A[t], A '[t] ⩵ β s[t] A[t]-γ A[t], R '[t] ⩵ γ A[t],
s[0] ⩵ s0, A[0] ⩵ I0, R[0] ⩵ 0}, {s[t], A[t], R[t]}, {t, 0, 25}];
PlotEvaluate{s[t], A[t], R[t]} /. sol, {t, 0, 25}, PlotStyle → Red, Blue, Green
800

600

400

200

5 10 15 20 25
Km Swayla.nb 37

β = 2.18 *10 ^ -3;


γ = 0.44;
s0 = 800;
I0 = 30;
sol = NDSolve[{s '[t] ⩵ -β s[t] A[t], A '[t] ⩵ β s[t] A[t]-γ A[t], R '[t] ⩵ γ A[t],
s[0] ⩵ s0, A[0] ⩵ I0, R[0] ⩵ 0}, {s[t], A[t], R[t]}, {t, 0, 25}];
PlotEvaluate{s[t], A[t], R[t]} /. sol, {t, 0, 25}, PlotStyle → Red, Blue, Green

800

600

400

200

5 10 15 20 25

Battle Model
a1 = 0.0544;
a2 = 0.0106;
R0 = 66;
B0 = 18;
sol = NDSolve[
{R '[t] ⩵ -a1 B[t], B '[t] ⩵ -a2 R[t], R[0] ⩵ R0, B[0] ⩵ B0}, {R[t], B[t]}, {t, 0, 25}];
PlotEvaluate{R[t], B[t]} /. sol, {t, 0, 50}, PlotRange → {0, 100},
PlotStyle → Red, Blue
100

80

60

40

20

0 10 20 30 40 50
38 Km Swayla.nb

a1 = 0.0544;
a2 = 0.0106;
R0 = 66;
B0 = 18;
sol = NDSolve[{R '[t] ⩵ -a1 B[t], B '[t] ⩵ -a2 R[t] B[t], R[0] ⩵ R0, B[0] ⩵ B0},
{R[t], B[t]}, {t, 0, 25}];
PlotEvaluate{R[t], B[t]} /. sol, {t, 0, 30}, PlotStyle → Red, Blue

60

50

40

30

20

10

5 10 15 20 25 30

a1 = 0.0544;
a2 = 0.0106;
R0 = 66;
B0 = 18;
sol = NDSolve[{R '[t] ⩵ -a1 R[t] B[t], B '[t] ⩵ -a2 B[t] R[t], R[0] ⩵ R0, B[0] ⩵ B0},
{R[t], B[t]}, {t, 0, 25}];
PlotEvaluate{R[t], B[t]} /. sol, {t, 0, 30}, PlotRange → {0, 50},
PlotStyle → Red, Blue
50

40

30

20

10

0 5 10 15 20 25 30
Km Swayla.nb 39

You might also like