> # Maple is used to help analyze a family of solutions to the DE # y' = sin(x) + sin(y) # which will not be solved analytically by dsolve. # # A brief analysis is given at the end regarding what can be determined about any # solution from the DE itself. # # Written by Doug Hensley # # Drawing conclusions from the DE and of using Maple plotting capabilities as an aid. > with(plots); [animate, animate3d, conformal, contourplot, cylinderplot, densityplot, display, display3d, fieldplot, fieldplot3d, gradplot, gradplot3d, implicitplot, implicitplot3d, loglogplot, logplot, matrixplot, odeplot, pointplot, polarplot, polygonplot, polygonplot3d, polyhedraplot, replot, setoptions, setoptions3d, spacecurve, sparsematrixplot, sphereplot, surfdata, textplot, textplot3d, tubeplot] -------------------------------------------------------------------------------- > contourplot(sin(x)+sin(y),x=-6..6,y=-6..6); -------------------------------------------------------------------------------- > dsolve( diff(y(x),x) = sin(x) + sin(y) , y(x) ); # Maple cannot solve this one. > with(DEtools); [DEplot, DEplot1, DEplot2, Dchangevar, PDEplot, dfieldplot, phaseportrait] -------------------------------------------------------------------------------- > starters:=[seq(seq([j,k],j=-4..4),k=-4..4)]; starters := [[-4, -4], [-3, -4], [-2, -4], [-1, -4], [0, -4], [1, -4], [2, -4], [3, -4], [4, -4], [-4, -3], [-3, -3], [-2, -3], [-1, -3], [0, -3], [1, -3], [2, -3], [3, -3], [4, -3], [-4, -2], [-3, -2], [-2, -2], [-1, -2], [0, -2], [1, -2], [2, -2], [3, -2], [4, -2], [-4, -1], [-3, -1], [-2, -1], [-1, -1], [0, -1], [1, -1], [2, -1], [3, -1], [4, -1], [-4, 0], [-3, 0], [-2, 0], [-1, 0], [0, 0], [1, 0], [2, 0], [3, 0], [4, 0], [-4, 1], [-3, 1], [-2, 1], [-1, 1], [0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [-4, 2], [-3, 2], [-2, 2], [-1, 2], [0, 2], [1, 2], [2, 2], [3, 2], [4, 2], [-4, 3], [-3, 3], [-2, 3], [-1, 3], [0, 3], [1, 3], [2, 3], [3, 3], [4, 3], [-4, 4], [-3, 4], [-2, 4], [-1, 4], [0, 4], [1, 4], [2, 4], [3, 4], [4, 4]] # Read about "seq" with Maple help. It's a handy Maple function. -------------------------------------------------------------------------------- > fn:=(x,y)->sin(x)+sin(y); fn := (x,y) -> sin(x) + sin(y) -------------------------------------------------------------------------------- > plot2:=DEplot1(fn,[x,y],-6..6,starters,-6..6); Error, (in DEplot1) Invalid fourth argument # This has a syntax error. You'll be seeing the syntax error a lot if you use Maple # much. It's all too easy to forget one or another nitpicking detail of the syntax rules. # Fortunately, it is not necessary to remember all these. If you're anywhere close, a # quick hop over to Maple Help will clear things up. -------------------------------------------------------------------------------- > ?DEplot1 # Aha: the object "starters" should have been a set, rather than a list. -------------------------------------------------------------------------------- > starts:={op(starters)}; starts := {[-1, 1], [0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [-4, 2], [-3, 2], [-2, 2], [-1, 2], [0, 2], [1, 2], [2, 2], [3, 2], [4, 2], [-4, 3], [-3, 3], [-2, 3], [-1, 3], [0, 3], [1, 3], [2, 3], [3, 3], [4, 3], [-4, 4], [-3, 4], [-2, 4], [-1, 4], [0, 4], [1, 4], [2, 4], [3, 4], [4, 4], [3, 0], [4, 0], [-4, 1], [-3, 1], [-2, 1], [2, -1], [3, -1], [4, -1], [-4, 0], [-3, 0], [-2, 0], [-1, 0], [0, 0], [1, 0], [2, 0], [2, -3], [3, -3], [4, -3], [-4, -2], [-3, -2], [-2, -2], [-1, -2], [0, -2], [1, -2], [2, -2], [3, -2], [4, -2], [-4, -1], [-3, -1], [-2, -1], [-1, -1], [0, -1], [1, -1], [-4, -4], [-3, -4], [-2, -4], [-1, -4], [0, -4], [1, -4], [2, -4], [3, -4], [4, -4], [-4, -3], [-3, -3], [-2, -3], [-1, -3], [0, -3], [1, -3]} # op(thing) is the sequence of ingredients of that thing. So {op(thing)} strips off the list # brackets and puts in {} brackets. -------------------------------------------------------------------------------- > DEplot1(fn,[x,y],-6..6,starts,-6..6); -------------------------------------------------------------------------------- > # Don't save this picture, but it is most informative. The regions where solutions are # increasing are those where sin(x)+sin(y)>0. These form a diagonally twisted # checkerboard, as seen in the first graphic. # # There are also regions of compression and rarefaction: those are the regions where # d/dy (sin(x)+sin(y)) is negative or positive respectively. # Here, that depends only on y, so one compression zone is a horizontal strip from # y=Pi/2 to y=3*Pi/2. Zones of compression and thinning out alternate, both are # equally wide. In compression zones, solutions tend to get closer together as x # increases, in the other zones, they spread apart. # Note that there is a solution that stays within the compression zone: # where sin(y) is decreasing, or equivalently, cos(y)<0. All such solutions get packed # ever more closely as time goes by. Their common fate is to converge to "the" # periodic solution. If you continue the plot, say by extending the x plot range to 12, # you'll see that solution. It's not exactly a sine wave, but it does go up and down, and # like a sine wave, it's periodic. There are identically shaped solutions above and below # that one, spaced 2Pi apart vertically. In between, there are similar-shaped, unstable # solutions. If you go back in time, the solutions converge on the forward-unstable # ones. # The general theory of solutions to a first-order DE tells us that the solution exists in # some interval. The fact that f(x,y)=sin(x)+sin(y) so that |f(x,y)|<=2 means that the # slope of a solution cannot exceed 2, up or down, so the solution cannot escape to # infinity in finite time. Since f(x,y) is continuous everywhere, this means that any # solution to this particular DE will be defined on the whole real line. -------------------------------------------------------------------------------- >