janhardo

695 Reputation

12 Badges

11 years, 39 days

MaplePrimes Activity


These are answers submitted by janhardo

restart;
with(DEtools):

# Step 1: Define the nonlinear ODE in Q(zeta)
ode := (diff(Q(zeta), zeta))^2 - r^2*Q(zeta)^2*(a - b*Q(zeta) - l*Q(zeta)^2) = 0;
printf("Step 1: Define the nonlinear ODE involving Q(zeta).\n");

# Step 2: Apply substitution Q = 1/u to transform the ODE
ode_u := simplify(eval(ode, Q(zeta) = 1/u(zeta)) * u(zeta)^4);
printf("Step 2: Substitute Q = 1/u to transform the ODE into a simpler rational form.\n");

# Step 3: Solve the transformed ODE for u(zeta)
u_sol := dsolve(ode_u, u(zeta));
printf("Step 3: Solve the transformed ODE in terms of u(zeta).\n");

# Step 4: Choose the specific solution involving tanh and revert back to Q(zeta)
u_specific := b/(2*a) + sqrt(4*a*l + b^2)/(2*a)*tanh(r*sqrt(a)*zeta/2);
Q_sol := 1/u_specific;
printf("Step 4: Choose the specific solution using tanh and convert back to Q(zeta).\n");

# Step 5: Define the exponential form of Q(zeta) as shown in the image
Q_exp := 4*a/((4*a*l + b^2)*exp(r*sqrt(a)*zeta) - exp(-r*sqrt(a)*zeta) + 2*b);
printf("Step 5: Define the exponential expression for Q(zeta).\n");

# Verify equivalence of hyperbolic and exponential forms
verify_exp := simplify(Q_sol - Q_exp);
printf("Step 6: Verify if the expression using tanh equals the exponential form. Difference = %a\n", verify_exp);

# Step 6: Define the hyperbolic version (sech² and tanh form) of the solution
Q_hyp := a*b*sech(r*sqrt(a)*zeta/2)^2/(b^2 + a*l*(1 - tanh(r*sqrt(a)*zeta/2))^2);
printf("Step 7: Define the hyperbolic solution (sech²/tanh form).\n");

# Check equivalence with exponential form
verify_hyp := simplify(Q_exp - Q_hyp);
printf("Step 8: Verify if exponential form equals the hyperbolic form. Difference = %a\n", verify_hyp);

# Step 9: Validate that both expressions satisfy the original ODE
ode_check_exp := simplify(eval(ode, Q = unapply(Q_exp, zeta)));
ode_check_hyp := simplify(eval(ode, Q = unapply(Q_hyp, zeta)));
printf("Step 9: Substitute Q_exp into ODE → Result = %a\n", ode_check_exp);
printf("Step 10: Substitute Q_hyp into ODE → Result = %a\n", ode_check_hyp);

?

 

# --------------------------------------
# 🚧 Fix to remove the extra U'(xi) term
# --------------------------------------

# This is the condition needed to remove the extra real part involving dU/dxi:
FixCond := 3*delta[3]*(b[1]*d[1]^2 + b[2]*d[2]^2 + b[3]*d[3]^2)
           - 2*delta[1]*(b[1]*d[1] + b[2]*d[2] + b[3]*d[3])
           - b[4];

# Set this condition to zero to eliminate the extra U'(xi) term
FixCondSol := solve(FixCond = 0, b[4]);

# Substitute this condition directly back into your main reduced ODE
FixedODE := subs(b[4] = FixCondSol, Q);

# ✅ Now continue analysis with FixedODE instead of Q

@Paras31 
look promising,, 

CORRECT ?

restart;
with(PDEtools):
with(LinearAlgebra):
with(SolveTools):
undeclare(prime):
alias(F=F(x,y,z,t), G=G(x,y,z,t)):

ND := proc(F, G, U)
  local v, w, f, g, a, i, newv;
  v := [op(F)];
  newv := [];
  for i from 1 to nops(v) do
    if v[i] in U then
      newv := [op(newv), -v[i]];
    else
      newv := [op(newv), v[i]];
    end if;
  end do;
  f := op(0, F);
  g := op(0, G);
  a := diff(f(op(newv))*g(op(v)), U);
  convert(subs(newv=~v, a), diff);
end proc:

 

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

(1)

ND(sin(x)*cos(y)*exp(z-t), cos(x)*sin(y)*exp(z+t), [x,y,z,t]);

16*sin(x)*cos(y)*(exp(z-t))^2*cos(x)*sin(y)

(2)

 

ND := proc(F, G, U)
  local v, w, f, g, a, i, newv, result;
  
  v := [op(F)];     # Haal variabelenlijst uit F
  newv := [];       # Maak lege lijst
  
  for i from 1 to nops(v) do
    if v[i] in U then
      newv := [op(newv), -v[i]];  # Spiegelen
    else
      newv := [op(newv), v[i]];   # Anders normaal houden
    end if;
  end do;
  
  f := op(0, F);    # Functienaam F
  g := op(0, G);    # Functienaam G
  
  a := diff(f(op(newv)) * g(op(v)), U);  # Differentieer aangepast product
  result := convert(subs(newv=~v, a), diff);  # Zet gespiegelde terug
  
  return simplify(result);  # >>> AUTOMATISCH VEREENVOUDIGEN! <<<
end proc:

ND(sin(x)*cos(y)*exp(z-t), cos(x)*sin(y)*exp(z+t), [x,y,z,t]);

4*sin(2*y)*sin(2*x)*exp(2*z-2*t)

(3)

ND(F, G, [x]);
ND(F, G, [t]);

