1
$\begingroup$

In a related question, the SolveDelayed->True option seemed to solve the problem. SolveDelayed is not a valid option in M10 (at least not the Student Edition). Any other suggestions?

{λ = 1, μ = 0.2, δ = 0.08, η = 0.9, β = 0.8, n = 2};
A = SparseArray[{{i_, j_} /; i < j -> η, {i_, j_} /; i > j -> β, {i_, i_} -> 1}, {n, n}];
b[i_, x_] := λ x[[i]];
d[i_, x_] := (μ + δ A[[i]].x) x[[i]];
H[x_, y_] := Sum[b[i, x] (Exp[y[[i]]] - 1) + d[i, x] (Exp[-y[[i]]] - 1), {i, n}];

sol = NDSolve[{
    0 == H[{x[1], x[2]}, D[U[x[1], x[2]], {{x[1], x[2]}, 1}]],
    U[0, x[2]] == 0,
    U[x[1], 0] == 0
   }, U, {x[1], 0, 10}, {x[2], 0, 10}]
$\endgroup$
  • $\begingroup$ According to a Wolfram Community post, SetDelayed is legal but deprecated. Indeed, the code runs for a while with this option included, even though it is red until the code runs. However, whether SetDelayed is True or False, the Kernel terminates. For True, Solve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. >> message appears. For False, nothing appears. Note that derivatives in this PDE appear in exponentials. $\endgroup$ – bbgodfrey Feb 7 '15 at 13:26
  • $\begingroup$ @bbgodfrey I think you meant SolveDelayed instead of SetDelayed. $\endgroup$ – Michael E2 Feb 7 '15 at 14:07
3
$\begingroup$

Apparently, the Kernel terminates, because it does not like x[1] and x[2] in this context. When I modify the code to

sol = NDSolveValue[{0 == H[{x1, x2}, D[U[x1, x2], {{x1, x2}, 1}]], 
   U[0, x2] == 0, U[x1, 0] == 0}, U, {x1, 0, 10}, {x2, 0, 10}]

it gives the same warning message,

NDSolveValue::ntdvdae: Cannot solve to find an explicit formula for the derivatives. NDSolve will try solving the system as differential-algebraic equations. >>

but the Kernel does not terminate. Instead, the code produces an InterpolatingFunction that is identically zero. Indeed, U = 0 satisfies H[{x1, x2}, {0, 0}] == 0 with homogeneous boundary conditions, so U = 0 is the correct answer.

Update

As pointed out by Michael E2 in a Comment below, Method -> {"EquationSimplification" -> "Residual"} eliminates the warning message.

$\endgroup$
  • $\begingroup$ I remember this issue of indexed variables arising somewhere else, but I can't find the right search terms. $\endgroup$ – Michael E2 Feb 7 '15 at 14:07
  • $\begingroup$ Why not point out Method -> {"EquationSimplification" -> "Residual"}, the solution suggested in the community post you linked to in your comment above? $\endgroup$ – Michael E2 Feb 7 '15 at 14:09
  • $\begingroup$ @MichaelE2 Not sure whether your comment was meant for me, but I acted on it by trying it and then editing my answer. Thanks. $\endgroup$ – bbgodfrey Feb 7 '15 at 14:24
  • $\begingroup$ Yes, the second comment was meant for you, and you're welcome! (+1 already.) The first was general. It would be nice to link the questions. $\endgroup$ – Michael E2 Feb 7 '15 at 14:34
  • $\begingroup$ Back to the drawing board on my boundary conditions, I suppose ... never do get those right. $\endgroup$ – Ian Feb 7 '15 at 14:56

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.