{NotebookFileName[],DateString[]}

Figure 2.1.1

style[
t_
]:=
Style[t,Bold,FontSize->14,FontFamily->"Arial"]

cmarker[
size_:10,
pos_:{0,0}
]:=Graphics[Circle[pos],ImageSize->size];
cmarker[]

Image[cmarker[]]

dmarker[
size_:10,
pos_:{0,0}
]:=Graphics[Disk[pos],ImageSize->size];
dmarker[]

Clear[sinarrows1];
sinarrows1[
nmin_:-2,
nmax_:2,
size_:20
]:=
{
Table[
If[EvenQ[n],
Arrow[{{n π,0},{(n+1)π,0}}],
Arrow[{{(n+1)π,0},{n π,0}}]
],
{n,nmin,nmax-1}
],
Table[
If[EvenQ[n],
Inset[Graphics[cmarker[]],{n π,0},{0,0},Offset[size/2],Background->White],
Inset[Graphics[dmarker[]],{n π,0},{0,0},Offset[size/2],Background->White]
],
{n,nmin,nmax}
]
};
Graphics[{
Arrowheads[Large],
sinarrows1[]
}]

sinplot1=Block[{is=400,ar=0.4,ymin=-3π,ymax=3π,nmin,nmax},
nmin=Floor[ymin/π];
nmax=Floor[ymax/π];
Plot[Sin[y],{y,ymin,ymax}
,AspectRatio->ar
,Ticks->{Table[n π,{n,nmin,nmax}]}
,AxesLabel->{"y","y'(t)"}
,Epilog->{
Arrowheads[Large],
sinarrows1[nmin,nmax]
}
,ImageSize->is
]
]

