SciComp@UNC Courseware: MATH564

Interactive demo: Capturing signal shape through exponential variables

Initialization code

(* Sodium channel (m) *)
f[z_,α_,β_]=α (1-z) - β z;
m[t_,α_,β_]= z[t] /. DSolve[{z'[t]== f[z[t],α,β],z[0]==0},z[t],t][[1,1]]

m[t,α,β]

TwoAxisPlot[{f_,g_},{x_,x1_,x2_}]:=Module[{fgraph,ggraph,frange,grange,fticks,gticks},{fgraph,ggraph}=MapIndexed[Plot[#,{x,x1,x2},Axes->True,PlotRange->All,Frame->True,GridLines->Automatic,PlotStyle->ColorData[6][#2[[1]]]]&,{f,g}];{frange,grange}=(PlotRange/.AbsoluteOptions[#,PlotRange])[[2]]&/@{fgraph,ggraph};fticks=N@FindDivisions[frange,5];
gticks=Quiet@Transpose@{fticks,ToString[NumberForm[#,2],StandardForm]&/@Rescale[fticks,frange,grange]};
Show[fgraph,ggraph/.Graphics[graph_,s___]:>Graphics[GeometricTransformation[graph,RescalingTransform[{{0,1},grange},{{0,1},frange}]],s],FrameLabel->{"t","m[t],m'[t]"},Axes->False,Frame->True,PlotRange->All,PlotLabel->"Exponential variable and derivative",FrameStyle->{ColorData[6]/@{1,2},{Automatic,Automatic}},FrameTicks->{{fticks,gticks},{Automatic,Automatic}}]]

Time evolution of

(* Manipulate is set up for Plot. Modify as needed *)
tf=5.;
Manipulate[ 
TwoAxisPlot[{m[t,α,β],f[m[t,α,β],α,β]}  ,
{t,0,tf}],
{{α,5},0,10},
{{β,1},0,2},
SaveDefinitions->True]