Differential Operators and Harmonic Oscillators

Operator Calculus to Solve Heterogeneous Second-Order Linear ODEs

Does Mathematica  apply the Fourier Transform/Derivative Rule Automagically?

FourierTransform [ D [ f [ x ] , { x , 1 } ] , x , k ]

- k FourierTransform [ f [ x ] , x , k ]

It does as of version 5.0! .

Table [ FourierTransform [ D [ f [ x ] , { x , i } ] , x , k ] , { i , 24 } ] // MatrixForm

( - k FourierTransform [ f [ x ] , x , k ] - k 2 FourierTransform [ f [ x ] , x , k ] k 3 FourierTransform [ f [ x ] , x , k ] k 4 FourierTransform [ f [ x ] , x , k ] - k 5 FourierTransform [ f [ x ] , x , k ] - k 6 FourierTransform [ f [ x ] , x , k ] k 7 FourierTransform [ f [ x ] , x , k ] k 8 FourierTransform [ f [ x ] , x , k ] - k 9 FourierTransform [ f [ x ] , x , k ] - k 10 FourierTransform [ f [ x ] , x , k ] k 11 FourierTransform [ f [ x ] , x , k ] k 12 FourierTransform [ f [ x ] , x , k ] - k 13 FourierTransform [ f [ x ] , x , k ] - k 14 FourierTransform [ f [ x ] , x , k ] k 15 FourierTransform [ f [ x ] , x , k ] k 16 FourierTransform [ f [ x ] , x , k ] - k 17 FourierTransform [ f [ x ] , x , k ] - k 18 FourierTransform [ f [ x ] , x , k ] k 19 FourierTransform [ f [ x ] , x , k ] k 20 FourierTransform [ f [ x ] , x , k ] - k 21 FourierTransform [ f [ x ] , x , k ] - k 22 FourierTransform [ f [ x ] , x , k ] k 23 FourierTransform [ f [ x ] , x , k ] k 24 FourierTransform [ f [ x ] , x , k ] )

Does  Mathematica apply the rules according to the Fourier Transform being a linear operator?

FourierTransform [ a f [ x ] + b g [ x ] , x , k ]

FourierTransform [ a f [ x ] + b g [ x ] , x , k ]

Apparently not--so we make some rules that can be applied. It may be instructive to see how to do this.

ConstantRule = FourierTransform[a_  f_[y_], x_, k_] :→ a FourierTransform[f[y], x, k]

DistributeRule =   FourierTransform[Plus[expr_], x_, k_] :→Distribute[FourierTransform[expr, x, k], Plus]

FourierTransform [ a_ f_ [ y_ ] , x_ , k_ ] a FourierTransform [ f [ y ] , x , k ]

FourierTransform [ expr_ , x_ , k_ ] Distribute [ FourierTransform [ expr , x , k ] , Plus ]

Try them out:

temp = FourierTransform [ a f [ x ] + b g [ x ] + d p [ x ] , x , k ] /. DistributeRule /. ConstantRule

a FourierTransform [ f [ x ] , x , k ] + b FourierTransform [ g [ x ] , x , k ] + d FourierTransform [ p [ x ] , x , k ]

Let's  Fourier Transform the left-hand -side of a second-order ODE:

ODE2nd = Mass D [ y [ t ] , { t , 2 } ] + Viscosity D [ y [ t ] , t ] + SpringK y [ t ]

SpringK y [ t ] + Viscosity y [ t ] + Mass y ′′ [ t ]

FrrODE2nd = FourierTransform [ ODE2nd , t , ω ] /. DistributeRule /. ConstantRule

SpringK FourierTransform [ y [ t ] , t , ω ] - Viscosity ω FourierTransform [ y [ t ] , t , ω ] - Mass ω 2 FourierTransform [ y [ t ] , t , ω ]

rhs = FourierTransform [ Cos [ ω0 t ] , t , ω ]

π 2 DiracDelta [ ω - ω0 ] + π 2 DiracDelta [ ω + ω0 ]

ftsol = Solve [ FrrODE2nd rhs , FourierTransform [ y [ t ] , t , ω ] ]

{ { FourierTransform [ y [ t ] , t , ω ] 2 π DiracDelta [ ω - ω0 ] + 2 π DiracDelta [ ω + ω0 ] 2 ( SpringK - Viscosity ω - Mass ω 2 ) } }

InverseFourierTransform [ FourierTransform [ y [ t ] , t , ω ] /. Flatten [ ftsol ] , ω , t , Assumptions ω0 > 0 ]

