# Homework Help: Using the Collocation Method to find a Three-Parameter Solution with Trig Functions

1. Sep 18, 2011

### roldy

1. The problem statement, all variables and given/known data
Determine a three-parameter solution, with trigonometric functions using collocation at x=1/4,1/2, and 3/4.

Given: $$u=\phi_0 + c_1\phi_1 + c_2\phi_2 + c_3\phi_3$$

$$\phi_0=0, \phi_1=sin\pi x, \phi_2=sin2\pi x, \phi_3=sin3\pi x$$

2. Relevant equations
$$R=-\frac{d^2u}{dx^2}-cos(\pi x)=\Sigma_{i=1}^n c_i(i\pi)^2sin(i\pi x)-cos(\pi x)$$

3. The attempt at a solution
So what I basically do here is substitute the three different values for x into
$$R=\Sigma_{i=1}^n c_i(i\pi)^2sin(i\pi x)-cos(\pi x)$$
for i=1,2,3

$$0=R(x=1/4)=\Sigma_{i=1}^n c_i(i\pi)^2sin(\frac{i\pi}{4})-cos(\frac{\pi}{4})$$
$$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}$$
$$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}$$

$$0=R(x=1/2)=\Sigma_{i=1}^n c_i(i\pi)^2sin(\frac{i\pi}{2})-cos(\frac{\pi}{2})$$
$$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}$$
$$0=c_1\pi^2 + c_2(0) + c_3(3\pi)^2-(0)$$

$$0=R(x=3/4)=\Sigma_{i=1}^n c_i(i\pi)^2sin(\frac{3i\pi}{4})-cos(\frac{3\pi}{4})$$
$$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})$$
$$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}$$

Putting the coefficients into a 3X3 matrix and solving for the constants,

$$c_1=0, c_2=\frac{\sqrt{2}\pi^2}{8}, c_3=0$$

so finally

$$u=\frac{\sqrt{2}\pi^2}{8}sin(2\pi x)$$

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
$$u_0=\pi^{-2}(cos\pi x +2x -1)$$

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?