-(diff(F, x))*G+F*(diff(G, x))

 

-(diff(F, t))*G+F*(diff(G, t))

(4)

ND(F(x,y,z,t), G(x,y,z,t), [x]);
ND(F(x,y,z,t), G(x,y,z,t), [y]);
ND(F(x,y,z,t), G(x,y,z,t), [z]);
ND(F(x,y,z,t), G(x,y,z,t), [t]);
ND(F(x,y,z,t), G(x,y,z,t), [x,y]);
ND(F(x,y,z,t), G(x,y,z,t), [x,y,z]);
ND(F(x,y,z,t), G(x,y,z,t), [x$2, y, z, t]);

-(diff(F(x, y, z, t), x))*G(x, y, z, t)+F(x, y, z, t)*(diff(G(x, y, z, t), x))

 

-(diff(F(x, y, z, t), y))*G(x, y, z, t)+F(x, y, z, t)*(diff(G(x, y, z, t), y))

 

-(diff(F(x, y, z, t), z))*G(x, y, z, t)+F(x, y, z, t)*(diff(G(x, y, z, t), z))

 

-(diff(F(x, y, z, t), t))*G(x, y, z, t)+F(x, y, z, t)*(diff(G(x, y, z, t), t))

 

(diff(diff(F(x, y, z, t), x), y))*G(x, y, z, t)-(diff(F(x, y, z, t), x))*(diff(G(x, y, z, t), y))-(diff(F(x, y, z, t), y))*(diff(G(x, y, z, t), x))+F(x, y, z, t)*(diff(diff(G(x, y, z, t), x), y))

 

-(diff(diff(diff(F(x, y, z, t), x), y), z))*G(x, y, z, t)+(diff(diff(F(x, y, z, t), x), y))*(diff(G(x, y, z, t), z))+(diff(diff(F(x, y, z, t), x), z))*(diff(G(x, y, z, t), y))-(diff(F(x, y, z, t), x))*(diff(diff(G(x, y, z, t), y), z))+(diff(diff(F(x, y, z, t), y), z))*(diff(G(x, y, z, t), x))-(diff(F(x, y, z, t), y))*(diff(diff(G(x, y, z, t), x), z))-(diff(F(x, y, z, t), z))*(diff(diff(G(x, y, z, t), x), y))+F(x, y, z, t)*(diff(diff(diff(G(x, y, z, t), x), y), z))

 

-(diff(diff(diff(diff(diff(F(x, y, z, t), t), x), x), y), z))*G(x, y, z, t)+(diff(diff(diff(diff(F(x, y, z, t), x), x), y), z))*(diff(G(x, y, z, t), t))+(diff(diff(diff(diff(F(x, y, z, t), t), x), x), y))*(diff(G(x, y, z, t), z))-(diff(diff(diff(F(x, y, z, t), x), x), y))*(diff(diff(G(x, y, z, t), t), z))+(diff(diff(diff(diff(F(x, y, z, t), t), x), x), z))*(diff(G(x, y, z, t), y))-(diff(diff(diff(F(x, y, z, t), x), x), z))*(diff(diff(G(x, y, z, t), t), y))-(diff(diff(diff(F(x, y, z, t), t), x), x))*(diff(diff(G(x, y, z, t), y), z))+(diff(diff(F(x, y, z, t), x), x))*(diff(diff(diff(G(x, y, z, t), t), y), z))+2*(diff(diff(diff(diff(F(x, y, z, t), t), x), y), z))*(diff(G(x, y, z, t), x))-2*(diff(diff(diff(F(x, y, z, t), x), y), z))*(diff(diff(G(x, y, z, t), t), x))-2*(diff(diff(diff(F(x, y, z, t), t), x), y))*(diff(diff(G(x, y, z, t), x), z))+2*(diff(diff(F(x, y, z, t), x), y))*(diff(diff(diff(G(x, y, z, t), t), x), z))-2*(diff(diff(diff(F(x, y, z, t), t), x), z))*(diff(diff(G(x, y, z, t), x), y))+2*(diff(diff(F(x, y, z, t), x), z))*(diff(diff(diff(G(x, y, z, t), t), x), y))+2*(diff(diff(F(x, y, z, t), t), x))*(diff(diff(diff(G(x, y, z, t), x), y), z))-2*(diff(F(x, y, z, t), x))*(diff(diff(diff(diff(G(x, y, z, t), t), x), y), z))-(diff(diff(diff(F(x, y, z, t), t), y), z))*(diff(diff(G(x, y, z, t), x), x))+(diff(diff(F(x, y, z, t), y), z))*(diff(diff(diff(G(x, y, z, t), t), x), x))+(diff(diff(F(x, y, z, t), t), y))*(diff(diff(diff(G(x, y, z, t), x), x), z))-(diff(F(x, y, z, t), y))*(diff(diff(diff(diff(G(x, y, z, t), t), x), x), z))+(diff(diff(F(x, y, z, t), t), z))*(diff(diff(diff(G(x, y, z, t), x), x), y))-(diff(F(x, y, z, t), z))*(diff(diff(diff(diff(G(x, y, z, t), t), x), x), y))-(diff(F(x, y, z, t), t))*(diff(diff(diff(diff(G(x, y, z, t), x), x), y), z))+F(x, y, z, t)*(diff(diff(diff(diff(diff(G(x, y, z, t), t), x), x), y), z))

(5)

ND(F(x,y,t), G(x,y,t), [x]);
ND(F(x,y,z,t), G(x,y,z,t), [y]);
ND(F(x,y,z,t), G(x,y,z,t), [z]);
ND(F(x,y,z,t), G(x,y,z,t), [t]);
ND(F(x,y,z,t), G(x,y,z,t), [x,y]);
ND(F(x,y,z,t), G(x,y,z,t), [x,y,z]);
ND(F(x,y,t), G(x,y,t), [x$2, y, t]);

