Time Dependent Solution to the Diffusion Equation in thePlane with a source at the origin.

Note: This notebook will produce some neat animations but they each take some time to compute. And, if you save the notebook with the graphics, it will require 50MB or so of hard disk space.

You should definitely take the time to learn how to make your own animations because the results can be really instructive. You can even save animations in various formats and then import them in separate applications.

<< Graphics`

concentration = Exp [ - ( x ^ 2 + y ^ 2 ) 4 Diffusivity t ] 4 Pi Diffusivity t

- x 2 + y 2 4 Diffusivity t 4 Diffusivity π t

Let the diffusivity be 1 for visualization purposes

Diffusivity = 1

1

<< Graphics`Animation`

MoviePlot3D [ concentration , { x , - 4 , 4 } , { y , - 4 , 4 } , { t , 0.01 , 2.51 , .05 } , PlotPoints 40 , PlotRange { 0 , 2 } , DisplayFunction Identity ]

[Graphics:HTMLFiles/Lecture-11_52.gif]

MovieContourPlot [ concentration , { x , - 2 , 2 } , { y , - 2 , 2 } , { t , 0.01 , 6.51 , .05 } , PlotPoints 40 , PlotRange { 0 , 0.5 } , DisplayFunction Identity , ColorFunction ( Hue [ 1 - 0.75 # ] & ) ]

[Graphics:HTMLFiles/Lecture-11_184.gif]

Flux is a vector that points in the direction of the flow  and is a measure of how much is flowing per unit time

<< Graphics`PlotField`

flux = { - D [ concentration , x ] , - D [ concentration , y ] }

{ - x 2 + y 2 4 t x 8 π t 2 , - x 2 + y 2 4 t y 8 π t 2 }

This is an example of a time - dependent vector field j ( x , y , t )

PlotVectorField [ flux /. t 0.8 , { x , - 2 , 2 } , { y , - 2 , 2 } , PlotPoints 20 , ColorFunction ( Hue [ 1 - 0.75 # ] & ) ]

[Graphics:HTMLFiles/Lecture-11_185.gif]

Graphics

PlotVectorField [ flux /. { t 0.2 } , { x , - 2 , 2 } , { y , - 2 , 2 } , PlotPoints 21 , Frame -> True , ScaleFunction -> ( 10. # & ) , MaxArrowLength -> 50 , ScaleFactor -> None , ColorFunction ( Hue [ 1 - 0.75 # ] & ) ]

[Graphics:HTMLFiles/Lecture-11_186.gif]

Graphics

To see animations,use the menu command to group all the graphics cells together, and then animate

Table [ PlotVectorField [ flux , { x , - 2 , 2 } , { y , - 2 , 2 } , PlotRange -> { { - 3 , 3 } , { - 3 , 3 } } , Frame -> True , PlotPoints 19 , ScaleFunction -> ( 100. # & ) , MaxArrowLength -> 10 , ScaleFactor -> None , ColorFunction ( Hue [ 1 - 0.75 # ] & ) ] , { t , 0.01 , 6 , .05 } ]

[Graphics:HTMLFiles/Lecture-11_307.gif]

{ Graphics }

flux . { 1 , 0 }

- x 2 + y 2 4 t x 8 π t 2

To see animations,use the menu command to group all the graphics cells together, and then animate

MovieContourPlot [ flux . { 1 , 0 } , { x , - 2 , 2 } , { y , - 2 , 2 } , { t , 0.01 , 6.51 , .05 } , PlotPoints 40 , PlotRange { 0 , 0.5 } , DisplayFunction Identity , ColorFunction ( Hue [ 1 - 0.75 # ] & ) ]

[Graphics:HTMLFiles/Lecture-11_439.gif]

To see animations,use the menu command to group all the graphics cells together, and then animate

MovieContourPlot [ flux . { 1 , 0 } , { x , - 2 , 2 } , { y , - 2 , 2 } , { t , 0.01 , 6.51 , .05 } , PlotPoints 40 , PlotRange { - 0.5 , 0.5 } , DisplayFunction Identity , ColorFunction ( Hue [ 1 - 0.75 # ] & ) ]

[Graphics:HTMLFiles/Lecture-11_571.gif]

flux { 1 , 0 }

{ - x 2 + y 2 4 t x 8 π t 2 , 0 }

To see animations,use the menu command to group all the graphics cells together, and then animate

Table [ PlotVectorField [ flux { 1 , 0 } , { x , - 2 , 2 } , { y , - 2 , 2 } , PlotRange -> { { - 3 , 3 } , { - 3 , 3 } } , Frame -> True , PlotPoints 19 , ScaleFunction -> ( 100. # & ) , MaxArrowLength -> 10 , ScaleFactor -> None , ColorFunction ( Hue [ 1 - 0.75 # ] & ) ] , { t , 0.01 , 6 , .05 } ]

[Graphics:HTMLFiles/Lecture-11_692.gif]

{ Graphics }

Cross products:

crossab = Cross [ { a 1 , a 2 , a 3 } , { b 1 , b 2 , b 3 } ]

{ - a 3 b 2 + a 2 b 3 , a 3 b 1 - a 1 b 3 , - a 2 b 1 + a 1 b 2 }

detab = Det [ ( i j k a 1 a 2 a 3 b 1 b 2 b 3 ) ]

- k a 2 b 1 + j a 3 b 1 + k a 1 b 2 - i a 3 b 2 - j a 1 b 3 + i a 2 b 3

testcrossab = { Coefficient [ detab , i ] , Coefficient [ detab , j ] , Coefficient [ detab , k ] }

{ - a 3 b 2 + a 2 b 3 , a 3 b 1 - a 1 b 3 , - a 2 b 1 + a 1 b 2 }

testcrossab crossab

True

Derivatives of Vectors

Clear [ TimeVector ]

TimeVector = { Cos [ 4 π t ] , Sin [ 8 π t ] , Sin [ 2 π t ] }

{ Cos [ 4 π t ] , Sin [ 8 π t ] , Sin [ 2 π t ] }

ParametricPlot3D [ TimeVector , { t , 0 , 1 } ]

[Graphics:HTMLFiles/Lecture-11_693.gif]

Graphics3D

DeltoidSpiral = { ( 2 Cos [ π t ] + Cos [ 2 π t ] ) , ( 2 Sin [ π t ] - Sin [ 2 π t ] ) , t / 3 }

{ 2 Cos [ π t ] + Cos [ 2 π t ] , 2 Sin [ π t ] - Sin [ 2 π t ] , t 3 }

pp = ParametricPlot3D [ DeltoidSpiral , { t , - 3 , 3 } , AxesLabel { x , y , z } ]

[Graphics:HTMLFiles/Lecture-11_694.gif]

Graphics3D

Show [ { Graphics3D [ Thickness [ 0.01 ] ] , Graphics3D [ Hue [ 1 ] ] , pp } ]

[Graphics:HTMLFiles/Lecture-11_695.gif]

Graphics3D

dDSt = D [ DeltoidSpiral , t ]

{ - 2 π Sin [ π t ] - 2 π Sin [ 2 π t ] , 2 π Cos [ π t ] - 2 π Cos [ 2 π t ] , 1 3 }

ppdt = ParametricPlot3D [ dDSt , { t , - 3 , 3 } , AxesLabel { x , y , z } ]

[Graphics:HTMLFiles/Lecture-11_696.gif]

Graphics3D

Show [ { Graphics3D [ Thickness [ 0.01 ] ] , Graphics3D [ Hue [ 0.3 ] ] , ppdt } ]

[Graphics:HTMLFiles/Lecture-11_697.gif]

Graphics3D

ppdtlim [ tl_ ] := { Graphics3D [ Thickness [ 0.01 ] ] , Graphics3D [ Hue [ 0.3 ] ] , ParametricPlot3D [ 0.33 * dDSt , { t , 0 , tl } , AxesLabel { x , y , z } , Compiled False , DisplayFunction Identity ] }

dtlim [ tl_ ] := { Graphics3D [ Thickness [ 0.01 ] ] , Graphics3D [ Hue [ 1 ] ] , ParametricPlot3D [ DeltoidSpiral , { t , 0 , tl } , AxesLabel { x , y , z } , Compiled False , DisplayFunction Identity ] }

To see animations,use the menu command to group all the graphics cells together, and then animate

ShowAnimation [ Table [ { ppdtlim [ t ] , dtlim [ t ] } , { t , .05 , 3 , .05 } ] , PlotRange { { - 4.25 , 4.25 } , { - 4.25 , 4.25 } , { 0 , 1 } } , PlotRegion { { 0 , 1 } , { 0 , 1 } } , SphericalRegion True , Boxed True , BoxRatios { 1 , 1 , 1 } , ViewCenter { 0 , 0 , 0 } , AspectRatio 1 , ViewPoint { 1.2 , - 3 , 2 } ]

[Graphics:HTMLFiles/Lecture-11_758.gif]

Export :: noopen : Cannot open /Users/ccarter/classes/3016/Web/MathHTML/Lecture-11/Lecture-11.html . More… "Cannot open \\!\\(\\\"/Users/ccarter/classes/3016/Web/MathHTML/Lecture-11/Lecture-11.html\\\"\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, ButtonData:>\\\"General::noopen\\\"]\\)"

Export :: noopen : Cannot open /Users/ccarter/classes/3016/Web/MathHTML/Lecture-11/Lecture-11.html . More… "Cannot open \\!\\(\\\"/Users/ccarter/classes/3016/Web/MathHTML/Lecture-11/Lecture-11.html\\\"\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, ButtonData:>\\\"General::noopen\\\"]\\)"

Export :: noopen : Cannot open /Users/ccarter/classes/3016/Web/MathHTML/Lecture-11/Lecture-11.html . More… "Cannot open \\!\\(\\\"/Users/ccarter/classes/3016/Web/MathHTML/Lecture-11/Lecture-11.html\\\"\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, ButtonData:>\\\"General::noopen\\\"]\\)"

Export :: noopen : Cannot open /Users/ccarter/classes/3016/Web/MathHTML/Lecture-11/Lecture-11.html . More… "Cannot open \\!\\(\\\"/Users/ccarter/classes/3016/Web/MathHTML/Lecture-11/Lecture-11.html\\\"\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, ButtonData:>\\\"General::noopen\\\"]\\)"

Export :: noopen : Cannot open /Users/ccarter/classes/3016/Web/MathHTML/Lecture-11/Lecture-11.html . More… "Cannot open \\!\\(\\\"/Users/ccarter/classes/3016/Web/MathHTML/Lecture-11/Lecture-11.html\\\"\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, ButtonData:>\\\"General::noopen\\\"]\\)"


Created by Mathematica  (October 12, 2005) Valid XHTML 1.1!