DSolve[{y'[t]==Sin[y[t]]},y[t],t]//FullSimplify

DSolve[{y'[t]==Sin[y[t]],y[0]==y0},y[t],t]//FullSimplify

t=ln(|((csc((Subscript[y, 0]))+cot((Subscript[y, 0])))/(csc(y)+cot(y))))

sinsp1=StreamPlot[{1,Sin[y]},{t,0,10},{y,-3π,3π}
,Frame->{{False,True},{True,False}}
,FrameTicks->{Automatic,Table[n π,{n,-3,3}]}
,FrameLabel->style/@{"t",None,None,"y"}
,ImageSize->400
]

Exponential growth

r1=Log[100]/2//N

(10^4)Exp[7r1]

p1[
p_,
r_:1
]:=
r p

Block[{ar=0.4,s=1,kf=0.5,kr=2,as,amin=0,amax=1},
as=0;
Plot[p1[a],{a,amin,amax}
,Ticks->None
,AspectRatio->ar
,AxesLabel->style/@{"y","y'"}
,Epilog->{
Inset[cmarker[],{as,0}],
Arrow[{{as,0},{amax,0}}],
}
]
]

StreamPlot[{1,p1[y]},{t,0,10},{y,0,1}
,Frame->{{True,False},{True,False}}
,FrameTicks->{Automatic,Table[n π,{n,-3,3}]}
,FrameLabel->style/@{"t","y"}
,ImageSize->400
]

Exponential decay

d1[
p_,
r_:1
]:=
-r p

Block[{ar=0.4,s=1,kf=0.5,kr=2,as,amin=0,amax=1},
as=0;
Plot[d1[a],{a,amin,amax}
,Ticks->None
,AspectRatio->ar
,AxesLabel->style/@{"y","y'"}
,Epilog->{
Inset[dmarker[],{as,0}],
Arrow[{{amax,0},{as,0}}],
}
]
]

StreamPlot[{1,d1[y]},{t,0,10},{y,0,1}
,Frame->{{True,False},{True,False}}
,FrameTicks->{Automatic,Table[n π,{n,-3,3}]}
,FrameLabel->style/@{"t","y"}
,ImageSize->400
]

IsotopeData["Phosphorus32","HalfLife"]

UnitConvert[IsotopeData["Phosphorus32","HalfLife"],"Days"]

(10^4)(2^(-Quantity[14,"Days"]/UnitConvert[IsotopeData["Phosphorus32","HalfLife"],"Days"]))

λ1=-Log[(5064/10000)]/14//N

τ1=(1/(λ1))

τ1 Log[2]

Solve[100==(10^4)Exp[-λ1 t],t]

UnitConvert[Quantity[1,"Millicuries"]]

IsotopeData["Carbon14","HalfLife"]

UnitConvert[IsotopeData["Carbon14","HalfLife"],"Years"]

τ2=IsotopeData["Carbon14","HalfLife"]/Log[2]

QuantityMagnitude[τ2]

y01=UnitConvert[Quantity[1,"Millicuries"]]*τ2

UnitConvert@Quantity[1,"AvogadroNumber"]

Quantity[(y01/(UnitConvert[Quantity[1,"AvogadroNumber"]])),"Moles"]

UnitConvert[Quantity[(y01/(UnitConvert[Quantity[1,"AvogadroNumber"]])),"Moles"],"Micromoles"]

UnitConvert[Quantity[(y01/(UnitConvert[Quantity[1,"AvogadroNumber"]])),"Moles"],"Micromoles"]*Quantity[182,(("Grams")/("Moles"))]

Chemical equilibrium

v1[
a_,
kf_:0.5,
kr_:2,
s_:1
]:=
kr s-(kf+kr)a

Block[{s=1,kf=0.5,kr=2,as,amin=0,amax=1},
as=(kr/(kf+kr))s;
Plot[v1[a],{a,amin,amax}
,Ticks->None
,Epilog->{
Inset[dmarker[],{as,0}],
Arrow[{{amin,0},{as,0}}],
Arrow[{{amax,0},{as,0}}],
}
]
]

Population growth

p1[
p_,
r_:1
]:=
r p

Block[{ar=0.4,s=1,kf=0.5,kr=2,as,amin=0,amax=1},
as=0;
Plot[p1[a],{a,amin,amax}
,Ticks->None
,AspectRatio->ar
,AxesLabel->style/@{"N","N'"}
,Epilog->{
Inset[cmarker[],{as,0}],
Arrow[{{as,0},{amax,0}}],
}
]
]

StreamPlot[{1,p1[y]},{t,0,10},{y,0,1}
,Frame->{{True,False},{True,False}}
,FrameTicks->{Automatic,Table[n π,{n,-3,3}]}
,FrameLabel->style/@{"t","N"}
,ImageSize->400
]

n2[
p_,
r_:1,
k_:10
]:=
r p(1-(p/k))

Block[{ar=0.4,s=1,k=10,as,amin=0,amax=12},
as=k;
Plot[n2[a],{a,amin,amax}
,Ticks->None
,AspectRatio->ar
,AxesLabel->style/@{"N","N'"}
,Epilog->{
Inset[cmarker[],{amin,0}],
Inset[dmarker[],{as,0}],
Text[style["K"],{as,0},{-1,-1}],
Arrow[{{amax,0},{as,0}}],
Arrow[{{amin,0},{as,0}}],
}
]
]

StreamPlot[{1,n2[y,1,10]},{t,0,10},{y,0,12}
,Frame->{{True,False},{True,False}}
,FrameLabel->style/@{"t","N"}
,FrameTicks->None
,ImageSize->400
]

n3[
p_,
r_:1,
k_:10,
c_:1
]:=
r p(1-(p/k))-c

Solve[n3[a,r,k,c]==0,a]

Block[{ar=0.4,s=1,k=10,a0,as,amin=0,amax=12},
{a0,as}=a/.Solve[n3[a]==0];
Plot[n3[a],{a,amin,amax}
,Ticks->None
,AspectRatio->ar
,AxesLabel->style/@{"N","N'"}
,Epilog->{
Inset[cmarker[],{a0,0}],
Inset[dmarker[],{as,0}],
Arrow[{{amax,0},{as,0}}],
Arrow[{{a0,0},{as,0}}],
Arrow[{{a0,0},{amin,0}}],
}
]
]

StreamPlot[{1,n3[y,1,10]},{t,0,10},{y,0,12}
,Frame->{{True,False},{True,False}}
,FrameLabel->style/@{"t","N"}
,FrameTicks->None
,ImageSize->400
]

n4[
p_,
r_:1,
k_:10,
c_:0.1
]:=
r p(1-(p/k))-c p

n4[p,r,k,c]

D[n4[p,r,k,c],p]/.p->0

Solve[n4[a,r,k,c]==0,a]

Block[{ar=0.4,s=1,k=10,a0,as,amin=0,amax=12},
{a0,as}=a/.Solve[n4[a]==0];
Plot[n4[a],{a,amin,amax}
,Ticks->None
,AspectRatio->ar
,AxesLabel->style/@{"N","N'"}
,Epilog->{
Inset[cmarker[],{a0,0}],
Inset[dmarker[],{as,0}],
Arrow[{{amax,0},{as,0}}],
Arrow[{{amin,0},{as,0}}],
}
]
]

Module[{ar=0.4,s=1,r=1,k=10,a0,as,amin=0,amax=12},
Manipulate[
If[c<r,
{a0,as}=a/.Solve[n4[a,r,k,c]==0];
Plot[n4[a,r,k,c],{a,amin,amax}
,Ticks->None
,AspectRatio->ar
,AxesLabel->style/@{"N","N'"}
,Epilog->{
Inset[cmarker[],{a0,0}],
Inset[dmarker[],{as,0}],
Arrow[{{amax,0},{as,0}}],
Arrow[{{amin,0},{as,0}}],
}
],
as=0;
Plot[n4[a,r,k,c],{a,amin,amax}
,Ticks->None
,AspectRatio->ar
,AxesLabel->style/@{"N","N'"}
,Epilog->{
Inset[dmarker[],{as,0}],
Arrow[{{amax,0},{as,0}}],
}
]
],
{{c,0.1,style["c/r"]},0,1.4,Appearance->"Labeled"}
]
]

Block[{ar=0.4,s=1,r=1,k=10,a0,as,amin=0,amax=12,cs={0.1,0.6,1.1}},
Plot[Evaluate[
Table[n4[a,r,k,c],{c,cs}]
],{a,amin,amax}
,PlotLegends->cs
,Ticks->None
,AspectRatio->ar
,AxesLabel->style/@{"N","N'"}
]
]

StreamPlot[{1,n4[y,1,10]},{t,0,10},{y,0,12}
,Frame->{{True,False},{True,False}}
,FrameLabel->style/@{"t","N"}
,FrameTicks->None
,ImageSize->400
]

n5[
p_,
r_:1,
k_:10,
m_:2
]:=
r p(1-(m/p))(1-(p/k))

n5[a,r,k,m]

Solve[n5[a,r,k,m]==0,a]

Block[{ar=0.4,s=1,k=10,a0,as,amin=0,amax=12},
{a0,as}=a/.Solve[n5[a]==0];
Plot[n5[a],{a,amin,amax}
,Ticks->None
,AspectRatio->ar
,AxesLabel->style/@{"N","N'"}
,Epilog->{
Inset[cmarker[],{a0,0}],
Inset[dmarker[],{as,0}],
Arrow[{{amax,0},{as,0}}],
Arrow[{{a0,0},{as,0}}],
Arrow[{{a0,0},{amin,0}}],
Text[style["M"],{a0,0},{-1,-1}],
Text[style["K"],{as,0},{-1,-1}]
}
]
]

StreamPlot[{1,n5[y,1,10]},{t,0,10},{y,0,12}
,Frame->{{True,False},{True,False}}
,FrameLabel->style/@{"t","N"}
,FrameTicks->None
,ImageSize->400
]