-(diff(F(x, y, t), x))*G(x, y, t)+F(x, y, t)*(diff(G(x, y, t), x))

 

-(diff(F(x, y, z, t), y))*G(x, y, z, t)+F(x, y, z, t)*(diff(G(x, y, z, t), y))

 

-(diff(F(x, y, z, t), z))*G(x, y, z, t)+F(x, y, z, t)*(diff(G(x, y, z, t), z))

 

-(diff(F(x, y, z, t), t))*G(x, y, z, t)+F(x, y, z, t)*(diff(G(x, y, z, t), t))

 

(diff(diff(F(x, y, z, t), x), y))*G(x, y, z, t)-(diff(F(x, y, z, t), x))*(diff(G(x, y, z, t), y))-(diff(F(x, y, z, t), y))*(diff(G(x, y, z, t), x))+F(x, y, z, t)*(diff(diff(G(x, y, z, t), x), y))

 

-(diff(diff(diff(F(x, y, z, t), x), y), z))*G(x, y, z, t)+(diff(diff(F(x, y, z, t), x), y))*(diff(G(x, y, z, t), z))+(diff(diff(F(x, y, z, t), x), z))*(diff(G(x, y, z, t), y))-(diff(F(x, y, z, t), x))*(diff(diff(G(x, y, z, t), y), z))+(diff(diff(F(x, y, z, t), y), z))*(diff(G(x, y, z, t), x))-(diff(F(x, y, z, t), y))*(diff(diff(G(x, y, z, t), x), z))-(diff(F(x, y, z, t), z))*(diff(diff(G(x, y, z, t), x), y))+F(x, y, z, t)*(diff(diff(diff(G(x, y, z, t), x), y), z))

 

(diff(diff(diff(diff(F(x, y, t), t), x), x), y))*G(x, y, t)-(diff(diff(diff(F(x, y, t), x), x), y))*(diff(G(x, y, t), t))-(diff(diff(diff(F(x, y, t), t), x), x))*(diff(G(x, y, t), y))+(diff(diff(F(x, y, t), x), x))*(diff(diff(G(x, y, t), t), y))-2*(diff(diff(diff(F(x, y, t), t), x), y))*(diff(G(x, y, t), x))+2*(diff(diff(F(x, y, t), x), y))*(diff(diff(G(x, y, t), t), x))+2*(diff(diff(F(x, y, t), t), x))*(diff(diff(G(x, y, t), x), y))-2*(diff(F(x, y, t), x))*(diff(diff(diff(G(x, y, t), t), x), y))+(diff(diff(F(x, y, t), t), y))*(diff(diff(G(x, y, t), x), x))-(diff(F(x, y, t), y))*(diff(diff(diff(G(x, y, t), t), x), x))-(diff(F(x, y, t), t))*(diff(diff(diff(G(x, y, t), x), x), y))+F(x, y, t)*(diff(diff(diff(diff(G(x, y, t), t), x), x), y))

(6)
 

 

Download aanpassoing_ND_pro_mprimes27-4-2025.mw

@salim-barzani 

restart;

# Definities
g := a1*x + a2*y + a3*z + a4*t + a5:
h := a6*x + a7*y + a8*z + a9*t + a10:
f := g^2 + h^2 + a11:

# Afgeleiden
fx := diff(f, x): fy := diff(f, y): fz := diff(f, z): ft := diff(f, t):
fxx := diff(fx, x): fxy := diff(fx, y): fxz := diff(fx, z): fyy := diff(fy, y):
fxxx := diff(fxx, x): fxxy := diff(fxx, y): fxxxy := diff(fxxx, y):
fxxxx := diff(fxxx, x): fxxxxx := diff(fxxxx, x): fxxxxxx := diff(fxxxxx, x):

# PDE
PDE := 9*(f*diff(f, x, t) - fx*ft)
    -5*(f*diff(f, x, x, x, y) - 3*fx*diff(f, x, x, y) + 3*fxx*fxy - fxxx*fy)
    + (f*diff(f, x, x, x, x, x, x) - 6*fx*diff(f, x, x, x, x, x) + 15*fxx*diff(f, x, x, x, x) - 10*(fxxx)^2)
    -5*(f*fyy - fy^2)
    +alpha*(f*fxx - fx^2)
    +beta*(f*fxy - fx*fy)
    +gamma*(f*fxz - fx*fz):

PDE := expand(PDE): PDE := simplify(PDE):

# Coëfficiënten pakken
coeff1 := coeff(PDE, x, 1):
coeff2 := coeff(PDE, y, 1):
coeff3 := coeff(PDE, z, 1):
coeff4 := coeff(PDE, t, 1):
coeff_const := eval(PDE, {x=0, y=0, z=0, t=0}):

# Stelsel van vergelijkingen
Eqns := {coeff1=0, coeff2=0, coeff3=0, coeff4=0, coeff_const=0}:
# Stelsel
##Eqns := {coeff_x=0, coeff_y=0, coeff_z=0, coeff_t=0, coeff_const=0}:

# Oplossen
Sol := solve(Eqns, {a4, a9, a11}):
Sol;

