1
$\begingroup$

I'm using Solve[] to find the solutions to a system of equations, then checking their stability in a Hessian using PositiveDefiniteMatrixQ[] to see how many of these solutions are stable. RegionPlot[] comes in handy to plot the number of stable solutions in terms of the parameters.

Has worked nicely for another set of equations - as an example

An example of the type of plot I want that has worked worked perfectly for another set of equations.

Error Output

{{7 System`ReduceDump`SolveParam[Subscript[\[Kappa], xy0]] + 
   7 System`ReduceDump`SolveParam[Subscript[\[Kappa], 
     xyF]] + (-7 + 
      100 System`ReduceDump`SolveParam[Subscript[\[Kappa], 
        xy0]]^2) System`ReduceDump`X$27813[1] - 
   100 System`ReduceDump`X$27813[1]^3, System`ReduceDump`X$27813[3], 
  System`ReduceDump`X$27813[
   2]}, {{7 System`ReduceDump`SolveParam[Subscript[\[Kappa], xy0]] + 
    7 System`ReduceDump`SolveParam[Subscript[\[Kappa], xyF]] - 
    7 System`ReduceDump`X$27813[1] + 
    100 System`ReduceDump`SolveParam[Subscript[\[Kappa], 
      xy0]]^2 System`ReduceDump`X$27813[1] - 
    100 System`ReduceDump`X$27813[1]^3, 1, 
   System`ReduceDump`X$27813[1]}, {System`ReduceDump`X$27813[3], 1, 
   System`ReduceDump`X$27813[3]}, {System`ReduceDump`X$27813[2], 1, 
   System`ReduceDump`X$27813[2]}}, {}}

It seems to suggest this is an error in the evaluation but I've used ContourPlot[] as alternative to plotting and the output was fine. So I'm unsure whether the Solve[] and PositiveDefiniteMatrixQ[] parts are where the issue is arising - just very messy in comparison to the previous plot which is why I want to try RegionPlot[].

enter image description here

I've also tried setting attributes like MaxRecursion -> 0, PlotPoints and the range of the parameters to small values to limit computational cost but this doesn't change the output. Anyone come across this before?

Code

U [\[Phi]_:\[Phi],\[Beta]_:\[Beta],\[Alpha]_:\[Alpha],\[Nu]_:\[Nu]]:= \[Phi]/2 (Subscript[\[Kappa], x] Subscript[\[Kappa], y]-Subscript[\[Kappa], xy]^2-Subscript[\[Kappa], x0] Subscript[\[Kappa], y0]+Subscript[\[Kappa], xy0]^2)^2+1/2 ((Subscript[\[Kappa], x]-Subscript[\[Kappa], x0]-Subscript[\[Kappa], xF])^2+2\[Nu](Subscript[\[Kappa], x]-Subscript[\[Kappa], x0]-Subscript[\[Kappa], xF])(Subscript[\[Kappa], y]-Subscript[\[Kappa], y0]-Subscript[\[Kappa], yF])+\[Beta] (Subscript[\[Kappa], y]-Subscript[\[Kappa], y0]-Subscript[\[Kappa], yF])^2+4\[Alpha] (Subscript[\[Kappa], xy]-Subscript[\[Kappa], xy0]-Subscript[\[Kappa], xyF])^2);

M[U_]:= {{\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(\[Kappa]\), \(x\)], 
\*SubscriptBox[\(\[Kappa]\), \(x\)]\)]U\),\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(\[Kappa]\), \(x\)], 
\*SubscriptBox[\(\[Kappa]\), \(y\)]\)]U\),\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(\[Kappa]\), \(x\)], 
\*SubscriptBox[\(\[Kappa]\), \(xy\)]\)]U\)},{\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(\[Kappa]\), \(y\)], 
\*SubscriptBox[\(\[Kappa]\), \(x\)]\)]U\),\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(\[Kappa]\), \(y\)], 
\*SubscriptBox[\(\[Kappa]\), \(y\)]\)]U\),\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(\[Kappa]\), \(y\)], 
\*SubscriptBox[\(\[Kappa]\), \(xy\)]\)]U\)},{\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(\[Kappa]\), \(xy\)], 
\*SubscriptBox[\(\[Kappa]\), \(x\)]\)]U\),\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(\[Kappa]\), \(xy\)], 
\*SubscriptBox[\(\[Kappa]\), \(y\)]\)]U\),\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(\[Kappa]\), \(xy\)], 
\*SubscriptBox[\(\[Kappa]\), \(xy\)]\)]U\)}}; 

GoverningEquations[U_]:= D[U==0,#]&/@{Subscript[\[Kappa], x],Subscript[\[Kappa], y],Subscript[\[Kappa], xy]};

regionplotfunction[U_] := 
 RegionPlot[
  Length[Cases[
     Cases[Solve[
       GoverningEquations[
        U /. {Subscript[\[Kappa], xyF] -> e, 
          Subscript[\[Kappa], xy0] -> f}], {Subscript[\[Kappa], x], 
        Subscript[\[Kappa], y], Subscript[\[Kappa], 
        xy]}], {_ -> a_, _ -> b_, _ -> c_} /; {a, b, c} \[Element] 
        Reals], {_ -> a_, _ -> b_, _ -> c_} /; 
      TrueQ[PositiveDefiniteMatrixQ[
        M[U /. {Subscript[\[Kappa], xyF] -> e, 
            Subscript[\[Kappa], xy0] -> f}] /. {Subscript[\[Kappa], 
           x] -> a, Subscript[\[Kappa], y] -> b, 
          Subscript[\[Kappa], xy] -> c}]]]] > 1, {e, -5, 5}, {f, -5, 
   5}]

To run, I define beta, alpha, phi and nu, typically

\[Beta] = 2; \[Phi] = 10; \[Nu] = 0.3; \[Alpha] = 0.35;

And then run the command regionplotfunction[U[]]

$\endgroup$
4
  • $\begingroup$ Crossposted here. $\endgroup$ – Rohit Namjoshi Aug 20 '20 at 13:40
  • 1
    $\begingroup$ If you provide code so that we can reproduce the problem, people may be willing to dig a bit to try to figure out a workaround. $\endgroup$ – C. E. Aug 21 '20 at 14:46
  • $\begingroup$ Putting this on hold until the OP edits the question to include code. $\endgroup$ – J. M.'s ennui Aug 24 '20 at 6:08
  • $\begingroup$ Hi @J.M.'sdiscontentment - I've added code - how do I unhold the question? $\endgroup$ – Barnacle Aug 24 '20 at 10:07

Your Answer

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

Browse other questions tagged or ask your own question.