SetDirectory[$HomeDirectory<>"/Documents/handouts/math467/First-OrderLinear"]

Characteristics

ContourPlot[x-t,{x,-1,1},{t,-0.05,1},ContourStyle->Thick,ContourShading->None,Frame->False,Axes->Automatic,AxesLabel->{"x","y"},Contours->Range[-2,3/2,1/2],RegionFunction->Function[{x,t},t≥0],Ticks->{Table[{(i-3)/2,-(Subscript[k, i])/c},{i,1,4}],None},AspectRatio->1/2,
Epilog->Table[Text[(Subscript["y-c x=k", x-1]),{(x-1)/2.75-3/4,(1-x)/8+3/4},Background->White],{x,1,5,1}],BaseStyle->FontSize->14]

Export["charlines.pdf",%,"PDF"]

Export["charlines.eps",%%,"EPS"]

Plane Curves

Show[ContourPlot[y-Sin[x],{x,-π,π},{y,-π/2,π/2},ContourShading->None,ContourStyle->Thick],StreamPlot[{1,Cos[x]}/Sqrt[1+((Cos[x])^2)],{x,-π,π},{y,-π/2,π/2}],FrameLabel->{"x","y"},AspectRatio->1/2]

Export["planecurves.pdf",%,"PDF"]

Export["planecurves.eps",%%,"EPS"]

Characteristic Curves

f[x_]:=x

u[x_,y_]:=f[y-Sin[x]]Exp[-x]+((1-x)Cos[x]+x Sin[x])/2+(y-Sin[x])(x-1)