{a11 = -3*(a1^2+a6^2)*(a1^3*a2+a1^2*a6*a7+a1*a2*a6^2+a6^3*a7)/(a1^2*a7^2-2*a1*a2*a6*a7+a2^2*a6^2), a4 = -(1/9)*(a1^3*alpha+a1^2*a2*beta+a1^2*a3*gamma+a1*a6^2*alpha+a2*a6^2*beta+a3*a6^2*gamma-5*a1*a2^2+5*a1*a7^2-10*a2*a6*a7)/(a1^2+a6^2), a9 = -(1/9)*(a1^2*a6*alpha+a1^2*a7*beta+a1^2*a8*gamma+a6^3*alpha+a6^2*a7*beta+a6^2*a8*gamma-10*a1*a2*a7+5*a2^2*a6-5*a6*a7^2)/(a1^2+a6^2)}

(1)
 

 

Download solve_a4-a9-a11_pde_6_orde_mprimes_27-4-2025.mw

DrawCleanDomain := proc(outerPolygon::list,
                        path1Pts::list, path2Pts::list,
                        z0::list, z::list,
                        path1Color::string := "red",
                        path2Color::string := "green",
                        outerColor::string := "LightBlue",
                        outerTransparency::numeric := 0.4)

    uses plots, plottools;

    local outer, curve1, curve2, pt1, pt2, label1, label2, finalPlot;
    local z0Label, z0Coords, zLabel, zCoords;

    # Labels en coördinaten splitsen
    z0Label := z0[1]; z0Coords := z0[2];
    zLabel := z[1]; zCoords := z[2];

    # Buitenste domein
    outer := polygon(outerPolygon, color = outerColor, transparency = outerTransparency);

    # Paden
    curve1 := pointplot(path1Pts, color = path1Color, linestyle = dot, thickness = 2, connect = true);
    curve2 := pointplot(path2Pts, color = path2Color, linestyle = dot, thickness = 2, connect = true);

    # Begin- en eindpunt
    pt1 := pointplot([z0Coords], symbol = solidcircle, symbolsize = 15, color = black);
    pt2 := pointplot([zCoords], symbol = solidcircle, symbolsize = 15, color = black);

    # Labels bij punten
    label1 := textplot([z0Coords[1], z0Coords[2] - 0.1, z0Label], font = [Helvetica, Bold, 14]);
    label2 := textplot([zCoords[1], zCoords[2] - 0.1, zLabel], font = [Helvetica, Bold, 14]);

    # Alles tonen in één plot
    finalPlot := display([outer, curve1, curve2, pt1, pt2, label1, label2],
                         scaling = constrained, axes = none,
                         title = "Domain with Two Paths and Custom Points");

    return finalPlot;
end proc:

outerPolygon := [[-1, 0], [-0.7, 1.2], [0, 1.5], [0.7, 1.2], [1.2, 0], [0.7, -1.2], [0, -1.4], [-0.7, -1.2], [-1, 0]];
path1 := [[-0.8, 0.6], [-0.3, 1.0], [0.4, 0.5], [0.9, -0.4]];
path2 := [[-0.8, 0.6], [-0.7, 0.0], [0.2, -0.6], [0.9, -0.4]];
a0 := ["a_0", [-0.8, 0.6]];
z := ["z", [0.9, -0.4]];

DrawCleanDomain(outerPolygon, path1, path2, a0, z);


example ; fig1 := [[0, 0], [4, 0], [4, 3], [0, 3], [5, 5],[8,1],[8,8],[-5,8]]
feature : a last point in the list will not be connected to another point to draw a line 

restart:

 

DrawOrderedLines := proc(shape1::list, isolated1::list, shape2::list, isolated2::list)
  local i, p1, p2, allplots, colorlist, polyline, isolateplot, j:
  uses plots, plottools;
  colorlist := [blue, red]:
  allplots := []:

  for i from 1 to 2 do
    if i = 1 then
      polyline := shape1:
      isolateplot := isolated1:
    else
      polyline := shape2:
      isolateplot := isolated2:
    end if:

    # Verbind punten in exacte volgorde
    if nops(polyline) >= 2 then
      for j from 1 to nops(polyline) - 1 do
        p1 := polyline[j]:
        p2 := polyline[j+1]:
        allplots := [op(allplots), line(p1, p2, color=colorlist[i], thickness=2)]:
      end do:
    end if:

    # Teken losse geïsoleerde punten
    if nops(isolateplot) > 0 then
      allplots := [op(allplots), pointplot(isolateplot, color=colorlist[i], symbol=solidcircle, symbolsize=15)]:
    end if:
  end do:

  return display(allplots, scaling=constrained, title="");
end proc:

fig1 := [[0, 0], [4, 0], [4, 3], [0, 3], [5, 5],[8,1],[8,8],[-5,8]]:
isolated1 := [[0,3],[2, 1],[-5,8]]:
fig2 := [[6, 6], [8, 6], [8, 8], [6, 8], [9, 9]]:
isolated2 := [[7, 7]]:

DrawOrderedLines(fig1, isolated1, fig2, isolated2);

 

Download punten_tekeken_-laatste_punt_niet_in_lijst_mprimes_23-4-2025.mw

restart:
with(DEtools):

