An archived instance of discourse for discussion in undergraduate PDE.

#8 from PDE Quiz 1 Type Problems

qkhan

I might be a little late adding this but hopefully someone will be able to help me out before our quiz tomorrow. I tried my hand at it and I was wondering if this was the right way to go about this problem.

So the equation starts off with $u''=-\sin(\pi x^2)$ with initial conditions $u(0) = u(1) = 0$. We know that for a second order differential equation, the approximations can be calculated with $u(x) = \frac{u_{i+1}-2u_1+u_{i-1}}{h^2}$. This is what I did and these are the answers I got and I'd just like to verify if I did it right or if I didn't, how I'd go about solving it:

$h = \frac{1}{4}$ from the number line given to us, $u_0 = 0$, $u_1 = 0$, $x_0 = 0$, $x_1 = 1$

$$\frac{u_0 - 2u_{\frac{1}{4}} + u_{\frac{2}{4}}}{\frac{1}{16}} = - \sin[(\frac{1}{4})^2\pi]$$
$$16({u_0 - 2u_{\frac{1}{4}} + u_{\frac{2}{4}}}) = - \sin(\frac{\pi}{16})$$
$$16{u_0 - 32u_{\frac{1}{4}} + 16u_{\frac{2}{4}}} = - \sin(\frac{\pi}{16})$$
The rest of the equations are as follows then:


$$16{u_{\frac{1}{4}} - 32u_{\frac{2}{4}} + 16u_{\frac{3}{4}}} = - \sin(\frac{\pi}{4})$$
$$16{u_{\frac{2}{4}} - 32u_{\frac{3}{4}} + 16u_1} = - \sin(\frac{9\pi}{16})$$

Since we know $u_0$ and $u_1$, we can substitute values in for those and I think the three equations simplify down to the following:

$$-32{u_{\frac{1}{4}} + 16u_{\frac{2}{4}}} = - \sin(\frac{\pi}{16})$$
$$16{u_{\frac{1}{4}} - 32u_{\frac{2}{4}} + 16u_{\frac{3}{4}}} = - \sin(\frac{\pi}{4})$$
$$16{u_{\frac{2}{4}} - 32u_{\frac{3}{4}}} = - \sin(\frac{9\pi}{16})$$

Can anyone else verify this? Thank you!

--Qurat

scarr

Qurat I agree with everything you did, but I have two questions.

For your first final equation:

$$32{u_{\frac{1}{4}} + 16u_{\frac{2}{4}}} = - \sin(\frac{\pi}{16})$$

Shouldn't the 32 be negative? Or am I missing something...

And lastly, what are/ where do the 1's after each 16 component come from in the last two equations?

$$16{u_{\frac{1}{4}}1 - 32u_{\frac{2}{4}} + 16u_{\frac{3}{4}}} = - \sin(\frac{\pi}{4})$$
$$16{u_{\frac{2}{4}}1 - 32u_{\frac{3}{4}}} = - \sin(\frac{9\pi}{16})$$

qkhan

I'm just really bad at checking my formatting late at night apparently. Those ones shouldn't be there and I did drop a negative, it should be -32. Thanks, Sam.

cbridges

Hey guys,
I know this is just a formatting thing but I am pretty sure the formula for $u''(x)$ approximations has $u_{i-1}$ as the first variable. All of the calculations presented used the formula below which is the one in our notes but I didn't want anyone to be confused about the formula. [I also needed to post something to become a basic user]

$$
\begin{array}{cc}
u''(x_i) =\frac{u_{i-1}-2u_1+u_{i+1}}{h^2} \\
\end{array}
$$