janhardo

715 Reputation

12 Badges

11 years, 101 days

MaplePrimes Activity


These are replies submitted by janhardo

Yes, you can choose initial conditions arbitrarily — but not randomly if your goal is to analyze specific behavior.

But Beware:

  • Choosing ICs too far from equilibrium can lead to misleading visuals, especially if you're interested in local behavior near a critical point.

  • In linear systems, every IC leads to a unique trajectory because the system is deterministic and satisfies the existence and uniqueness theorem.

In this example, it are 4 points of a square around the critical point.

Adding more points and lines,circle 


 

protected names O and I   , that's why using O_ , I_   

with(plots); alpha := (1/4)*Pi; a := 2^alpha*exp(I*alpha); b := 2^(alpha+1)*exp(I*(alpha+(1/2)*Pi)); h := 1/(1/a+1/b); O_ := 0; A := a; B := b; H := h; I_ := (O_+H)*(1/2); J := (H+B)*(1/2); toCoords := proc (z) options operator, arrow; [Re(evalf(z)), Im(evalf(z))] end proc; pO := toCoords(O_); pA := toCoords(A); pB := toCoords(B); pH := toCoords(H); pI := toCoords(I_); pJ := toCoords(J); triangle := plot([pO, pA, pB, pO], color = blue, thickness = 2); points := pointplot([pO, pA, pB, pH, pI, pJ], symbol = solidcircle, color = red, symbolsize = 15); xaxis := textplot([[2, -.3, "Re(z)"]], font = [TIMES, BOLD, 12]); yaxis := textplot([[-.3, 2, "Im(z)"]], font = [TIMES, BOLD, 12]); makeLabel := proc (name, coords) textplot([coords[1]+0.5e-1, coords[2], cat(name, "(", sprintf("%.2f", coords[1]), ",", sprintf("%.2f", coords[2]), ")")]) end proc; labelO := makeLabel("O", pO); labelA := makeLabel("A", pA); labelB := makeLabel("B", pB); labelH := makeLabel("H", pH); labelI := makeLabel("I", pI); labelJ := makeLabel("J", pJ); display([triangle, points, xaxis, yaxis, labelO, labelA, labelB, labelH, labelI, labelJ], scaling = constrained, axes = normal, title = "Extended triangle OAB with points H, I, J", labels = ["Re(z)", "Im(z)"])

 

NULL


 

Download complexe_plotdriehoek_en_cirkel10-6-2025mprimes.mw

@jalal 
Hi,
a example to start with 

A := 1 + I;
B := 4 + 2*I;
C := 2 + 5*I;
punt := z -> [Re(z), Im(z)];
driehoek := plot([punt(A), punt(B), punt(C), punt(A)], color = blue, thickness = 2);
punten := pointplot([punt(A), punt(B), punt(C)], symbol = solidcircle, color = red, symbolsize = 15);
display([driehoek, punten], scaling = constrained, title = "Triangle in complex plane", axes = boxed);

It seems that the array notation is not suited for pattern matching in Maple ?

@jalal 
More intuiative with complex numbers ...

corrected code

restart;
with(DEtools);
with(plots);
with(LinearAlgebra);
f := y -> y^2*(1 - y^2);
sys := [diff(x(t), t) = -x(t), diff(y(t), t) = f(y(t))];
trajectories := [[x(0) = 1, y(0) = 1.5], [x(0) = -1, y(0) = 0.5], [x(0) = 0.5, y(0) = -1.5]];
phase_plot := DEplot(sys, [x(t), y(t)], t = 0 .. 10, trajectories, x = -2 .. 2, y = -2 .. 2, arrows = medium, dirfield = [20, 20], linecolor = blue, title = "Phase Portrait with Equilibrium Points");
equilibrium_points := pointplot([[0, 0], [0, 1], [0, -1]], symbol = solidcircle, color = black, symbolsize = 15);
display([phase_plot, equilibrium_points], scaling = constrained);
print("\n### DETAILED STABILITY ANALYSIS ###");
F := [-x, -y^4 + y^2];
J := Matrix([[diff(F[1], x), diff(F[1], y)], [diff(F[2], x), diff(F[2], y)]]);
print("\n1. Analysis for (0,0):");
J0 := eval(J, {x = 0, y = 0});
print("Jacobian:", J0);
print("Eigenvalues:", Eigenvalues(J0));
print("Conclusion:");
print("   - Eigenvalues: -1 and 0");
print("   - Non-hyperbolic point");
print("   - dy/dt ≈ y^2 > 0 for y ≈ 0");
print("   - ⇒ (0,0) is UNSTABLE");
print("\n2. Analysis for (0,1):");
J1 := eval(J, {x = 0, y = 1});
print("Jacobian:", J1);
print("Eigenvalues:", Eigenvalues(J1));
print("Conclusion:");
print("   - Eigenvalues: -1 and -2");
print("   - Both negative ⇒ STABLE NODE");
print("   - All nearby trajectories converge to this point");
print("\n3. Analysis for (0,-1):");
Jm1 := eval(J, {x = 0, y = -1});
print("Jacobian:", Jm1);
print("Eigenvalues:", Eigenvalues(Jm1));
print("Conclusion:");
print("   - Eigenvalues: -1 and +2");
print("   - Mixed eigenvalues ⇒ SADDLE POINT");
print("   - Stable in x-direction, unstable in y-direction");
print("   - ⇒ (0,-1) is UNSTABLE");
print("\n### VISUAL INTERPRETATION ###");
print("1. (0,0): Arrows point away in y-direction - unstable");
print("2. (0,1): All arrows point toward this point - stable");
print("3. (0,-1): Arrows approach in x-direction but diverge in y-direction - saddle point");
print("\n### SYSTEM BEHAVIOR SUMMARY ###");
print("The system exhibits:");
print("- One stable equilibrium at (0,1)");
print("- One unstable equilibrium at (0,0)");
print("- One saddle point at (0,-1)");
print("- Bistability between y=1 and y=-1 states");
print("- All x-values decay to 0 over time");
print("- y-direction determines long-term behavior");

Never trust ai , because node ( 0,-1) is not stable , when i examine it 

@salim-barzani 
You need help from a specialist , i don't know what you are after for.? 

@salim-barzani 

 

restart;
expr := abs(U[i](x, t))^n*diff(U[i](x, t), x);
expr_rewritten := subs(abs(U[i](x, t))^n = (U[i](x, t)*conjugate(U[i](x, t)))^(n/2), expr);
print(expr_rewritten);

"in here i want to seperate abs(U[i](x,t))^n=U[i](x,t)^n/2*conjugate(U[i](x,t))"   
I am guessing here, no direction where you are after for?

 


=======================================================================






 

 

 

 

@salim-barzani 

It is not yet a definitive code that can handle all non-linear pdes .
The procedure code must be modified for certain types of pde 
So specify the pde ...

5 6 7 8 9 10 11 Last Page 7 of 77