( SpringK - Mass ω0 2 ) Cos [ t ω0 ] + Viscosity ω0 Sin [ t ω0 ] SpringK 2 - 2 Mass SpringK ω0 2 + Viscosity 2 ω0 2 + Mass 2 ω0 4

Otherwise, the complete solution (i.e., the inhomogeneous plus the homogeneous parts) can be calculated by the DSolve function

FullSimplify [ y [ t ] /. DSolve [ { Mass D [ y [ t ] , { t , 2 } ] + Damper D [ y [ t ] , t ] + SpringK y [ t ] Cos [ ω o t ] , y [ 0 ] == 1 , y ' [ 0 ] == 0 } , y [ t ] , t ] , Assumptions -> ω0 > 0 && Mass > 0 && Damper > 0 && SpringK > 0 ]

{ ( - ( Damper + Damper 2 - 4 Mass SpringK ) t 2 Mass ( SpringK ( ( - 1 + SpringK ) ( Damper ( - 1 + Damper 2 - 4 Mass SpringK t Mass ) + ( 1 + Damper 2 - 4 Mass SpringK t Mass ) Damper 2 - 4 Mass SpringK ) + 2 ( Damper + Damper 2 - 4 Mass SpringK ) t 2 Mass Damper 2 - 4 Mass SpringK Cos [ t ω o ] ) + 2 Damper ( Damper + Damper 2 - 4 Mass SpringK ) t 2 Mass Damper 2 - 4 Mass SpringK Sin [ t ω o ] ω o + ( Damper 3 ( - 1 + Damper 2 - 4 Mass SpringK t Mass ) - Damper ( - 1 + Damper 2 - 4 Mass SpringK t Mass ) Mass ( 1 + 2 SpringK ) + Damper 2 ( 1 + Damper 2 - 4 Mass SpringK t Mass ) Damper 2 - 4 Mass SpringK - ( 1 + Damper 2 - 4 Mass SpringK t Mass ) Mass ( - 1 + 2 SpringK ) Damper 2 - 4 Mass SpringK - 2 ( Damper + Damper 2 - 4 Mass SpringK ) t 2 Mass Mass Damper 2 - 4 Mass SpringK Cos [ t ω o ] ) ω o 2 + Mass 2 ( Damper ( - 1 + Damper 2 - 4 Mass SpringK t Mass ) + ( 1 + Damper 2 - 4 Mass SpringK t Mass ) Damper 2 - 4 Mass SpringK ) ω o 4 ) ) / ( 2 Damper 2 - 4 Mass SpringK ( SpringK 2 + ( Damper 2 - 2 Mass SpringK ) ω o 2 + Mass 2 ω o 4 ) ) }

Functionals: An Introduction to Variational Calculus by way of Variation of Parameters

An early application of introductory calculus involves finding extreme values of a function y = y(x): values of the independent variable x are sought that maximize or minimize y(x). In the calculus of variations, a common problem involves finding an unknown function y(x) that minimizes a different function in which y(x) appears inside an integral. Here we pursue an answer to a problem of this type.

The "quickest" path of running up-hill  can be estimated with a model of how fast one runs up hill.  Given a starting point y(x=0) = 0 and an ending point y(x=1) = 1, the question is to find, among all possible choices of path y(x) that connects the end and starting point, which is the one that takes the least time if there is a hill h(x) that has to be "run-up."
A reasonable model is that running speed is proportional to Cos(climbing-angle)--that is the velocity is 1 for running on a flat surface and goes to zero as the climbing-angle goes to π 2 .

In this case, the time can be represented as an integral of the unknown y(x) (this is worked out in the accompanying lecture notes)
T[y(x)] = x = 0 x = 1 1 + ( dy dx ) 2 + ( dh dx ) 2 dx
Suppose that the "hill" has the shape h(x) = x 2 .

Here, the "real" problem of finding the optimal path from the infinite set of all paths connecting y(x=0) = 0 toy(x=1) = 1  will be replaced by looking at all second-order polynomials: y(x) = a + bx + c x 2

h = x^2 ;

YGeneral = a + b x + c x^2 ;

General :: spell1 : Possible spelling error: new symbol name \" YGeneral \" is similar to existing symbol \" General \". More… "Possible spelling error: new symbol name \\\"\\!\\(YGeneral\\)\\\" is similar to existing symbol \\\"\\!\\(General\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, ButtonData:>\\\"General::spell1\\\"]\\)"

The general path must satisfy the boundary conditions:

YSatisifyingBCs = YGeneral /. ( Solve [ { ( YGeneral /. x 0 ) 0 , ( YGeneral /. x 1 ) 1 } , { a , c } ] // Flatten )

b x + ( 1 - b ) x 2

There is one remaining free variable, it can be determined by minimizing the integral

TimeIntegral = Integrate [ Sqrt [ 1 + ( D [ YSatisifyingBCs , x ] ) ^ 2 + ( D [ h , x ] ) ^ 2 ] , x ]

( - ( - 1 + b ) b 4 ( 2 - 2 b + b 2 ) + x 2 ) 1 + b 2 ( 1 - 2 x ) 2 + 4 b ( 1 - 2 x ) x + 8 x 2 + ( 1 - b + b 2 ) Log [ 2 ( 1 + b 2 ( 1 - 2 x ) 2 + 4 b ( 1 - 2 x ) x + 8 x 2 + b + 4 x - 4 b x + b 2 ( - 1 + 2 x ) 2 - 2 b + b 2 ) ] 2 ( 2 - 2 b + b 2 ) 3 / 2

Time = Simplify [ ( TimeIntegral /. x 1 ) - ( TimeIntegral /. x 0 ) ]

General :: spell1 : Possible spelling error: new symbol name \" Time \" is similar to existing symbol \" Times \". More… "Possible spelling error: new symbol name \\\"\\!\\(Time\\)\\\" is similar to existing symbol \\\"\\!\\(Times\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, ButtonData:>\\\"General::spell1\\\"]\\)"

1 4 ( ( - 1 + b ) b 1 + b 2 2 - 2 b + b 2 + 9 - 4 b + b 2 ( 4 - 3 b + b 2 ) 2 - 2 b + b 2 - 2 ( 1 - b + b 2 ) Log [ 2 ( 1 + b 2 - ( - 1 + b ) b 2 - 2 b + b 2 ) ] ( 2 - 2 b + b 2 ) 3 / 2 + 2 ( 1 - b + b 2 ) Log [ 2 ( 9 - 4 b + b 2 + 4 - 3 b + b 2 2 - 2 b + b 2 ) ] ( 2 - 2 b + b 2 ) 3 / 2 )

Plot [ Time , { b , - 2 , 2 } ]

[Graphics:HTMLFiles/Lecture-22_5.gif]

Graphics

OK, the time is a minimum somewhere on the interval 0 < b < 1.  Solving for the value of b at the minimum:

Bminsol = FindMinimum [ Time , { b , 0 , 1 } ]

{ 1.7856694574497398 , { b 0.5738513944467644 } }

Now we can write the desired fuction that minimizes the time and plot it:

YCubicSolution = YSatisifyingBCs /. Bminsol [ [ 2 ] ]

0.5738513944467644 x + 0.42614860555323564 x 2

ApproxSolution = Plot [ YCubicSolution , { x , 0 , 1 } ]

[Graphics:HTMLFiles/Lecture-22_6.gif]

Graphics

The exact minimizing path can be found by using Calculus of Variations. The solution is obtained from a boundary-value problem which we do not take up at this point, but it is interesting to see the exact solution and compare it with the approximate one we obtained above.  The closed-form expression for the function that minimizes the climbing time is:

YExactSolution = ( 2 x 1 + 4 x 2 + ArcSinh [ 2 x ] ) ( 2 5 + ArcSinh [ 2 ] ) ;

and a series approimation to this function is:

Series [ YExactSolution , { x , 0 , 6 } ] // Normal // N

0.6761586459535304 x + 0.4507724306356869 x 3 - 0.27046345838141217 x 5

Now plot the exact solution and compare it to our calculated approximation...

ExactSolution = Plot [ YExactSolution , { x , 0 , 1 } , PlotStyle { Thickness [ 0.005 ] , Hue [ 1 ] } ]

General :: spell1 : Possible spelling error: new symbol name \" ExactSolution \" is similar to existing symbol \" YExactSolution \". More… "Possible spelling error: new symbol name \\\"\\!\\(ExactSolution\\)\\\" is similar to existing symbol \\\"\\!\\(YExactSolution\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, ButtonData:>\\\"General::spell1\\\"]\\)"

[Graphics:HTMLFiles/Lecture-22_7.gif]

Graphics

Show [ ApproxSolution , ExactSolution ]

[Graphics:HTMLFiles/Lecture-22_8.gif]

Graphics

These two curves are very close!


Created by Mathematica  (November 23, 2005) Valid XHTML 1.1!