# Solving a coupled PDE and ODE

1. Jun 29, 2013

### thereisnospoo

I am trying to solve an ODE and PDE and I am having problems coming up with a method for doing so.

The PDE is:

k1*(dC/dt) = k2*(dC/dx)

But I have an ODE that is an expression for dC/dt:

dC/dt = k3*C

Where k1,k2 and k3 are constants.

I planned to use the method of lines to get a solution where C changes with t and x. However, I am having problems dealing with the dC/dt ODE expression. I can use method of lines only on the 1st equation, but that would not take the relationship of the second equation into consideration. If I plug the ODE equation into the PDE, then I will lose the "time" variable.

Anyone have any suggestions or tips?

2. Jun 29, 2013

### SteamKing

Staff Emeritus
The ODE looks like a separable equation. Can't you use its solution and substitute into the first equation?

3. Jun 29, 2013

### Marioeden

I'm assuming for your PDE you mean both as partial derivatives and for the ODE you mean total derivative?

In which case (writing D for total derivative and d for partial),

the ODE gives you: DC/Dt = dC/dt + [dC/dx][dx/dt]

Further, you know dC/dx in terms of dC/dt from the PDE, and you can plug that in to get:

[1 + k1/k2][dC/dt] = k3*C

and this is a PDE you can solve :)

(Also, there's the special case when k2 is zero!)

4. Jun 29, 2013

### thereisnospoo

I actually meant that the 2nd equation is a partial derivative as well, which is why I think I'm running into my problem. do you have any insight into what I can do next?

5. Jun 30, 2013

### Marioeden

Oh, if the second one is partial as well then substitute it into the first one.

So assuming k2 is non-zero, you have dC/dx = [k1*k3/k2]*C

The solution to this is the standard exponential as in the ODE case, only your constant is now a function of time.

Then just plug this back into the original equations to check for consistency

6. Jun 30, 2013

### dm164

There seems to be some confusion with ODE and PDE. Are you trying to solve for C? If you just plug the second eqn. one into the first you won't get the most general solution.

If so, since you are taking the partial against x and t you can assume the function is C(x,t).
Which case gives this relation:

dC = $\frac{∂C}{∂x}$dx + $\frac{∂C}{∂t}$dt

Now, you can plug in those two equations, and solve like an ODE to get the answer. And when you integrate don't forget a constant!