# Solving coupled pde

I am new to Mathematica and I want to solve this coupled pde I used this DSolve but it did not work. I am not sure what I did wrong. This is how I used DSolve Can you help me please ?

• Please add the code that you ran (rather than a screenshot) to the question so we can reproduce the problem. – Rohit Namjoshi Dec 18 '18 at 20:55

## 1 Answer

Use InputForm when providing input to the notebook and you will be less likely to make mistakes. Also, when posting to this site, convert any code to InputForm and copy and paste the code (as a code block) rather than a picture of the code.

Clear["Global*"]

eqns = {w D[c[x, t], t] + u D[c[x, t], x] -
v  D[c[x, t], {x, 2}] == - k c[x, t] s[x, t],
D[s[x, t], t] == -p k c[x, t] s[x, t]};

sol = DSolve[eqns, {c, s}, {x, t}]

(* {{c -> Function[{x, t}, -(1/(k p w))
2 C (u - 2 v C) (-1 +
Tanh[x C - (t C (u - 2 v C))/w + C])],
s -> Function[{x, t}, (
2 v C^2 (1 + Tanh[x C - (t C (u - 2 v C))/w + C])^2)/
k]}, {c ->
Function[{x, t}, -(1/(k p w))
2 C (u + 2 v C) (1 +
Tanh[x C - (t C (u + 2 v C))/w + C])],
s -> Function[{x, t}, (
2 v C^2 (-1 + Tanh[x C - (t C (u + 2 v C))/w + C])^2)/
k]}, {c ->
Function[{x, t}, (2 C Tanh[t C - (w x C)/u + C])/(k p)],
s -> Function[{x, t}, (1/(k u^2))
2 v w^2 C[
2]^2 (-1 + Tanh[t C - (w x C)/u + C]) (1 +
Tanh[t C - (w x C)/u + C])]}} *)


where the C[i] are arbitrary constants.

Verifying that the solutions satisfy the equations

eqns /. sol // Simplify

(* {{True, True}, {True, True}, {True, True}} *)

• thank you so much now if i want to add so me initial conditions, how can i do it c(0, t) = cd(t), for t in [0,T], c(L, t) = 0, for t in [0,T], c(x,0) = 0, for x in [0,L], s(x,0) = s0, for x in [0,L]. – Elyes Abidi Dec 18 '18 at 19:44
• Add them to the eqns. See the documentation for DSolve` – Bob Hanlon Dec 18 '18 at 19:46
• can you please show me how to plot them i need to see the graphe – Elyes Abidi Dec 18 '18 at 19:50
• Assign values to constants/parameters and see documentation for Plot3D. If you have questions, show the code for what you have tried, state what problems you are having, and what error messages you are receiving. – Bob Hanlon Dec 18 '18 at 20:47