Another Graphic Solution of Differential Equation of the Second Order

deq3[x1_,y1_,yd1_,f_,h_,n_]:=Module[{w=Table[0,{i,1,7},{j,1,n}]},w[[1,1]]=x1;w[[2,1]]=y1;w[[3,1]]=yd1;Do[w[[4,i]]=f[w[[1,i]],w[[2,i]],w[[3,i]]];w[[5,i]]=Sqrt[1+w[[3,i]]^2]^3/Abs[w[[4,i]]];w[[6,i]]=w[[1,i]]-w[[3,i]](1+w[[3,i]]^2)/w[[4,i]];w[[7,i]]=w[[2,i]]+(1+w[[3,i]]^2)/w[[4,i]];{w[[1,i+1]],w[[2,i+1]]}={w[[1,i]],w[[2,i]]}+RotationMatrix[h].({w[[1,i]],w[[2,i]]}-{w[[6,i]],w[[7,i]]})-({w[[1,i]],w[[2,i]]}-{w[[6,i]],w[[7,i]]});w[[3,i+1]]=(w[[3,i]]+Tan[h])/(1-w[[3,i]]Tan[h]),{i,1,n-1}];w];
f1[x_,y_,yd_]:=-13-5x-y;
f2[x_,y_,yd_]:=-13+5x+y;
f3[x_,y_,yd_]:=-13+2(5x+y);
f4[x_,y_,yd_]:=-13+2(5x+y)+yd;

Manipulate[With[{w=deq3[x1,y1,yd1,f,h,n]},With[{gr=Grid[{Join[{" "},Range[n]],Join[{Style["x",Italic]},w[[1,All]]],Join[{Style["y",Italic]},w[[2,All]]],Join[{Style["y'",Italic]},w[[3,All]]],Join[{Style["y''",Italic]},w[[4,All]]],Join[{Style["R"]},w[[5,All]]],Join[{Style["(Subscript[T, x])"]},w[[7,All]]],Join[{Style["(Subscript[T, y])"]},w[[7,All]]]},Frame->All]},If[shg,Graphics[{Table[Line[{{w[[6,i]],w[[7,i]]},{w[[1,i]],w[[2,i]]}}],{i,1,n-1}],{Red,Line[Table[{w[[6,i]],w[[7,i]]},{i,1,n-1}]]},{Blue,Line[Table[{w[[1,i]],w[[2,i]]},{i,1,n}]]},Point[Table[{w[[1,i]],w[[2,i]]},{i,1,n}]],Point[Table[{w[[6,i]],w[[7,i]]},{i,1,n-1}]],Table[Text[Style[(Subscript[P, i]),10],{w[[1,i]],w[[2,i]]},2{0,-1}],{i,1,n}],Table[Text[Style[(Subscript[T, i]),10],{w[[6,i]],w[[7,i]]},2{0,-1}],{i,1,n-1}]},AspectRatio->Automatic,ImageSize->{400,400},PlotRange->{{-0.1,.5},{0.2,0.7}}],Column[{" ",TraditionalForm[y''==f[x,y,y']],"",gr}]]]],{{f,f1,Style["f",Italic]},{f1,f2,f3,f4},ControlPlacement->Left},"initial values",{{x1,0.0,Style["x",Italic]},0,0.1,0.01,Appearance->"Labeled",ControlPlacement->Left, ImageSize-> Tiny},{{y1,.5,Style["y",Italic]},.5,.6,0.01,Appearance->"Labeled",ControlPlacement->Left, ImageSize-> Tiny},{{yd1,1.4,Style["y'",Italic]},1.4,1.5,0.01,Appearance->"Labeled",ControlPlacement->Left, ImageSize-> Tiny},"step",{{h,-0.09,Style["h",Italic]},-0.05,-0.5,0.001,Appearance->"Labeled",ControlPlacement->Left, ImageSize-> Tiny},"number of steps",{{n,2,Style["n",Italic]},2,7,1,Appearance->"Labeled",ControlPlacement->Left, ImageSize-> Tiny},"graphics/calculations",{{shg,True,""},{False,True},ControlPlacement->Left},ControlPlacement->Left,ContentSize->{430,430},SaveDefinitions->True]

In this Demonstration another method of graphics integration of differential equations of the second order is presented. Let y''=f(x,y,y') be given differential equation, s arc length of an integral curve, and α the angle between tangent and x axis. Therefore y'=tan(α), dx/ds=cos(α). Differentiation of the first equation gives y''=1/(cos^2)(x)dα/dx=1/(cos^2)(x)dα/ds ·ds/dx =1/(cos^3)(x)dα/ds .

But dα/ds=1/R  is curvature and R is the radius of curvature. So we can write the differential equation as: 1/R=f(x,y,tan(α)) (cos^3)(α) , and the equation gives us the radius of curvature if a point on the curve and the tangent at the point is given. From this the following approximate construction is possible: At initial point (Subscript[P, 1])((Subscript[x, 1]),(Subscript[y, 1])) construct tangent of slope (Subscript[y', 1])and on the perpendicular line to it take a point (Subscript[T, 1]) which is distant R from (Subscript[P, 1]). Construct an arc of angle h with center at (Subscript[T, 1])and initial point (Subscript[P, 1]). The end point of the arc is (Subscript[P, 2]), that is the approximate second point on the curve... Note that points (Subscript[T, i]) determine approximately the evolute of the curve.

V. I. Smirnov, Lectures in Higher Mathematics ( in Russian), Vol. II, Nauka, Moscow 1967, pp. 48-50.

Contributed by: Izidor Hafner