0
$\begingroup$

I have the following example, which is a proxy for the more complex problem I am trying to solve.(Apologies that the LaTeX is explicit, for some reason it trips the code formatting error on stackoverflow..)

$$
\dot{\Phi} = \Phi, \quad \Phi(0) = \mathbf{I} 
$$

where $\Phi$ is a square matrix, with identity initial condition. The analytical solution is an exponent for all the diagonal entries and zero for off-diagonal entries. Solving this in mathematica for $\Phi$ up to 10x10 behaves exactly as expected. However, for 11x11 and above, I get

DSolve::overdet: There are fewer dependent variables than equations, so the system is overdetermined

The 10 by 10 example runs in a second or so. My guess is there is something interesting happening when we get to 100 equations, but I can't tell what it is. If anyone knows why this is, or knows how to debug it, would be greatly appreciated. The code is below.

t = Symbol["t"];
phiMatrix = 
 Table[ToExpression["\[Phi]" <> ToString[i] <> ToString[j]][t], {i, 
 1, 15}, {j, 1, 15}];
nStates = 11;
phiSubMatrix = phiMatrix[[1 ;; nStates, 1 ;; nStates]];
eqsList = {};
Do[AppendTo[eqsList, 
 D[phiSubMatrix[[i, j]], t] == phiSubMatrix[[i, j]]], {i, 1, 
 nStates}, {j, 1, nStates}];
icList = {};
Do[AppendTo[
 icList, (phiSubMatrix[[i, j]] /. t -> 0) == 
 KroneckerDelta[i, j]], {i, 1, nStates}, {j, 1, nStates}];
phiVars = Flatten[phiSubMatrix];
Dimensions[eqsList]
Dimensions[icList]
Dimensions[phiVars]
solution = DSolve[Join[eqsList, icList], phiVars, t]
$\endgroup$
1
  • $\begingroup$ I don't know how to debug your issue, but as a general rule it's usually a lot easier to use matrix-valued functions when you can since NDSolve supports that: DSolve[{φ'[t] == φ[t], φ[0] == IdentityMatrix[11]}, φ[t] ∈ Matrices[{11, 11}], t] $\endgroup$ Commented Aug 21 at 14:59

1 Answer 1

1
$\begingroup$

Something funky with the variable naming. I fixed by using the code below (notice the "n" in between the indices). There might be something strange with the variable naming for higher numbers (perhaps I was inadvertently creating duplicates).

phiMatrix = 
 Table[ToExpression["\[Phi]" <> ToString[i] <> "n" <> ToString[j]][
 t], {i, 1, 15}, {j, 1, 15}];
answered Aug 21 at 15:12
$\endgroup$
1
  • 1
    $\begingroup$ Compare phiVars // Length and phiVars // DeleteDuplicates // Length. Or Select[PositionIndex[phiVars], Length[#] > 1 &] (11,1 vs. 1,11). $\endgroup$ Commented Aug 21 at 15:19

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.