ExactODEGroupingInteractive := proc(ODE, x, y)
  local lhs_expr, M, N, M_orig, N_orig, dM_dy, dN_dx, matched,
        intM, u_partial, du_dy, gprime, g, u_final, terms,
        dx_term, dy_term, ODE_classical, advice;

  print("�� STEP 0: Start by reading the differential equation in differential form:");
  lhs_expr := lhs(ODE);
  print("   → Equation provided: ", ODE);

  print("\n�� STEP 0B: Try to classify the ODE using Maple’s odeadvisor");

  # Extract M and N
  terms := [op(lhs_expr)];
  dx_term := select(t -> has(t, Dx), terms)[1];
  dy_term := select(t -> has(t, Dy), terms)[1];
  M := simplify(dx_term / Dx);
  N := simplify(dy_term / Dy);

  # Save for later
  M_orig := M:
  N_orig := N:

  # Substitute y = y(x)
  M := subs(y = y(x), M):
  N := subs(y = y(x), N):

  print("   We now rewrite the ODE in the form:");
  print("     M(x,y)*dy/dx + N(x,y) = 0");
  ODE_classical := M + N*diff(y(x), x) = 0;
  print("   → Rewritten ODE: ", ODE_classical);

  print("   Ask Maple’s odeadvisor for classification:");
  advice := odeadvisor(ODE_classical, y(x));
  print("�� Maple's odeadvisor says: ", advice);

  if member(_exact, advice) then
    print(" Great! Maple recognizes this ODE as exact.");
  else
    print("⚠️ Maple did NOT classify this as exact.");
    print("   → We will verify exactness ourselves using partial derivatives.");
  end if;

  print("\n�� STEP 1: Extract the functions M(x, y) and N(x, y) from the equation:");
  print("   → M(x, y) = ", M_orig);
  print("   → N(x, y) = ", N_orig);

  print("\n�� STEP 2: Check if the ODE is exact by comparing partial derivatives:");
  print("   → Compute ∂M/∂y and ∂N/∂x:");
  dM_dy := diff(M_orig, y):
  dN_dx := diff(N_orig, x):
  print("     ∂M/∂y = ", dM_dy);
  print("     ∂N/∂x = ", dN_dx);
  matched := simplify(dM_dy - dN_dx);
  if matched <> 0 then
    return " This equation is NOT exact. Grouping method is not applicable.";
  else
    print(" Yes! The equation is exact.");
  end if;

  print("\n�� STEP 3: Integrate M(x, y) with respect to x (treat y as constant):");
  print("   → ∫ M(x, y) dx = ");
  intM := int(M_orig, x):
  print("     = ", intM, " + g(y)");

  print("\n�� STEP 4: Differentiate that result with respect to y:");
  print("   → ∂/∂y of the integral:");
  du_dy := diff(intM, y):
  print("     ∂(partial result)/∂y = ", du_dy);

  print("\n�� STEP 5: Now solve for g'(y):");
  print("   → g'(y) = N(x, y) - ∂/∂y(previous result)");
  gprime := simplify(N_orig - du_dy):
  print("     g'(y) = ", gprime);

  print("\n�� STEP 6: Integrate g'(y) with respect to y:");
  print("   → ∫ g'(y) dy = ");
  g := int(gprime, y):
  print("     g(y) = ", g);

  print("\n�� STEP 7: Add both parts to find the general solution u(x, y):");
  u_final := simplify(intM + g):
  print("     u(x, y) = ", u_final);

  print("\n�� FINAL RESULT: The general solution to the ODE is:");
  return u_final = 'C';

end proc:

# Example call
ExactODEGroupingInteractive(
  (6*x*y^2 + 4*x^3*y)*Dx + (6*x^2*y + x^4 + exp(y))*Dy = 0,
  x, y);

"?? STEP 0: Start by reading the differential equation in differential form:"

 

"   &rarr; Equation provided: ", (4*x^3*y+6*x*y^2)*Dx+(6*x^2*y+x^4+exp(y))*Dy = 0

 

"
?? STEP 0B: Try to classify the ODE using Maple&rsquo;s odeadvisor"

 

"   We now rewrite the ODE in the form:"

 

"     M(x,y)*dy/dx + N(x,y) = 0"

 

"   &rarr; Rewritten ODE: ", 4*x^3*y(x)+6*x*y(x)^2+(6*x^2*y(x)+x^4+exp(y(x)))*(diff(y(x), x)) = 0

 

"   Ask Maple&rsquo;s odeadvisor for classification:"

 

"?? Maple's odeadvisor says: ", [_exact]

 

"✅ Great! Maple recognizes this ODE as exact."

 

"
?? STEP 1: Extract the functions M(x, y) and N(x, y) from the equation:"

 

"   &rarr; M(x, y) = ", 4*x^3*y+6*x*y^2

 

"   &rarr; N(x, y) = ", 6*x^2*y+x^4+exp(y)

 

"
?? STEP 2: Check if the ODE is exact by comparing partial derivatives:"

 

"   &rarr; Compute &PartialD;M/&PartialD;y and &PartialD;N/&PartialD;x:"

 

"     &PartialD;M/&PartialD;y = ", 4*x^3+12*x*y

 

"     &PartialD;N/&PartialD;x = ", 4*x^3+12*x*y

 

"✅ Yes! The equation is exact."

 

"
?? STEP 3: Integrate M(x, y) with respect to x (treat y as constant):"

 

"   &rarr; &int; M(x, y) dx = "

 

"     = ", (1/4)*y*(2*x^2+3*y)^2, " + g(y)"

 

"
?? STEP 4: Differentiate that result with respect to y:"

 

"   &rarr; &PartialD;/&PartialD;y of the integral:"

 

"     &PartialD;(partial result)/&PartialD;y = ", (1/4)*(2*x^2+3*y)^2+(3/2)*y*(2*x^2+3*y)

 

"
?? STEP 5: Now solve for g'(y):"

 

"   &rarr; g'(y) = N(x, y) - &PartialD;/&PartialD;y(previous result)"

 

"     g'(y) = ", exp(y)-(27/4)*y^2

 

"
?? STEP 6: Integrate g'(y) with respect to y:"

 

"   &rarr; &int; g'(y) dy = "

 

