HW 1, MAE 200B.

Problem 1

by Nasser Abbasi

UCI, Winter 2006.

Question

Solve the following IBVP for the 1D heat conduction problem over the interval $[0,L]$ by separation of variables. MATH for $0<x<L$ with the boundary conditions MATH and the initial conditions specified by the function

MATH

Solution

Assume the solution is of the form MATH where $X\left( x\right) $ and $T\left( t\right) $ are functions which are independent of each others, i.e. $X\left( x\right) $ is a function of $x$ only and $T\left( t\right) $ is a function of $t$ only.

Substitute this form in the PDE above we obtain MATH, and now divide both sides by $XT$ we obtain MATH.

Since the left hand side is a function which depends on time only and the right hand side is a function which depends on $x$ only and both are equal, hence they both must equal to a constant, say $\lambda $. Hence we obtain the following 2 ODE's to solve:

MATH or MATH

and

MATH or MATH

Start by solving the spatial ODE. Assume the solution to MATH is of the form MATH, and substitute this back in the ODE we obtain the characteristic equation MATH, and divide both side by $Ae^{Bx}$ we get MATH, hence the solution can be written as MATH

So one general solution to $X\left( x\right) $ is a sum of scaled version of these 2 basic solution, i.e. MATH

case (1): $\lambda >0$

Apply the spatial B.C. to the above solution to determine $A_{1}$ and $A_{2}$, we get from the B.C. at $x=0$ the equation $0=A+B$ and from the B.C. at $x=L$ we obtain the equation MATH.

Hence $A=-B$ and substitute this in the second equation above, we obtain MATH. But for a non-trivial solution, $B\neq 0$ hence this means that MATH or MATH and since we assumed $\lambda >0$ this implies that MATHfor some positive MATH but this is not possible unless $k=0$, hence $\lambda >0$ only gives a trivial solution $A=B=0$ or MATH.

case(2): $\lambda =0$

When $\lambda =0\,$ the ODE is MATH which has the solution MATH, and when we apply the B.C. we obtain $0=B$ and $0=AL$ or $A=0$, hence this results also in a trivial solution MATH

case(3) $\lambda <0$

Let MATH for some constant $\omega $, hence eq (1) above can be written as MATH which can be rewritten (using Euler relations MATH and MATH) as MATH

Apply the B.C. at $x=0$ we obtain $A=0$ hence MATH, and now apply the B.C. at $x=L$ we obtain $0=B\sin \omega L\,$ and to avoid a trivial solution $B=0$ we must have that $\sin \omega L=0$ or $\omega L=n\pi $ or MATHfor $n=1,2,3,\cdots $

Hence the solution for the spatial ODE is MATH

Where MATH for $n=1,2,3,\cdots $ and we assumed the constant $B=1$

Now we need to find solution to the time ODE. For each $\omega _{n}$ we have a solution. SinceMATH, assume solution is of the form $T=Ae^{Bt}$ hence the characteristic equation leads to $B=\alpha \lambda $ hence the solution is MATH but MATH hence MATH or MATH

By choosing $A=1$

Hence the overall solution is MATH

By principle of superposition, the general solution is a scaled sum of these solutions. where the scaling parameter depends on $n\,\ $which we call $a_{n} $ i.e. MATH

Now apply the initial condition MATH, from eq (2) above we obtain that MATH

Compare this an expression where we write a vector in terms of its basis as in MATH . To find the vector components $a_{i}$ we apply the inner product as follows: MATH hence using similar idea, we apply this to find the components $a_{n}$ by considering in this case the vector $V$ as being the function $u_{0}$ and it is being decomposed to its basis $\sin \omega _{n}x$ as what we do normally in fourier series expansion. Hence we now can find $a_{n}$ by writing MATH and take the inner product over $[0,L]$ we obtain MATH

But MATH

But MATH hence we get that MATH

Now to evaluate MATH , we rewrite as sum of 2 integrals for each of the ranges of the initial condition as follows

MATH

But MATH by integration by parts. Apply this to the above we obtain

MATH

But MATH hence above becomesMATH

Hence MATH

Try for few $n$ values

MATH

MATH

MATH

MATH

MATH

Hence MATH

Since $a_{n}=0$ for even $n$, we only need to sum over odd values of $n$

Hence MATH

When $L=1$ and $\alpha =1$

MATHAnd the general solution is from eq (2) :MATH

Now consider the case when $L=1$ and $\alpha =1$ hence the solution is MATH




The following is a plot of the initial condition $u_{0}$ and the approximation to it as given by eq(4) above by using trying different values of $n$. I tried for $n=1,3,5,7$, we see that as $n$ increases, the summation approximation becomes closer and closer to the initial condition function $u_{0}$ as expected from Fourier series expansion.


plot1.png

To find the number of terms we need so that the approximation is consider 'good', I will find, for each $n$, the maximum of the error that occurs between the function $u_{0}$ and the function represented by the sum.

Will stop when the maximum error is less than some tolerance, say $\,0.1\%$ or $0.001$. The following is the Matlab code and the plot result and the final $n$ was found to be.

The result shows that if we want maximum error to be less than $0.01\%$ then $n=55$, and for maximum error to be less than $0.1\%$ then $n=13$

I will use $n=55$ since this make the approximation almost the same as $U_{0}$.


plot2.png

Now use this $n$ to find the final solution given by equation (5) above

MATH

The following is the plot of MATH for different $t$ values.


plot3.png

The following is another plot but using smaller time increments of 0.01 seconds, up to $t=0.4$


plot4.png