0
$\begingroup$

I'm having the following issue that can not find a solution , by using this boundary condition

 u[0, t] == 1,
 v[0, t] == u[1, t],
 w[0, t] == v[1, t],
 z[0, t] == w[1, t]

that Mathematica does not understand, someone please help me!

s = NDSolve[
  {
   D[u[x, t], t] == -D[u[x, t], x] - 1 v[x, t] w[x, t] z[x, t],
   D[v[x, t], t] == -D[v[x, t], x] - 2 u[x, t] w[x, t] z[x, t],
   D[w[x, t], t] == -D[w[x, t], x] - 3 u[x, t] v[x, t] z[x, t],
   D[z[x, t], t] == -D[z[x, t], x] - 4 u[x, t] v[x, t] w[x, t],

   u[x, 0] == 1,
   v[x, 0] == 2,
   w[x, 0] == 3,
   z[x, 0] == 4,

   u[0, t] == 1,
   v[0, t] == u[1, t],
   w[0, t] == v[1, t],
   z[0, t] == w[1, t]
   },

  {u[x, t], v[x, t], w[x, t], z[x, t]},

  {x, 0, 1}, {t, 0, 1}]

I'm getting this error message :

NDSolve::bcedge: Boundary condition v[0,t]==u[1,t] is not specified on a single edge of the boundary of the computational domain. >>

I have already presented a similar problem here, but the reasoning suggested is not a good solution for my case.

What strategies do you know to treat this problem ? I appreciate any help...

$\endgroup$
4
  • $\begingroup$ not sure why the downvote. Anyway NDSolve is not so general that it can handle any sort of bc you can dream up, even if mathematically valid. In this case the pde's look to be fully decoupled, so solve first for u, then use that solution as a bc as you solve for v and so on. Alternately formulate as a single unknown on domain x,0,4 $\endgroup$
    – george2079
    Apr 27 '16 at 12:28
  • $\begingroup$ Thank you. But I need to solve all equations at once. $\endgroup$ Apr 27 '16 at 18:02
  • $\begingroup$ I'm afraid you will need to work out your own finite difference scheme. $\endgroup$
    – george2079
    Apr 27 '16 at 20:43
  • $\begingroup$ How you could do this, any suggestions? $\endgroup$ Apr 27 '16 at 20:46
1
$\begingroup$

As suggested by the Documentation Center, you can remove excess (last 3) conditions.

s = NDSolve[{D[u[x, t], t] == -D[u[x, t], x] - u[x, t], 
    D[v[x, t], t] == -D[v[x, t], x] - v[x, t], 
    D[w[x, t], t] == -D[w[x, t], x] - w[x, t], 
    D[z[x, t], t] == -D[z[x, t], x] - z[x, t],
    u[x, 0] == 1, v[x, 0] == 1, w[x, 0] == 1,
    z[x, 0] == 1, u[0, t] == 1},
  {u[x, t], v[x, t], w[x, t], z[x, t]}, {x, 0, 1}, {t, 0, 1}];

Plot3D[Evaluate[u[x, t] /. s[[1, 1]]], {x, 0, 1}, {t, 0, 1}]
Plot3D[Evaluate[v[x, t] /. s[[1, 2]]], {x, 0, 1}, {t, 0, 1}]
Plot3D[Evaluate[w[x, t] /. s[[1, 3]]], {x, 0, 1}, {t, 0, 1}]
Plot3D[Evaluate[z[x, t] /. s[[1, 4]]], {x, 0, 1}, {t, 0, 1}]

Will give you the solutions.

$\endgroup$
1
  • $\begingroup$ Thus the boundary conditions for the other variables are wrong because the ultilizados values ​​in the solution does not match the proposed problem . $\endgroup$ Apr 27 '16 at 18:02
0
$\begingroup$

A method to solve the original decoupled system :

s = NDSolve[{
   D[u[x, t], t] == -D[u[x, t], x] - u[x, t],
   u[x, 0] == 1,
   u[0, t] == 1}, {u[x, t]}, {x, 0, 4}, {t, 0, 1}]
v[x_, t_] = (u[x, t] /. s[[1, 1]]) /. x -> x + 1;
w[x_, t_] = (u[x, t] /. s[[1, 1]]) /. x -> x + 2;
z[x_, t_] = (u[x, t] /. s[[1, 1]]) /. x -> x + 3;
Row[{
  ContourPlot[u[x, t] /. s[[1, 1]], {x, 0, 1}, {t, 0, 1}],
  ContourPlot[v[x, t], {x, 0, 1}, {t, 0, 1}],
  ContourPlot[w[x, t], {x, 0, 1}, {t, 0, 1}],
  ContourPlot[z[x, t], {x, 0, 1}, {t, 0, 1}]}]

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you. But I need to solve all equations at once. The example it is simple , but the truth is that each variable has its own distinct equation among others. $\endgroup$ Apr 27 '16 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.