# principles of pdes

Post on 17-Jul-2016

212 views

Embed Size (px)

DESCRIPTION

An example of solving a PDE with MATLAB.TRANSCRIPT

Homework Assignment #8

Student: Vinicius Fontes

ASU # ID: 1208318367

1.

(a) The heat equation is

2

2= 0

First, lets assume a solution in the format

(, ) = (x) + (, ) And also

(0) = (0, ) = 1 () = (, ) = 0

This solution is chosen because we have a non homogeneous condition for = 0 and = . If we

had, () = 0 and the solution would be the same as a non homogeneous PDE. Nevertheless the

conditions for (, ) will always be homogeneous using this method. Applying the solution to

the PDE gives

(

2

2+

2

2) = 0

Because () does not depend on . Lets also assume that 2

2= 0 so the equation above can

be written as

2

2= 0

Lets assume a solution (, ) = ()() and rearrange the equation as

1

=

Dividing both sides by 1

=

As both sides depend on different variables, we can assume the expression above can only be

equal to a constant arbitrarily called 2.

1

=

= 2

From this argument we have two ODE.

. = 2 . + 2 = 0

To solve the first ODE we only need to use separation of variables

= 2

1

= 2

= 2

= 2

0

ln() ln() = 2

ln (

) = 2

()

=

2

() = 2

Now, solving the second equation, we have

+ 2 = 0

We know the solution for this sort of ODEs is a sum of sines and cosines

() = 1 cos() + 2 sin()

Now, lets apply the boundary conditions to find 1 and 2.

(0, ) = (0) + (0, ) = 1 (, ) = () + (, ) = 0

But it has been defined that (0) = 1 and () = 0 so

(0, ) = 1 + (0, ) = 1

(, ) = 0 + (, ) = 0

Then (0, ) = (, ) = 0. Know, we can use the solution for (, ) and find the constants.

(0, ) = (0) () = 0 (, ) = () () = 0

As we dont want the trivial solution (() = 0), (0) = () = 0. Applying this results in the

solution found for ().

(0) = 1 cos(0) + 2 sin(0) = 0 1 1 + 2 0 = 0

1 = 0

() = 0 cos() + 2 sin() = 0 2 sin() = 0

If both 1 and 2 are zero, we have a trivial solution. So, to avoid it, sin() = 0

= ,

=

() = 2 sin()

Now we can rewrite the solution for (, ) (using only one coefficient called ) as

(, ) =

2 sin ()

=

And the solution for each and will be the summation of all the from = 1 to infinity,

because when = 0, 0 = 0

Now, its possible to find () because we assumed 2

2= 0 and we know that it is not a zero

function. If the second derivative of a function is zero, the first derivative is a constant and the

function itself is given by

() = 1 + 2

Applying the boundary conditions

(0) = 10 + 2 = 1 2 = 1

() = 1 + 1 = 0 1 + 1 = 0

1 = 1

() = 1

+ 1

Now we have both functions that makes up the solution, we can write it as

(, ) =

+ 1 +

2 sin()

=1

Now, lets apply an arbitrary initial condition (, 0) =

(, 0) +

1 =

20 sin()

=1

To solve for , we multiply both sides by sin()

( +

1) sin() = 1 sin() sin()

=1

Now we integrate both sides o the equation in from 0 to .

( +

1) sin()

0

= sin() sin()

=1

0

To simplify the expression above we can take summation out of the integral (because the integral

of sum is the sum of the integrals) and so , because it is a constant for each .

( +

1) sin()

0

= sin() sin()

0

=1

We also know that the integral of a product of two sine functions only returns a non-zero result

when the argument of both functions are the same, therefore = and the result is

2.

( +

1) sin()

0

=

2

=1

Applying these arguments and solving for gives us

=2

( +

1) sin()

0

And that is a general solution that can be applied for any initial condition. As we know that the

initial condition is = sin (

), we can find each

=2

(sin (

) +

1) sin()

0

=2

[ sin (

) sin (

)

0

+1

sin (

)

0

sin (

)

0

]

The solution for the first term will only be non-zero when the arguments are the same, therefore,

for = 1 the solution for the first integral is

2.

To get the solution for the second integral we should solve it by parts

sin (

)

0

= , =