"     g(y) = ", -(9/4)*y^3+exp(y)

 

"
?? STEP 7: Add both parts to find the general solution u(x, y):"

 

"     u(x, y) = ", x^4*y+3*x^2*y^2+exp(y)

 

"
?? FINAL RESULT: The general solution to the ODE is:"

 

x^4*y+3*x^2*y^2+exp(y) = C

(1)

a little chance in de differential form , the first 6 is now a 3

ExactODEGroupingInteractive(
  (3*x*y^2 + 4*x^3*y)*Dx + (6*x^2*y + x^4 + exp(y))*Dy = 0,
  x, y);

"?? STEP 0: Start by reading the differential equation in differential form:"

 

"   &rarr; Equation provided: ", (4*x^3*y+3*x*y^2)*Dx+(6*x^2*y+x^4+exp(y))*Dy = 0

 

"
?? STEP 0B: Try to classify the ODE using Maple&rsquo;s odeadvisor"

 

"   We now rewrite the ODE in the form:"

 

"     M(x,y)*dy/dx + N(x,y) = 0"

 

"   &rarr; Rewritten ODE: ", x*y(x)*(4*x^2+3*y(x))+(6*x^2*y(x)+x^4+exp(y(x)))*(diff(y(x), x)) = 0

 

"   Ask Maple&rsquo;s odeadvisor for classification:"

 

"?? Maple's odeadvisor says: ", [`x=_G(y,y')`]

 

"⚠️ Maple did NOT classify this as exact."

 

"   &rarr; We will verify exactness ourselves using partial derivatives."

 

"
?? STEP 1: Extract the functions M(x, y) and N(x, y) from the equation:"

 

"   &rarr; M(x, y) = ", x*y*(4*x^2+3*y)

 

"   &rarr; N(x, y) = ", 6*x^2*y+x^4+exp(y)

 

"
?? STEP 2: Check if the ODE is exact by comparing partial derivatives:"

 

"   &rarr; Compute &PartialD;M/&PartialD;y and &PartialD;N/&PartialD;x:"

 

"     &PartialD;M/&PartialD;y = ", x*(4*x^2+3*y)+3*x*y

 

"     &PartialD;N/&PartialD;x = ", 4*x^3+12*x*y

 

"❌ This equation is NOT exact. Grouping method is not applicable."

(2)
 

 

Download 14-04_-2025mprimes-why_directly_not_find_ode_answer.mw

 
 

complex_map_plot := proc(f, zcurveLijst, t_range,
                         {kleurenset := ["blue","red","green","magenta","orange","cyan"],
                          lijnstijl := solid, resolutie := 200,
                          domein_naam := "Krommes in z-vlak", toon_label := false})
    local i, t, zcurve, ReZ, ImZ, ReW, ImW, zplots, wplots, kleur, zplot, wplot, annotatie, labeltekst;
    uses plots, plottools, InertForm;

    zplots := [];  wplots := [];

    for i to nops(zcurveLijst) do
        zcurve := zcurveLijst[i];
        kleur := kleurenset[i mod nops(kleurenset) + 1];

        ReZ := t -> Re(zcurve(t));
        ImZ := t -> Im(zcurve(t));
        ReW := t -> Re(f(zcurve(t)));
        ImW := t -> Im(f(zcurve(t)));

        zplot := plot([ReZ(t), ImZ(t), t = t_range],
                      color = kleur, linestyle = lijnstijl, thickness = 2,
                      scaling = constrained, axes = boxed, numpoints = resolutie,
                      labels = ["Re(z)", "Im(z)"]);

        if toon_label then
            labeltekst := typeset("z(t) = ", InertForm:-Display(zcurve(t)));
            annotatie := textplot([ReZ((rhs(t_range) + lhs(t_range))/2),
                                   ImZ((rhs(t_range) + lhs(t_range))/2),
                                   labeltekst], font = [TIMES, BOLD, 12]);
            zplot := display(zplot, annotatie);
        end if;

        wplot := plot([ReW(t), ImW(t), t = t_range],
                      color = kleur, linestyle = lijnstijl, thickness = 2,
                      scaling = constrained, axes = boxed, numpoints = resolutie,
                      labels = ["Re(w)", "Im(w)"]);

        zplots := [op(zplots), zplot];
        wplots := [op(wplots), wplot];
    end do;

    display(Array([display(zplots, title = cat("z-vlak: ", domein_naam)),
                   display(wplots, title = "w-vlak: Beeld onder f(z)")]), insequence = false);
end proc:

f := z -> exp(z);
zcurves := [t -> -1 + I*t, t -> 0 + I*t, t -> 1 + I*t, t -> 2 + I*t];
complex_map_plot(f, zcurves, -Pi..Pi, toon_label = false, domein_naam = "Verticale lijnen Re(z) = -1,0,1,2");

proc (z) options operator, arrow; exp(z) end proc

 

[proc (t) options operator, arrow; -1+I*t end proc, proc (t) options operator, arrow; I*t end proc, proc (t) options operator, arrow; 1+I*t end proc, proc (t) options operator, arrow; 2+I*t end proc]

 

 

 

 

 

f := z -> exp(z);
z_driehoek := proc(t) piecewise(
  t <= 1, 2*t,
  t <= 2, 2 + (t-1)*(-1+I),
  t <= 3, 1 + I + (t-2)*(-1 - I)
) end proc;

complex_map_plot(f, [z_driehoek], 0..3, toon_label=true, domein_naam="Driehoek");

proc (z) options operator, arrow; exp(z) end proc

 

proc (t) piecewise(t <= 1, 2*t, t <= 2, 2+(-1+I)*(t-1), t <= 3, 1+I+(-1-I)*(t-2)) end proc

 

 

 

 

 

