1

I am trying to use Mathematica 10 to solve a system of partial differential equations but I could not. This system has an exact solution and my question is: How do I solve it exactly and numerically if possible?

\begin{align*} \frac{\partial u}{\partial t}-\frac{\partial v}{\partial x}+u+v &=(1+t)x+(x-1)t^{2}\\ \frac{\partial v}{\partial t}-\frac{\partial u}{\partial x}+u+v &=(2x-1)t+(1+t)x\,t\\ \text{The constraints are:} \\ u(x,0)&=u(0,t)=v(x,0)=v(0,t)=0 \end{align*} The exact solution to this problem is:

$u(x,t)=x\,t$, and $v(x,t)=x\,t^2$.

Thank you so much and I am looking forward to hearing from you.

bobbym
  • 2,628
  • 2
  • 15
  • 20
A. Alali
  • 19
  • 3

2 Answers2

1

Writing:

pde1 = D[u[x, t], t] - D[v[x, t], x] + u[x, t] + v[x, t] == (1 + t) x + (x - 1) t^2;
pde2 = D[v[x, t], t] - D[u[x, t], x] + u[x, t] + v[x, t] == (1 + t) x t + (2 x - 1) t;
constrains = u[x, 0] == u[0, t] == v[x, 0] == v[0, t] == 0;
domain = ImplicitRegion[0 <= x <= 1 && 0 <= t <= 1, {x, t}];

sol = NDSolve[{pde1, pde2, constrains}, {u[x, t], v[x, t]}, {x, t} \[Element] domain];

f1 = Evaluate[u[x, t] /. sol];
f2 = Evaluate[v[x, t] /. sol];
Plot3D[{f1, f2}, {x, t} \[Element] domain, AxesLabel -> {x, t, z}]

I get:

enter image description here

that is the solution of the equation system considered.

Unfortunately, if he later writes:

DSolve[{pde1, pde2, constrains}, {u[x, t], v[x, t]}, {x, t}]

MMA returns the same system, effectively raising the white flag.

πρόσεχε
  • 4,452
  • 1
  • 12
  • 28
  • I really do feel grateful for your help and I have compared your solution with exact one and it sounds match each other. This is the numerical one and how can I get the exact solution by using Mathematica?, please. – A. Alali Mar 11 '17 at 19:20
1

The analytic solution can be found by Laplace transform, I'll use pdeSolveWithLaplaceTransform for the task:

pde1 = D[u[x, t], t] - D[v[x, t], x] + u[x, t] + v[x, t] == (1 + t) x + (x - 1) t^2;
pde2 = D[v[x, t], t] - D[u[x, t], x] + u[x, t] + v[x, t] == (1 + t) x t + (2 x - 1) t;
ic = {u[x, 0] == 0, v[x, 0] == 0};
bc = {u[0, t] == 0, v[0, t] == 0};

(* Definition of pdeSolveWithLaplaceTransform isn't included here,
   please find it in the link above. *)    
pdeSolveWithLaplaceTransform[{pde1, pde2, bc}, ic, {u[x, t], v[x, t]}, t, x]
(* {t x, t^2 x} *)
xzczd
  • 65,995
  • 9
  • 163
  • 468