I have a couple of PDE (time and space/length) that are correctly managed by NDSolve, but to which I’m adding an ODE on which the acc
“accumulates”, through time, a “value” coming from one of the boundaries of the PDE (the b*h[t, le]*u[t, le]
).
On my following example, the accumulation is not linked, and so acc
could be calculated afterwards. But the purpose is to use the acc[t]
value as a definition of one of the boundary of h
. Once the errors are gone, I'll define something like h[t, le]==acc/100
instead of the current fixed value boundary.
I’ve tried a lot of assorted stuff, but NDSolve keeps giving errors on the amount of parameters of the ODE, etc, as shown below.
I’m now thinking on managing the “accumulation” with the EvaluationMonitoring
, but it doesn’t sound right...
a = 10;
le = 62;
g = 9.8;
tf = 100;
b = 3.4;
r = 5.86/le;
NDSolve[{
b*u[t, x]*Derivative[0, 1][h][t, x] +
b*h[t, x]*Derivative[0, 1][u][t, x] +
b*Derivative[1, 0][h][t, x] == r,
(r*u[t, x])/(b*g*h[t, x]) + (Abs[u[t, x]]*(b + 2*h[t, x])^(4/3)*
u[t, x])/(a^2*(b*h[t, x])^(4/3)) +
Derivative[0, 1][h][t, x] + (u[t, x]*Derivative[0, 1][u][t, x])/
g + Derivative[1, 0][u][t, x]/g == 0,
Derivative[1][acc][t] == b*h[t, le]*u[t, le],
h[0, x] == 1,
u[0, x] == 0,
h[t, le] == 1,
u[t, 0] == 0,
acc[0] == 0
},
{u, h, acc},
{t, 0, tf}, {x, 0, le}
];
(*NDSolve::ndode: Input is not an ordinary differential equation. >>*)
EDIT
I came across a problem with the naming of the variable acc
. But since it is probably related with a different question, I wrote my problem here
NDSolve::delpde: Delay partial differential equations are not currently supported by NDSolve. >>
. Since there is no "delayed" problem, I imagine that there's a different way do define it. I've done:Derivative[1, 0][acc][t, x] == b*h[t, le]*u[t, le], acc[0, x] == 0
$\endgroup$