zcurves := [
    t -> t - 2*I,
    t -> t - I,
    t -> t,
    t -> t + I,
    t -> t + 2*I
];

[proc (t) options operator, arrow; t-2*I end proc, proc (t) options operator, arrow; t-I end proc, proc (t) options operator, arrow; t end proc, proc (t) options operator, arrow; t+I end proc, proc (t) options operator, arrow; t+2*I end proc]

(1)

f := z -> exp(z);
complex_map_plot(f, zcurves, -2..2, domein_naam = "Horizontale lijnen Im(z) = -2..2", toon_label = false);

proc (z) options operator, arrow; exp(z) end proc

 

 

 

 

 

Download 10-4-2025-_exploring_th_emapping_of_verticl_lines_mprimes_versie_2.mw

In  Maple do... 
? FunctionAdvisor ;
using Maple's help info 
FunctionAdvisor
provide information on mathematical functions in general
FunctionAdvisor(topics) ;    

  1. The given real part is u(x,y) = sin(2x)/(cosh(2y) - cos(2x)).

  2. We verify it's harmonic by showing its Laplacian equals zero.

  3. Using the Cauchy-Riemann equations:

    • vₓ = -u_y

    • v_y = u_x

  4. We integrate to find the harmonic conjugate v(x,y):

    • First integrate v_y = u_x with respect to y

    • Then use the other Cauchy-Riemann equation to determine the arbitrary function of x

  5. The resulting analytic function simplifies to f(z) = -i cot(z).

  6. We verify that the real part of f(z) indeed matches the original u(x,y).

The final analytic function is:
f(z) = -i cot(z)

where z = x + iy.

PlotRootsOfUnity := proc(eq)
    local roots, X, Y, k, UnitCircle, RootsPlot;
    with(plots):
    interface(imaginaryunit = 'i'):
    roots := [solve(eq, z)];
    X := [seq(Re(roots[k]), k = 1 .. nops(roots))];
    Y := [seq(Im(roots[k]), k = 1 .. nops(roots))];
    UnitCircle := plot([cos(t), sin(t), t = 0 .. 2*Pi], color = gray, linestyle = dash);    
    RootsPlot := pointplot([X, Y], symbol = solidcircle, color = blue, symbolsize = 10);
    display(UnitCircle, RootsPlot, scaling = constrained, title = cat("Complexe roots on unitcircle  ", convert(eq, string)));
end proc:

PlotRootsOfUnity(z^6 = 1);

Dynamiek van SEIRTP model

restart;
with(plots):
with(DEtools):

SEIRTPplot := proc(param::list, tmin::numeric, tmax::numeric, dynRange::boolean := true, yRange::range := 0..1200)
    description "SEIRTP Model Plotter – Simulates and visualizes the effects of parameter changes on all compartments";

    local Lambda, alpha, delta, K, r, tau, gamma_, mu, phi, eta, sigma, beta, theta, xi;
    local S, E, Infectious, R, P, T, t, de, init, sol, plt, p;

    # Default parameter values
    Lambda := 0.0133:   alpha := 0.07954551: delta := 0.9: K := 300:
    r := 0.076:         tau := 0.0900982:   gamma_ := 0.00917: mu := 0.00056:
    phi := 0.09:        eta := 0.009:       sigma := 0.000456: beta := 0.567:
    theta := 0.009:     xi := 0.0487:

    # Overwrite defaults if needed
    for p in param do eval(p); end do;

    # Differential equations
    de := [
      diff(S(t),t) = -P(t)*S(t)*alpha - S(t)*mu + Lambda,
      diff(E(t),t) = alpha*S(t)*P(t) - (-T(t)*eta + 1)*beta*E(t) - theta*E(t) - mu*E(t),
      diff(Infectious(t),t) = (-T(t)*eta + 1)*beta*E(t) - delta*Infectious(t) - gamma_*Infectious(t) - mu*Infectious(t),
      diff(R(t),t) = theta*E(t) + gamma_*Infectious(t) - mu*R(t),
      diff(P(t),t) = xi*Infectious(t) - sigma*T(t)*P(t) - tau*P(t),
      diff(T(t),t) = r*T(t)*(1 - T(t)/K) - phi*T(t)
    ]:

    # Initial conditions
    init := [S(0)=1000, E(0)=10, Infectious(0)=5, R(0)=0, P(0)=1, T(0)=1]:

    # Numerical solution
    sol := dsolve({op(de), op(init)}, numeric, output = listprocedure, range=tmin..tmax):

    # Plot generation
    if dynRange then
        plt := odeplot(sol,
            [[t, S(t)], [t, E(t)], [t, Infectious(t)], [t, R(t)], [t, P(t)], [t, T(t)]],
            tmin..tmax,
            legend = ["Susceptible S(t)", "Exposed E(t)", "Infectious I(t)", "Recovered R(t)", "Pathogen P(t)", "Treatment T(t)"],
            title = "SEIRTP Model – Dynamic Axis Scaling",
            thickness = 2,
            style = [line]);
    else
        plt := odeplot(sol,
            [[t, S(t)], [t, E(t)], [t, Infectious(t)], [t, R(t)], [t, P(t)], [t, T(t)]],
            tmin..tmax,
            legend = ["Susceptible S(t)", "Exposed E(t)", "Infectious I(t)", "Recovered R(t)", "Pathogen P(t)", "Treatment T(t)"],
            title = cat("SEIRTP Model – Fixed Axis Scaling ", convert(yRange,string)),
            thickness = 2,
            style = [line],
            view = [tmin..tmax, yRange]);
    end if;

    # �� Procedure Input Explanation
    printf~([
      "��️ Procedure Input Explanation:\n",
      sprintf("%-10s : %s\n", "param",    "List of parameter assignments (e.g. [r = 0.12, beta = 0.6])"),
      sprintf("%-10s : %s\n", "tmin",     "Start time for simulation (e.g. 0)"),
      sprintf("%-10s : %s\n", "tmax",     "End time for simulation (e.g. 100)"),
      sprintf("%-10s : %s\n", "dynRange", "true = dynamic y-axis scaling, false = use yRange"),
      sprintf("%-10s : %s\n", "yRange",   "Optional fixed y-axis range (e.g. 0..1500)")
    ]);

    # �� Separation line
    printf("------------------------------------------------------------\n");

    # �� Parameter Meaning
    printf~([
      "�� Parameter Meaning:\n",
      sprintf("%-10s : %s\n", "Lambda",   "Recruitment rate into S"),
      sprintf("%-10s : %s\n", "alpha",    "Infection rate via environment (S to E)"),
      sprintf("%-10s : %s\n", "beta",     "Progression rate from E to I"),
      sprintf("%-10s : %s\n", "delta",    "Disease-induced death rate"),
      sprintf("%-10s : %s\n", "gamma_",   "Recovery rate from I"),
      sprintf("%-10s : %s\n", "mu",       "Natural death rate"),
      sprintf("%-10s : %s\n", "theta",    "Direct recovery rate from E"),
      sprintf("%-10s : %s\n", "xi",       "Pathogen production by I"),
      sprintf("%-10s : %s\n", "sigma",    "Treatment effectiveness against P"),
      sprintf("%-10s : %s\n", "tau",      "Natural pathogen decay"),
      sprintf("%-10s : %s\n", "r",        "Growth rate of treatment capacity"),
      sprintf("%-10s : %s\n", "K",        "Carrying capacity of treatment system"),
      sprintf("%-10s : %s\n", "phi",      "Treatment dropout rate"),
      sprintf("%-10s : %s\n", "eta",      "Effect of treatment on infection process")
    ]);

    return plt;
