<?xml version="1.0" encoding="UTF-8"?>
<Worksheet><Version major="6" minor="1"/><View-Properties><Zoom percentage="100"/></View-Properties><Styles><Layout alignment="centred" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="Heading 2258" rightmargin="0.0" spaceabove="8.0" spacebelow="2.0"/><Layout alignment="left" bullet="dot" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="Bullet Item" rightmargin="0.0" spaceabove="3.0" spacebelow="3.0"/><Layout alignment="centred" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="Normal257" rightmargin="0.0" spaceabove="0.0" spacebelow="0.0"/><Layout alignment="left" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="Heading 1" rightmargin="0.0" spaceabove="8.0" spacebelow="4.0"/><Layout alignment="centred" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="Title" rightmargin="0.0" spaceabove="12.0" spacebelow="12.0"/><Layout alignment="left" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="Normal" rightmargin="0.0" spaceabove="0.0" spacebelow="0.0"/><Font background="[0,0,0]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" name="Heading 1" readonly="false" size="18" underline="false"/><Font background="[0,0,0]" bold="true" executable="true" family="Monospaced" foreground="[255,0,0]" name="Maple Input"/><Font background="[0,0,0]" family="Times New Roman" name="Page Number" underline="false"/><Font background="[0,0,0]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" name="Normal" readonly="false" size="12" underline="false"/><Font background="[0,0,0]" foreground="[0,128,128]" italic="false" name="Hyperlink" underline="true"/><Font background="[0,0,0]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" name="Heading 2258" readonly="false" size="14" underline="false"/><Font background="[0,0,0]" italic="true" name="_cstyle265"/><Font background="[0,0,0]" bold="true" name="_cstyle261"/><Font background="[0,0,0]" bold="true" foreground="[255,0,0]" name="_cstyle260"/><Font background="[0,0,0]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" name="Bullet Item" readonly="false" size="12" underline="false"/><Font background="[0,0,0]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" name="Normal257" readonly="false" size="12" underline="false"/><Font background="[0,0,0]" bold="true" name="_cstyle259"/><Font background="[0,0,0]" bold="true" foreground="[255,0,0]" name="_cstyle258"/><Font background="[0,0,0]" bold="true" foreground="[255,0,0]" name="_cstyle257"/><Font background="[0,0,0]" family="Times New Roman" name="2D Comment" underline="false"/><Font background="[0,0,0]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" name="Title" readonly="false" size="18" underline="true"/></Styles><Page-Numbers enabled="false" first-number="1" first-numbered-page="1" horizontal-location="right" style="Page Number" vertical-location="bottom"/><Group><Input><Text-field layout="Title" style="Title">Partial Differential Equations</Text-field><Text-field layout="Heading 2258" style="Heading 2258">First-Order PDE: The method of characteristics.</Text-field><Text-field layout="Normal" style="Normal"/><Text-field layout="Normal257" style="Hyperlink"><Hyperlink bold="false" executable="false" family="Times New Roman" hyperlink="true" linktarget="http://www.math.lsa.umich.edu/~adzham/" size="12" style="Hyperlink">Anton Dzhamay</Hyperlink></Text-field><Text-field layout="Normal257" style="Hyperlink"><Hyperlink bold="false" executable="false" family="Times New Roman" hyperlink="true" linktarget="http://www.math.lsa.umich.edu/" size="12" style="Hyperlink">Department of Mathematics</Hyperlink></Text-field><Text-field layout="Normal257" style="Hyperlink"><Hyperlink bold="false" executable="false" family="Times New Roman" hyperlink="true" linktarget="http://www.umich.edu/" size="12" style="Hyperlink">The University of Michigan</Hyperlink></Text-field><Text-field layout="Normal257" style="Normal257">Ann Arbor, MI 48109</Text-field><Text-field layout="Normal" style="Normal"/><Text-field layout="Normal257" style="Normal257">wPage: <Hyperlink bold="false" executable="false" family="Times New Roman" hyperlink="true" linktarget="http://www.math.lsa.umich.edu/~adzham/" size="12" style="Hyperlink">http://www.math.lsa.umich.edu/~adzham</Hyperlink></Text-field><Text-field layout="Normal257" style="Normal257">email: <Hyperlink bold="false" executable="false" family="Times New Roman" hyperlink="true" linktarget="mailto:adzham@umich.edu" size="12" style="Hyperlink">adzham@umich.edu</Hyperlink></Text-field><Text-field layout="Normal" style="Normal"/><Text-field layout="Normal257" style="Normal257"><Font encoding="ISO8859-1">Copyright \251  2003  by Anton Dzhamay</Font></Text-field><Text-field layout="Normal257" style="Normal257">All rights reserved</Text-field><Text-field layout="Normal" style="Normal"/></Input></Group><Section collapsed="true"><Title><Text-field layout="Heading 1" style="Heading 1">Introduction</Text-field></Title><Text-field layout="Normal" style="Normal">In this worksheet we give some examples on how to use the method of characteristics for first-order linear PDEs of the form <Equation input-equation="a(x,t)*diff(u(x,t),t)+b(x,t)*diff(u(x,t),x) + c(x,t)*u(x,t)=h(x,t)&#10;" style="2D Comment">NiMvLCgqJi0lImFHNiQlInhHJSJ0RyIiIi0lJWRpZmZHNiQtJSJ1R0YoRipGK0YrKiYtJSJiR0YoRistRi02JEYvRilGK0YrKiYtJSJjR0YoRitGL0YrRistJSJoR0Yo</Equation>
. The main idea of the method of characteristics is to reduce a PDE on the (<Equation input-equation="x,t;" style="2D Comment">NiQlInhHJSJ0Rw==</Equation>)-plane to an ODE along a parametric curve (called the characteristic curve) parametrized by some other parameter <Equation input-equation="tau;" style="2D Comment">NiMlJHRhdUc=</Equation>. The characteristic curve is then determined by the condition that <Equation input-equation="diff(u(x(tau),y(tau)),tau)=diff(t(tau),tau)*diff(u(x,t),t)+diff(x(tau),tau)*diff(u(x,t),x)" style="2D Comment">NiMvLSUlZGlmZkc2JC0lInVHNiQtJSJ4RzYjJSR0YXVHLSUieUdGLEYtLCYqJi1GJTYkLSUidEdGLEYtIiIiLUYlNiQtRig2JEYrRjVGNUY2RjYqJi1GJTYkRipGLUY2LUYlNiRGOUYrRjZGNg==</Equation> =<Equation input-equation="a(x,t)*diff(u(x,t),t)+b(x,t)*diff(u(x,t),x)" style="2D Comment">NiMsJiomLSUiYUc2JCUieEclInRHIiIiLSUlZGlmZkc2JC0lInVHRidGKUYqRioqJi0lImJHRidGKi1GLDYkRi5GKEYqRio=</Equation> and so  we need to solve another ODE to find the characteristic. In the examples below we always take <Equation input-equation="a(x,t)=1" style="2D Comment">NiMvLSUiYUc2JCUieEclInRHIiIi</Equation>, and so we can use <Equation input-equation="t;" style="2D Comment">NiMlInRH</Equation> instead of <Equation input-equation="tau;" style="2D Comment">NiMlJHRhdUc=</Equation>. In this case the characteristics are given by the equation <Equation input-equation="diff(x,t)=b(x,t)" style="2D Comment">NiMvLSUlZGlmZkc2JCUieEclInRHLSUiYkdGJg==</Equation>. On the characteristic we then get an equation <Equation input-equation="diff(u(t),t)+c(t)*u(t)=h(t)" style="2D Comment">NiMvLCYtJSVkaWZmRzYkLSUidUc2IyUidEdGKyIiIiomLSUiY0dGKkYsRihGLEYsLSUiaEdGKg==</Equation>, which is again an ODE. Solving both ODEs, choosing the constants of integration to match the initial data, and going from the characteristic to the whole plane then gives us the solution <Equation input-equation="u(x,t)" style="2D Comment">NiMtJSJ1RzYkJSJ4RyUidEc=</Equation> of the PDE.</Text-field></Section><Section collapsed="true"><Title><Text-field layout="Heading 1" style="Heading 1">Initialization</Text-field></Title><Group><Input><Text-field layout="Normal" style="Normal">Some packages that we use in this worksheet:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">restart: with(plottools): with(plots):</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">In all of the examples below we use the same initial profile given by a localized "hump":</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">f_ini:=x-&gt;piecewise(x&lt;-1,0,x&lt;1,(cos(Pi/2*x))^2,0):</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">plot(f_ini(x),x=-2..2,scaling=constrained,thickness=2,title="Initial profile");</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">Note that this initial profile has a continuous first derivative:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">plot([f_ini(x),diff(f_ini(x),x)],x=-2..2,scaling=constrained,thickness=2,color=[red,blue],
title="Initial profile and its derivative");</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Text-field layout="Normal" style="Normal"/></Section><Section collapsed="true"><Title><Text-field layout="Heading 1" style="Heading 1">Example 1: <Equation input-equation="diff(u(x,t),t) = 0;" style="2D Comment">NiMvLSUlZGlmZkc2JC0lInVHNiQlInhHJSJ0R0YrIiIh</Equation>.</Text-field></Title><Group><Input><Text-field layout="Normal" style="Normal">Our first example is a trivial one. We consider the equation <Equation input-equation="diff(u(x,t),t)=0" style="2D Comment">NiMvLSUlZGlmZkc2JC0lInVHNiQlInhHJSJ0R0YrIiIh</Equation>. </Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">pde:=diff(u(x,t),t)=0;</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">The equation of the characteristics is then simply</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">char_eq:=diff(x(t),t)=0;</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">The characteristic curves are then given by the equation</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">char_curve:=dsolve({char_eq,x(0)=x[0]});</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">And so the characteristics are straight vertical lines (the <Font family="Times New Roman" italic="false" size="12" style="_cstyle260" underline="false">nch</Font><Font family="Times New Roman" foreground="[0,0,0]" italic="false" size="12" style="_cstyle261" underline="false"> </Font>variable below denotes the number of characteristics per unit interval on the <Equation input-equation="x;" style="2D Comment">NiMlInhH</Equation>-axis)</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">nch:=3:
char_plot:=display([seq(plot([subs(x[0]=x/nch,eval(x(t),char_curve)),t,t=0..4],
color=black,thickness=2),x=-4*nch..2*nch)],view=[-2..2,0..4]):
display(char_plot);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">On the characteristics we need to solve the following ordinary differential equation:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">ode:=diff(w(t),t)=0;</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">which coincides with our PDE upon the substitution <Equation input-equation="w(t) = u(x(t),t);" style="2D Comment">NiMvLSUid0c2IyUidEctJSJ1RzYkLSUieEdGJkYn</Equation> (restricted to a characteristic curve):</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">eval(subs(w(t)=u(eval(x(t),char_curve),t),ode));</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">This ODE is easy to solve:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">char_sol:=dsolve({ode,w(0)=f(x[0])});</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">our solution of the PDE then is <Equation input-equation="u(x,t) = w(t,x[0](x,t));" style="2D Comment">NiMvLSUidUc2JCUieEclInRHLSUid0c2JEYoLSZGJzYjIiIhRiY=</Equation>:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">u:=unapply(subs(x[0]=solve(subs(x(t)=x,char_curve),x[0]),eval(w(t),char_sol)),x,t):'u(x,t)'=u(x,t);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">This result is not surprising since the equation means that the initail profile does not change in time and therefore is simply shifted in the <Equation input-equation="t;" style="2D Comment">NiMlInRH</Equation>-direction. We color the plot according to the values, so same color represents same values of the function <Equation input-equation="u(x,t);" style="2D Comment">NiMtJSJ1RzYkJSJ4RyUidEc=</Equation>.</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">sol_plot:=plot3d(subs(f=f_ini,u(x,t)),x=-2..2,t=0..4,axes=boxed,scaling=constrained,numpoints=2000,
shading=zhue): display(sol_plot,style=patchnogrid,view=-0.1..1,orientation=[-65,55]);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">We now combine the plot of the characteristic curves with the graph of the solution. We make the resulting graph a "movie" with two frames, the first frame plots the solution using the <Font family="Times New Roman" italic="false" size="12" style="_cstyle257" underline="false">patchnogrid</Font> style, the second frame uses the <Font family="Times New Roman" italic="false" size="12" style="_cstyle258" underline="false">wireframe</Font><Font family="Times New Roman" foreground="[0,0,0]" italic="false" size="12" style="_cstyle259" underline="false"> </Font>style and so allows us to see the characteristics.  Below is the graph of the solution as viewed from above, to get a better understanding of the solution you should rotate it. </Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">shift:=transform((x,y)-&gt;[x,y,-0.1]):</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">movie:=display([display(sol_plot,style=patchnogrid),display(sol_plot,style=wireframe)],insequence=true):</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">display([movie,shift(char_plot)],orientation=[-90,0],view=[-2..2,0..4,-0.1..1],scaling=constrained);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">Clean-up:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">u:='u': f:='f': w:='w': </Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Text-field layout="Normal" style="Normal"/></Section><Section collapsed="true"><Title><Text-field layout="Heading 1" style="Heading 1">Example 2: <Equation input-equation="diff(u(x,t),t)+c*diff(u(x,t),x) = 0;" style="2D Comment">NiMvLCYtJSVkaWZmRzYkLSUidUc2JCUieEclInRHRiwiIiIqJiUiY0dGLS1GJjYkRihGK0YtRi0iIiE=</Equation>.</Text-field></Title><Group><Input><Text-field layout="Normal" style="Normal">Our second example is the <Font bold="false" family="Times New Roman" foreground="[0,0,0]" size="12" style="_cstyle265" underline="false">transport equation</Font>. We consider the equation <Equation input-equation="diff(u(x,t),t)+c*diff(u(x,t),x) = 0;" style="2D Comment">NiMvLCYtJSVkaWZmRzYkLSUidUc2JCUieEclInRHRiwiIiIqJiUiY0dGLS1GJjYkRihGK0YtRi0iIiE=</Equation>. </Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">pde:=diff(u(x,t),t)+c*diff(u(x,t),x)=0;</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">The equation of the characteristics is then simply</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">char_eq:=diff(x(t),t)=c;</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">The characteristic curves are then given by the equation</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">char_curve:=dsolve({char_eq,x(0)=x[0]});</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">And so the characteristics are straight lines with the slope of <Equation input-equation="1/c;" style="2D Comment">NiMqJiIiIkYkJSJjRyEiIg==</Equation> (we choose <Equation input-equation="c = .5;" style="2D Comment">NiMvJSJjRy0lJkZsb2F0RzYkIiImISIi</Equation> for the plot)</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">nch:=3:
char_plot:=display([seq(plot([subs({c=0.5,x[0]=x/nch},eval(x(t),char_curve)),t,t=0..4],
color=black,thickness=2),x=-4*nch..2*nch)],view=[-2..2,0..4]):
display(char_plot);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">On the characteristics we need to solve the following ordinary differential equation:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">ode:=diff(w(t),t)=0;</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">which coincides with our PDE upon the substitution <Equation input-equation="w(t) = u(x(t),t);" style="2D Comment">NiMvLSUid0c2IyUidEctJSJ1RzYkLSUieEdGJkYn</Equation> (restricted to a characteristic curve):</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">eval(subs(w(t)=u(eval(x(t),char_curve),t),ode));</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">This ODE is easy to solve:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">char_sol:=dsolve({ode,w(0)=f(x[0])});</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">our solution of the PDE then is <Equation input-equation="u(x,t) = w(t,x[0](x,t));" style="2D Comment">NiMvLSUidUc2JCUieEclInRHLSUid0c2JEYoLSZGJzYjIiIhRiY=</Equation>:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">u:=unapply(subs(x[0]=solve(subs(x(t)=x,char_curve),x[0]),eval(w(t),char_sol)),x,t):'u(x,t)'=u(x,t);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">sol_plot:=plot3d(subs({c=0.5,f=f_ini},u(x,t)),x=-2..2,t=0..4,axes=boxed,scaling=constrained,numpoints=2000,
shading=zhue): display(sol_plot,style=patchnogrid,view=-0.1..1,orientation=[-65,55]);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">shift:=transform((x,y)-&gt;[x,y,-0.1]):</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">movie:=display([display(sol_plot,style=patchnogrid),display(sol_plot,style=wireframe)],insequence=true):</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">display([movie,shift(char_plot)],orientation=[-90,0],view=[-2..2,0..4,-0.1..1],scaling=constrained);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">And this is how the initial profile evolves in time. This animation helps to see why our PDE is called the transport equation.</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">animate(plot,[subs({c=0.5,f=f_ini},u(x,t)),x=-2..2,color=red,thickness=2],t=0..6,scaling=constrained);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">Clean-up:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">u:='u': f:='f': w:='w': </Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Text-field layout="Normal" style="Normal"/></Section><Section collapsed="true"><Title><Text-field layout="Heading 1" style="Heading 1">Example 3: <Equation input-equation="diff(u(x,t),t)+x*diff(u(x,t),x) = 0;" style="2D Comment">NiMvLCYtJSVkaWZmRzYkLSUidUc2JCUieEclInRHRiwiIiIqJkYrRi0tRiY2JEYoRitGLUYtIiIh</Equation>.</Text-field></Title><Group><Input><Text-field layout="Normal" style="Normal">For the next example we consider the equation with non-constant coefficients, <Equation input-equation="diff(u(x,t),t)+x*diff(u(x,t),x) = 0;" style="2D Comment">NiMvLCYtJSVkaWZmRzYkLSUidUc2JCUieEclInRHRiwiIiIqJkYrRi0tRiY2JEYoRitGLUYtIiIh</Equation></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">pde:=diff(u(x,t),t)+x*diff(u(x,t),x)=0;</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">The equation of the characteristics is </Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">char_eq:=diff(x(t),t)=x(t);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">The characteristic curves are then given by the equation</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">char_curve:=dsolve({char_eq,x(0)=x[0]});</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">And so the characteristics are graphs of the exponential function</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">nch:=10:
char_plot:=display([seq(plot([subs({c=0.5,x[0]=x/nch},eval(x(t),char_curve)),t,t=0..4],
color=black,thickness=2),x=-4*nch..2*nch)],view=[-2..2,0..4]):
display(char_plot);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">On the characteristics we need to solve the following ordinary differential equation:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">ode:=diff(w(t),t)=0;</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">which coincides with our PDE upon the substitution <Equation input-equation="w(t) = u(x(t),t);" style="2D Comment">NiMvLSUid0c2IyUidEctJSJ1RzYkLSUieEdGJkYn</Equation> (restricted to a characteristic curve):</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">eval(subs(w(t)=u(eval(x(t),char_curve),t),ode));</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">The ODE is easy to solve:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">char_sol:=dsolve({ode,w(0)=f(x[0])});</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">our solution of the PDE then is <Equation input-equation="u(x,t) = w(t,x[0](x,t));" style="2D Comment">NiMvLSUidUc2JCUieEclInRHLSUid0c2JEYoLSZGJzYjIiIhRiY=</Equation>:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">u:=unapply(subs(x[0]=solve(subs(x(t)=x,char_curve),x[0]),eval(w(t),char_sol)),x,t):'u(x,t)'=u(x,t);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">sol_plot:=plot3d(subs({c=0.5,f=f_ini},u(x,t)),x=-2..2,t=0..4,axes=boxed,scaling=constrained,numpoints=2000,
shading=zhue): display(sol_plot,style=patchnogrid,view=-0.1..1,orientation=[-65,55]);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">shift:=transform((x,y)-&gt;[x,y,-0.1]):</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">movie:=display([display(sol_plot,style=patchnogrid),display(sol_plot,style=wireframe)],insequence=true):</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">display([movie,shift(char_plot)],orientation=[-90,0],view=[-2..2,0..4,-0.1..1],scaling=constrained);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">And this is how the initial profile evolves in time. </Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">animate(plot,[subs({c=0.5,f=f_ini},u(x,t)),x=-2..2,color=red,thickness=2],t=0..6,scaling=constrained);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">Clean-up:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">u:='u': f:='f': w:='w': </Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Text-field layout="Normal" style="Normal"/></Section><Section collapsed="true"><Title><Text-field layout="Heading 1" style="Heading 1">Example 4: <Equation input-equation="diff(u(x,t),t)-t^2*diff(u(x,t),x) = 1;" style="2D Comment">NiMvLCYtJSVkaWZmRzYkLSUidUc2JCUieEclInRHRiwiIiIqJilGLCIiI0YtLUYmNiRGKEYrRi0hIiJGLQ==</Equation>.</Text-field></Title><Group><Input><Text-field layout="Normal" style="Normal">This example is a non-homogeneous equationwith non-constant coefficients, <Equation input-equation="diff(u(x,t),t)-t^2*diff(u(x,t),x) = 1;" style="2D Comment">NiMvLCYtJSVkaWZmRzYkLSUidUc2JCUieEclInRHRiwiIiIqJilGLCIiI0YtLUYmNiRGKEYrRi0hIiJGLQ==</Equation></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">pde:=diff(u(x,t),t)-t^2*diff(u(x,t),x)=1;</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">The equation of the characteristics is </Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">char_eq:=diff(x(t),t)=-t^2;</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">The characteristic curves are then given by the equation</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">char_curve:=dsolve({char_eq,x(0)=x[0]});</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">And this is how the characteristic curves look like:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">nch:=5:
char_plot:=display([seq(plot([subs({c=0.5,x[0]=x/nch},eval(x(t),char_curve)),t,t=0..4],
color=black,thickness=2),x=-4*nch..8*nch)],view=[-2..2,0..4]):
display(char_plot);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">On the characteristics we need to solve the following ordinary differential equation:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">ode:=diff(w(t),t)=1;</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">which coincides with our PDE upon the substitution <Equation input-equation="w(t) = u(x(t),t);" style="2D Comment">NiMvLSUid0c2IyUidEctJSJ1RzYkLSUieEdGJkYn</Equation> (restricted to a characteristic curve):</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">eval(subs(w(t)=u(eval(x(t),char_curve),t),ode));</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">The ODE is easy to solve:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">char_sol:=dsolve({ode,w(0)=f(x[0])});</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">our solution of the PDE then is <Equation input-equation="u(x,t) = w(t,x[0](x,t));" style="2D Comment">NiMvLSUidUc2JCUieEclInRHLSUid0c2JEYoLSZGJzYjIiIhRiY=</Equation>:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">u:=unapply(subs(x[0]=solve(subs(x(t)=x,char_curve),x[0]),eval(w(t),char_sol)),x,t):'u(x,t)'=u(x,t);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">In this case solution is not constant along the characteristics. Instead, it exibits the linear growth there:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">sol_plot:=plot3d(subs({c=0.5,f=f_ini},u(x,t)),x=-2..2,t=0..4,axes=boxed,scaling=constrained,numpoints=2000,
shading=zhue): display(sol_plot,style=patchnogrid,view=-0.1..4,orientation=[-135,70]);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">Still, looking at the solution from the top we can see the characteristic curves:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">shift:=transform((x,y)-&gt;[x,y,-0.1]):</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">movie:=display([display(sol_plot,style=patchnogrid),display(sol_plot,style=wireframe)],insequence=true):</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">display([movie,shift(char_plot)],orientation=[-90,0],view=[-2..2,0..4,-0.1..4],scaling=constrained);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">And this is how the initial profile evolves in time. It is a combination of growth and accelerated motion to the left (with the speed of <Equation input-equation="t^2;" style="2D Comment">NiMqJCklInRHIiIjIiIi</Equation>):</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">animate(plot,[subs({c=0.5,f=f_ini},u(x,t)),x=-5..4,color=red,thickness=2],t=0..6,scaling=constrained);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">Clean-up:</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">u:='u': f:='f': w:='w': </Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Text-field layout="Normal" style="Normal"/></Section><Section collapsed="true"><Title><Text-field layout="Heading 1" style="Heading 1">References</Text-field></Title><Group><Input><Text-field layout="Bullet Item" style="Bullet Item">Walter A. Strauss, Partial Differential Equations: An Introduction, Wiley, 1992</Text-field><Text-field layout="Bullet Item" style="Bullet Item">Richard Haberman, Elementary Applied Partial Differential Equations, 3rd edition, Prentice Hall</Text-field><Text-field layout="Bullet Item" style="Bullet Item">Stanley J. Farlow, Partial Differential Equations for Scientists and Engineers, Dover 1982</Text-field></Input></Group><Text-field layout="Normal" style="Normal"/></Section><Section collapsed="true"><Title><Text-field layout="Heading 1" style="Heading 1">Disclaimer</Text-field></Title><Text-field layout="Normal" style="Normal">"While every effort has been made to validate the solutions in this worksheet, Waterloo Maple Inc. and the contributors are not responsible for any errors contained and are not liable for any damages resulting from the use of this material." </Text-field></Section><Text-field/></Worksheet>