- #1
roldy
- 237
- 2
Homework Statement
Determine a three-parameter solution, with trigonometric functions using collocation at x=1/4,1/2, and 3/4.
Given: [tex]u=\phi_0 + c_1\phi_1 + c_2\phi_2 + c_3\phi_3[/tex]
[tex]\phi_0=0, \phi_1=sin\pi x, \phi_2=sin2\pi x, \phi_3=sin3\pi x[/tex]
Homework Equations
[tex]R=-\frac{d^2u}{dx^2}-cos(\pi x)=\Sigma_{i=1}^n c_i(i\pi)^2sin(i\pi x)-cos(\pi x)[/tex]
The Attempt at a Solution
So what I basically do here is substitute the three different values for x into
[tex]R=\Sigma_{i=1}^n c_i(i\pi)^2sin(i\pi x)-cos(\pi x)[/tex]
for i=1,2,3
[tex]0=R(x=1/4)=\Sigma_{i=1}^n c_i(i\pi)^2sin(\frac{i\pi}{4})-cos(\frac{\pi}{4})[/tex]
[tex]0=c_1(\pi)^2sin\frac{\pi}{4}+c_2(2\pi)^2sin\frac{ \pi}{2}+c_3(3\pi)^2sin\frac{3\pi}{4}-cos\frac{\pi}{4}[/tex]
[tex]0=c_1\pi^2 \frac{\sqrt{2}}{2} + c_2(2\pi)^2 + c_3(3\pi)^2\frac{\sqrt{2}}{2}-\frac{\sqrt{2}}{2}[/tex]
[tex]0=R(x=1/2)=\Sigma_{i=1}^n c_i(i\pi)^2sin(\frac{i\pi}{2})-cos(\frac{\pi}{2})[/tex]
[tex]0=c_1(\pi)^2sin\frac{\pi}{2}+c_2(2\pi)^2sin \pi+c_3(3\pi)^2sin\frac{3\pi}{2}-cos\frac{\pi}{2}[/tex]
[tex]0=c_1\pi^2 + c_2(0) + c_3(3\pi)^2-(0)[/tex]
[tex]0=R(x=3/4)=\Sigma_{i=1}^n c_i(i\pi)^2sin(\frac{3i\pi}{4})-cos(\frac{3\pi}{4})[/tex]
[tex]0=c_1(\pi)^2sin\frac{3\pi}{4}+c_2(2\pi)^2sin\frac{3\pi}{2}+c_3(3\pi)^2sin\frac{9\pi}{4}-cos(\frac{3\pi}{4})[/tex]
[tex]0=c_1\pi^2 \frac{\sqrt{2}}{2} - c_2(2\pi)^2 + c_3(3\pi)^2\frac{\sqrt{2}}{2}+\frac{\sqrt{2}}{2}[/tex]
Putting the coefficients into a 3X3 matrix and solving for the constants,
[tex]c_1=0, c_2=\frac{\sqrt{2}\pi^2}{8}, c_3=0[/tex]
so finally
[tex]u=\frac{\sqrt{2}\pi^2}{8}sin(2\pi x)[/tex]
I checked with the answers in the book and these are correct. What I need to do now is compare this against the solution of
[tex]u_0=\pi^{-2}(cos\pi x +2x -1)[/tex]
I let x=1/4 and solved each of the equations
u(collocation)=1.74472
u(exact)=0.020984
Is this correct? Does this just mean that the collocation method does not produce a good enough approximation?