
Diffusion equation
I have the following equation:
du/dt = D * d^2(u)/dx^2 + sin ((pi * x) / L)
where my derivatives are partial derivatives
I am given that 0<=x<=L and that u(x,0) = x/L
u(0,t) = 0 and u(L,t) = 1
And we assume that the solution could be written in the form z(x) + v(x,t)
The first thing I am asked is to show that the steady part z(x) satisfies the ODE d^2(z)/dx^2 = 1/D * sin(pi*x/L) {ordinary derivatives}
My working until now is that the steady part satisfies du/dt = 0 {partial derivative}
so the diffusion equation becomes d^2(u)/dx^2 = 1/D * sin (Pi * x/L)
My question is that I find what is required but in terms of u, not in terms of z, that is the steady part.
Also I have to find initial conditions for z(x),
which (based on the conditions I am given) are z'(L) = 0 and that z(0) = 0 {I am not too sure though}
Then I have to show that v(x,t) satisfies dv / dt = D * d^2(v) / dx^2 {partial derivatives} and find initial conditions which I am struggling to find!
I am not too sure, if someone can help me, I would appreciate it!

Re: Diffusion equation
Maybe I can help. What you have is the following problem to solve:
$\displaystyle u_t = D u_{xx} + \sin \frac{\pi x}{L}, \;\; 0 < x < L$
$\displaystyle u(0,t) = 0,\;\;\;u(L,t) = 1,\;\;\;u(x,0) = \frac{x}{L}$.
You have two difficulties here. One is the boundary condition $\displaystyle u(L,t) = 1$ and two, the source term $\displaystyle \sin \frac{\pi x}{L}$.
The idea here is: Is is possible to introduce a change of variable
$\displaystyle u(x,t) = v(x,t) + z(x)$
so that
(1) the new BC becomes $\displaystyle v(0,t) = 0, v(L,t) = 0$? and
(2) the new PDE becomes $\displaystyle v_t = D v_{xx}?$
Normally we can just achieve (1) but sometimes (as in this case) we can get (2) as well. Let's go after (2) first. When we sub. into the PDE we get
$\displaystyle v_t = Dv_{xx} + Dz''(x) + \sin \frac{\pi x}{L}$
Now we choose
$\displaystyle Dz''(x) + \sin \frac{\pi x}{L} = 0.\;\;\;(*)$
This leaves
$\displaystyle v_t = D v_{xx}$ (one of the desired results).
Integrating (*) gives
$\displaystyle z = \frac{L^2}{D \pi^2} \sin \frac{\pi x}{L} + c_1 x + c_2$.
So at this point we have
$\displaystyle u = v + \frac{L^2}{D \pi^2} \sin \frac{\pi x}{L} + c_1 x + c_2,\;\;\;(**)$.
Now we go after (1)
(a) u(0,t) = 0 and v(0,t) = 0. From (**), we obtain $\displaystyle c_2 = 0$.
(b) u(L,t) = 1 and v(L,t) = 0. From (**) we obtain $\displaystyle c_1 = \frac{1}{L}.$
At this point we have the following.
$\displaystyle u = v + \frac{L^2}{D \pi^2} \sin \frac{\pi x}{L} + \frac{x}{L},\;\;\;(***)$.
The only thing left is to find out what the new IC is for the $\displaystyle v$ problem. Here you'll need to use (***). I'll leave this to you.

Re: Diffusion equation
You confused me someway with your post, let me tell you what I understand and what not, but thank you very much for your answer.
So my question says that I can assume that u(x,t) = z(x) + v(x,t), with lim v(x,t) as t > inf = 0 {I forgot to mention it before}
First I want to show that the steady state part z(x) satisfies the ODE d^2(z)/dx^2 = 1/D sin (Pi * x/L)
To do this I substitute u(x,t) = z(x) + v(x,t) in me original PDE and then since lim v(x,t) as t > inf = 0 we say that d^2(v) / dx^2 and dv / dt {these are partial derivatives} are equal to zero as t> inf so the steady part satisfies the ODE d^2(z)/dx^2 = 1/D * sin (Pi*x/L)
Then I am asked to obtain the boundary conditions for z(x) and solve for z(x).
Here as you said I integrate and obtain that z(x) = L^2/D*Pi^2 * sin(Pi*x/L) + c1*x + c2
Then I am a bit confused on how do I find boundary conditions for z(x) so I can deduce what c1 and what c2 is:
Basically I have to find two boundary conditions that have to do with z(....)=...... or z'(....)=....... {At this point you confused me about how did you find c1,c2 [You did some assumption from the beginning basically, but I am not supposed to make any assumptions by my own, so I proceeded solving the exercise with what I am given and with the given notation] }
After that I am asked to show that v(x,t) satisfies the equation dv/dt = D * d^2(v) / dx^2 {partial derivatives}
This I showed it by substituting that z(x) = L^2/D*Pi^2 * sin(Pi*x/L) + c1*x + c2 {using your constants c1 and c2, the result was deduced}
And finally I have to find the boundary and initial conditions for v(x,t)
So my questions as you saw is
1) how do I obtain the initial conditions for z(x) {by what I am given in the exercise and not by assuming anything by my own}
and
2)how do I obtain the initial conditions for v(x,t)
May you review this post if my thinking and my way was correct with what I was given and help me with my two questions?
Thanks again for your time!

Re: Diffusion equation
I have just been able to obtain the initial conditions for z(x) with the following logic, if someone can review it:
Since we know that u(0,t) = 0 and
u(L,t) = 1
Also u(x,t) = z(x) + v(x,t), but v(x,t) > o as t > infinity (the exercise told us we are able to assume that), so we end up with z(L) = 1 and z(0)=0
so I find c2 = 0 and c1 = 1/L (as Danny found with a different way)
So the final thing is to obtain initial conditions for v(x,t)
Given that u(0,t) = 0, u(L,t) = 1
u(x,o) = x/L
and z(0) = 0, z(L)=1 {as I found}
and using that u(x,t) = z(x) + v(x,t), by direct substitution I obtain the following initial conditions for v(x,t):
v(0,t) = 0
v(L,t)=0
v(x,0) =  (L^2/(Pi^2 * D) * sin(Pi*x/L))
If someone can review my work in the last two posts I would greatly appreciate it!