1
$\begingroup$

I am here again to see if some one can help me.

This time, I have problem to solve, computationally and plot the phase portrait of a nonlinear ode system (The Duffing Equation with just the spring nonlinear).

This problem was showed in Wojciech Wawrzynski (2021) paper. The nondimensional original equation is:

enter image description here

The sequence is to turn this 2nd order ODE in a 1st order ODE system, as showed here (the forced oscillatory therm was considered zero in my analysis):

enter image description here

So, I had to determine the stability points and, after that, calculate the eigenvalues for each of these points. I did determined the stability point manually, but, when I tried to did that using Wolfram Mathematica, the program was not unable to gave me the results. I have searched in forums and them was shown to me the Method command and the ParametricNDSolveValue, but, unfortunately, this continue not to show the results that I expected.

I will paste not the original code, but only the parts that show the results of stability points, the jacobian matrix of these points, the eigenvalues os these points and, the attempts to evaluate computationaly and the grapichs (phase portraits).

I hope you all have a nice day/afternoon/evening.

$Assumptions = \[Epsilon] > 0 && \[Eta] > 0;
MatrixGeral = {{0, 
    1}, {-1 - 3 y^2 \[Epsilon], -2 \[Eta]}}(*General matrix*);

MatrixZeroZero = {{0, 1}, {-1 - 3 y^2 \[Epsilon], -2 \[Eta]}} /. {y ->
      0}(*point (0,0)*);

Eig00 = Eigenvalues[{{0, 1}, {-1, -2 \[Eta]}}];

MatrizNegativaZero = {{0, 
     1}, {-1 - 
      3 y^2 \[Epsilon], -2 \[Eta]}} /. {y -> -I/Sqrt[\[Epsilon]]}(*Point (-I/Sqrt[\[Epsilon]],0)*);}(*Point (-(\[ImaginaryI] \
/Sqrt[\[Epsilon]]),0)*);

EigN0 = Eigenvalues[{{0, 1}, {2, -2 \[Eta]}}];

MatrizPositivaZero = {{0, 
     1}, {-1 - 
      3 y^2 \[Epsilon], -2 \[Eta]}} /. {y -> I/Sqrt[\[Epsilon]]}(*Point (I/Sqrt[\[Epsilon]],0)*);


EigP0 = Eigenvalues[{{0, 1}, {2, -2 \[Eta]}}];

StreamPlot[{z, (-y - (y^3*\[Epsilon]) - (2*z*\[Eta]))}, {y, -4, 
   4}, {z, -3, 3}, StreamColorFunction -> "Rainbow"];
Manipulate[
  Show[splot, 
   ParametricPlot[
    Evaluate[
     First[{y[t], z[t]} /. 
       NDSolve[{y'[t] == z[t], 
         z'[t] == -y[t] - \[Epsilon]*y[t]^3 - 2*z[t]*\[Eta] , 
         Thread[{y[0], z[0]} == point]}, {y, z}, {t, 0, T}]]], {t, 0, 
     T}, PlotStyle -> Red]], {{T, 20}, 1, 100}, {{point, {0, 0}}, 
   Locator}, SaveDefinitions -> True];

NDSolve[{y'[t] == z[t], 
   z'[t] == -y[t] - \[Epsilon]*y[t]^3 - 2*z[t]*\[Eta], {y'[0] == 0, 
    z'[0] == 0}}, {y[t], z[t]}, {t, 0, 8}, 
  Method -> {"EquationSimplification" -> "Residual"}];

NDSolve[{y'[t] == z[t], 
   z'[t] == -y[t] - \[Epsilon]*y[t]^3 - 2*z[t]*\[Eta], {y'[0] == 0, 
    z'[0] == 0}}, {y[t], z[t]}, {t, 0, 8}, 
  Method -> {"EquationSimplification" -> "Solve"}];

ParametricNDSolveValue[{y'[t] == z[t], 
   z'[t] == -y[t] - \[Epsilon]*y[t]^3 - 2*z[t]*\[Eta], {y'[0] == 0, 
    z'[0] == 0, z[0] == 0}}, {y, z}, {t, 0, 1}, {\[Eta], \[Epsilon]}];

Manipulate[
  Plot[Evaluate[#[t] & /@ sol[\[Eta], \[Epsilon]]], {t, 0, 200}, 
   PlotLegends -> {y, z}], {{\[Eta], 1}, 0, 100}, {{\[Epsilon], 1}, 0,
    100}];    

 
$\endgroup$
5
  • $\begingroup$ Convert your cells to InputForm prior to copy and paste into this forum. Include all code required to reproduce your results. Do not include In and Out in the cells. $\endgroup$
    – Bob Hanlon
    Oct 25, 2023 at 15:18
  • $\begingroup$ The previous commenter makes that comment because we want to be able to directly copy and paste your code into our own copies of Mathematica without having to go in and change things by hand. That makes it easier for us to run it, see what's wrong, and help you, so please edit your post! $\endgroup$
    – march
    Oct 25, 2023 at 15:40
  • $\begingroup$ The first equation is non-autonomous due to the forcing on the right hand side, but afterwards that term is gone. Could you clarify which equation you need to analyze? $\endgroup$
    – Chris K
    Oct 25, 2023 at 16:08
  • $\begingroup$ In second equation pasted in my question, was considered that the cos(wot) is zero (non forced oscillation). I just pasted to show the original source of the problem. Thank you. $\endgroup$ Oct 25, 2023 at 20:57
  • 1
    $\begingroup$ "Include all code required to reproduce your results." We cannot execute your code sucessfully because there are undefined parameters, e.g., what are the values for \[Epsilon] and \[Eta]? $\endgroup$
    – Bob Hanlon
    Oct 26, 2023 at 1:20

0

Your Answer

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