Plot3D[{-2π,u[x,y]},{x,-π,π},{y,-π/2,π/2},AxesLabel->{"x","y","u(x,y)"},PlotRange->{-2π,2π},BoxRatios->{1,1/2,1/2},ClippingStyle->None,MeshFunctions->{(#2-Sin[#1])&},MeshStyle->Thick,PlotStyle->Directive[Opacity[1/2]]]

Export["charcurves.pdf",%,"PDF"]

Export["charcurves.eps",%%,"EPS"]

Example 01

u[x_,y_]:=-Exp[4y/3]Sin[2y/3-x]

2D[u[x,y],x]+3D[u[x,y],y]-4u[x,y]//Simplify

Plot3D[u[x,y],{x,-π,π},{y,0,1},AxesLabel->{"x","y","u(x,y)"},MeshFunctions->{(2#2-3#1)&},MeshStyle->Thick,PlotStyle->Directive[Opacity[1/2]],Ticks->{Table[π i,{i,-1,1,1/2}],Automatic,Automatic}]

Plot3D[{-1.2π,u[x,y]},{x,-π,π},{y,0,1},AxesLabel->{"x","y","u(x,y)"},MeshFunctions->{(2#2-3#1)&},MeshStyle->Thick,PlotStyle->{Directive[Opacity[1/2]]},Ticks->{Table[π i,{i,-1,1,1/2}],Automatic,Automatic}]

Export["example01.pdf",%,"PDF"]

Export["example01.eps",%%,"EPS"]

Example 02

u[x_,y_]:=x Exp[y-(y^2)]

2 x y D[u[x,y],x]+D[u[x,y],y]-u[x,y]//Simplify

Plot3D[{0,u[x,y]},{x,0,5},{y,0,3},AxesLabel->{"x","y","u(x,y)"},MeshFunctions->{(((#2)^2)-Log[#1])&},MeshStyle->Thick,PlotStyle->{Directive[Opacity[1/2]]},PlotRange->{0,6.4}]

Export["example02.pdf",%,"PDF"]

Export["example02.eps",%%,"EPS"]

Constructing Characteristics

ParametricPlot3D[{x,Sin[x],0},{x,-π,π},AxesLabel->{"x","y","u"}]

Table[{s Cos[t]+Sin[s]Sin[t],Sin[s]Cos[t]-s Sin[t],-Log[1-t]},{s,-π,π,π/4}]

Show[ParametricPlot3D[{x,Sin[x],0},{x,-π,π},PlotStyle->Thick],ParametricPlot3D[Evaluate[Table[{s Cos[t]+Sin[s]Sin[t],Sin[s]Cos[t]-s Sin[t],-Log[1-t]},{s,-π,π,π/16}]],{t,-1,1/2},PlotStyle->Gray],AxesLabel->{"x","y","u"},Ticks->None]

Export["family.pdf",%,"PDF"]

Export["family.eps",%%,"EPS"]

Show[ParametricPlot3D[{x,Sin[x],0},{x,-π,π},PlotStyle->Thick],ParametricPlot3D[{s Cos[t]+Sin[s]Sin[t],Sin[s]Cos[t]-s Sin[t],-Log[1-t]},{s,-π,π},{t,-1,1/2},Mesh->None],ParametricPlot3D[Evaluate[Table[{s Cos[t]+Sin[s]Sin[t],Sin[s]Cos[t]-s Sin[t],-Log[1-t]},{s,-π,π,π/16}]],{t,-1,1/2},PlotStyle->Gray],AxesLabel->{"x","y","u"},Ticks->None]

Export["integralsurface.pdf",%,"PDF"]

Export["integralsurface.eps",%%,"EPS"]

ContourPlot3D[Sin[x Cos[1-Exp[-u]]-y Sin[1-Exp[-u]]]==y Cos[1-Exp[-u]]+x Sin[1-Exp[-u]],{x,-3,3},{y,-3,3},{u,0,3},Mesh->None,AxesLabel->{"x","y","u(x,y)"}]

Export["implicit.pdf",%,"PDF"]

Export["implicit.eps",%%,"EPS"]

Example 03

Show[ParametricPlot3D[{(s^2),Sin[s],0},{s,-π,π},PlotStyle->Directive[Black,Thick]],ParametricPlot3D[Table[{(s^2)Exp[t],Exp[t]Sin[s],ArcSin[t]},{s,-π,π,π/16}],{t,-1,1}],AxesLabel->{"x","y","u"}]

Show[ParametricPlot3D[{(s^2),Sin[s],0},{s,-2π,2π},PlotStyle->Directive[Black,Thick]],ParametricPlot3D[Table[{(s^2)Exp[t],Exp[t]Sin[s],ArcSin[t]},{s,-2π,2π,π/16}],{t,-1,1}],AxesLabel->{"x","y","u"},BoxRatios->1,PlotRange->{Automatic,Automatic,{-π,π}/2}]

Export["example03chars.pdf",%,"PDF"]

Export["example03chars.eps",%%,"EPS"]

Show[ParametricPlot3D[{(s^2)Exp[t],Exp[t]Sin[s],ArcSin[t]},{s,-2π,2π},{t,-1,1},PlotStyle->Opacity[1/2],Mesh->None],ParametricPlot3D[Table[{(s^2)Exp[t],Exp[t]Sin[s],ArcSin[t]},{s,-2π,2π,π/16}],{t,-1,1}],AxesLabel->{"x","y","u"},BoxRatios->1]

Export["example03surf.pdf",%,"PDF"]

Export["example03surf.eps",%%,"EPS"]

Example 04

Integrate[x Exp[x]Sin[x]+k x Exp[x],x]

Simplify[%]

Example 05

u[x_,y_]:=(x^2)+(((4(x^2)+(y^2)))^2)/16-(4(x^2)+(y^2))/4

y D[u[x,y],x]-4x D[u[x,y],y]-2x y//Simplify

u[x,0]

Show[Plot3D[{-0.5,u[x,y]},{x,-2,2},{y,-2,2},MeshFunctions->{(4((#1)^2)+((#2)^2))&},MeshStyle->Thick,PlotStyle->{Directive[Opacity[1/2]]},PlotRange->{-0.5,21}],ParametricPlot3D[{x,0,(x^4)},{x,-2,2}],AxesLabel->{"x","y","u(x,y)"}]

Export["example05.pdf",%,"PDF"]

Export["example05.eps",%%,"EPS"]

Example 06

Solve[{y==(x^3),4 (x^2)+(y^2)==k,-4x/y==3(x^2)},{x,y,k}]//Simplify

N[%]