= sin (

), =

(

)

sin (

)

0

=

cos (

)0

+

cos (

)

0

sin (

)

0

=

cos (

)0

+

(

sin (

))

0

sin (

)

0

=2

cos( )

The solution for the third and last integral is get using a simple substitution of variables

sin(

)

0

=

=

(0) = 0, () =

sin()

0

sin(

)

0

=

(cos() cos(0))

sin(

)

0

=

(1 cos())

Using these solution to find 1

1 =2

[

2+

1

(

2

1cos(1 )) (

1(1 cos(1)))]

1 =2

[

2

(

(2))]

1 =2

[ (

1

2

1

2

)]

1 = 1 6

For every 1

=2

[1

(

2

cos( )) (

(1 cos()))]

=2

[

cos() (

(1 cos()))]

For odd , cos() = 1

, =2

[

(1) (

(1 (1)))]

, =2

[

2

]

, =2

[

3

]

, = 6

For even , cos() = 1

, =2

[

(1) (

(1 1))]

, =2

[

]

, =2

(b) The heat equation is

2

2= 0

First, lets assume a solution in the format

(, ) = (x) + (, ) And also

(0) = (0, ) = 1

But this time, we have one more expression

T

x(, ) = 0

Applying the solution to the PDE gives

(

2

2+

2

2) = 0

Assuming that 2

2= 0

2

2= 0

We also assume the same solution (, ) = ()() so when applied in the equation above we

have the same ODEs as before which solutions are

() = 1 cos() + 2sin()

() = 2

Applying the first boundary condition

(0, ) = (0) + (0)() = 1 1 + (0)() = 1

Again, to avoid the trivial solution, (0) = 0 then

() = 2sin()

Applying the second boundary condition

(, ) = () + ()()

(, ) = () + ()() = 0

To apply the boundary condition, lets assume

() = 0, so () = 0 to avoid the trivial solution

then

() = 2 cos() () = 2 cos() = 0

Once again to avoid the trivial solution, lets assume the cosine as zero. We know that a cosine is

zero when the argument is an odd number times . This can be written as

=

2

=

2, = 1, 3, 5,

() = 2 sin (

2)

Now we need to find (). As its second derivative is zero the first derivative should be a

constant.

But, as we assumed

() = 0, then

() = 0. Therefore, () is a constant too.

As we assumed (0) = 1, the constant is 1, so

() = 1

Now we can write the function for the temperature (combining and 2 into one constant )

(, ) = 1 +

2

1

sin()

To calculate we need to apply the initial condition, which is (, 0) = 0. We need to take the

same steps as in (a) to solve for

0 = 1 +

20

1

sin (

2)

1

1

sin (

2) = 1

1

sin (

2) sin (

2) = 1sin (

2)

sin (

2) sin (

2)

1

0

= 1sin (

2)

0

sin(

2) sin (

2)

0

1

= sin(

2)

0

2

1

= sin (

2)

0

2

1

= (2l

ncos (

2))

0

=4

[cos (

2) cos(0)]

= 4

The solution can be written simply as

(, ) = 1 4

2

1

sin()

Where =

2 and = 1, 3, 5,

2. To solve this problem numerically, we need to divide the rod of length in divisions. Now we

solve the heat equation for

2

2= 0

=

2

2

First, we apply the approximation for the second degree derivative

=

2[1 21 + +1]

Now we can approximate the temperature of the point of the rod at the point in time

applying Eulers explicit method

+1 =

+

2[1

2 + +1

]

Where

2 is the Courant or CFL number, which we will call . The equation can be simplified to

+1 = 1

+ (1 2) + +1

However, due to the second initial condition is

(, ) = 0, we dont have any information about

the value of the temperature at = except that its derivative is zero.

We can argument that if so, the temperature at that point doesnt change in respect to length

only, so we can calculate the temperature of the point before ( 1) that the temperature of the

last point will be the same.

This can be proven using the backwards difference to calculate the derivative for the point,

where =

(, ) =

1

= 0

= 1

Now we can apply this result to find the temperature of the second to last point

1+1 = 2

+ (1 2)1 +

= 1

1+1 = 2

+ (1 2)1 + 1

1+1 = 2

+ (1 )1

The temperature of t

Recommended