end proc:

# Dynamisch bereik
SEIRTPplot([], 0, 15, true);
 

��️ Procedure Input Explanation:
param      : List of parameter assignments (e.g. [r = 0.12, beta = 0.6])
tmin       : Start time for simulation (e.g. 0)
tmax       : End time for simulation (e.g. 100)
dynRange   : true = dynamic y-axis scaling, false = use yRange
yRange     : Optional fixed y-axis range (e.g. 0..1500)
------------------------------------------------------------
�� Parameter Meaning:
Lambda     : Recruitment rate into S
alpha      : Infection rate via environment (S to E)
beta       : Progression rate from E to I
delta      : Disease-induced death rate
gamma_     : Recovery rate from I
mu         : Natural death rate
theta      : Direct recovery rate from E
xi         : Pathogen production by I
sigma      : Treatment effectiveness against P
tau        : Natural pathogen decay
r          : Growth rate of treatment capacity
K          : Carrying capacity of treatment system
phi        : Treatment dropout rate
eta        : Effect of treatment on infection process

 

 

 

# Vast bereik met aangepaste schaal
SEIRTPplot([r = 0.12], 0, 15, false, 0..1200);

��️ Procedure Input Explanation:
param      : List of parameter assignments (e.g. [r = 0.12, beta = 0.6])
tmin       : Start time for simulation (e.g. 0)
tmax       : End time for simulation (e.g. 100)
dynRange   : true = dynamic y-axis scaling, false = use yRange
yRange     : Optional fixed y-axis range (e.g. 0..1500)
------------------------------------------------------------
�� Parameter Meaning:
Lambda     : Recruitment rate into S
alpha      : Infection rate via environment (S to E)
beta       : Progression rate from E to I
delta      : Disease-induced death rate
gamma_     : Recovery rate from I
mu         : Natural death rate
theta      : Direct recovery rate from E
xi         : Pathogen production by I
sigma      : Treatment effectiveness against P
tau        : Natural pathogen decay
r          : Growth rate of treatment capacity
K          : Carrying capacity of treatment system
phi        : Treatment dropout rate
eta        : Effect of treatment on infection process

 
 

 

Download _mprimes_-31-3-2025_how_to_give_a_limit_value_from_-1_to_1_for_sensitivity_analysis_proc_1.mw

restart;
with(PDEtools):

# Step 1: Define the initial equation for H
H_eq := 2*H*B = C;

# Step 2: Solve for H
H := solve(H_eq, H);

# Step 3: Define the characteristic equation for nu
nu_eq := (2*nu - n)^2 = 16*A*B*beta*k^2 - 4*C^2*beta*k^2 + 1;

# Step 4: Solve for nu
nu := solve(nu_eq, nu);

# Step 5: Derive a0 from a coefficient equation
a0_eq := l*a0 = k^2*m*(4*A*B - C^2);
a0 := solve(a0_eq, a0);

# Step 6: Derive a2 from a higher-order correction
a2_eq := l*a2 = -6*B^2*k^2*m;
a2 := solve(a2_eq, a2);

# Step 7: Derive b2 as a nonlinear coefficient
b2_eq := l*B^2*b2 = (-3/8) * m*k^2 * (16*A^2*B^2 - 8*A*B*C^2 + C^4);
b2 := solve(b2_eq, b2);

# Step 8: Display the derived parameters
H, nu, a0, a2, b2;

 

with(Student:-Basics);
SolveSteps(?);
1 2 3 4 5 6 Page 3 of 6