janhardo

745 Reputation

12 Badges

11 years, 136 days

MaplePrimes Activity


These are replies submitted by janhardo

@salim-barzani 
"i think you use Ai i am true?"

Yes, of course ai is used by me , otherwise I get no idea what all the code represents and it becomes a hopeless search to solve anything.

@salim-barzani 
Have you tried adjusting the code to make the lump bigger? 
Maybe there are other forum members who have an idea for this to get the lump plot bigger, I am interested in that.

Or a different approach for the plotting?

@salim-barzani 
You might get a better lump visualisation with this code , than I have made before 
Experiment with these ‘basic lumps’ yourself 

i did not changed the lump itself.... 

@salim-barzani 
Find out for yourself how to increase lumps size, and show the result!

 

restart; with(plots); alpha := 1; beta := 1; l3 := -1-2*I; l4 := -2/3-I; Lump2 := proc (x, y, t) local theta, B, f, u, l3c, l4c; l3c := conjugate(l3); l4c := conjugate(l4); theta := proc (l) options operator, arrow; x+l*y-(alpha+beta/l)*t end proc; B := proc (li, lj) options operator, arrow; (3*li+3*lj)/(beta*(li-lj)^2) end proc; f := theta(l3)*theta(l3c)*theta(l4)*theta(l4c)+B(l3, l3c)*theta(l4)*theta(l4c)+B(l3, l4)*theta(l3c)*theta(l4c)+B(l3, l4c)*theta(l3c)*theta(l4)+B(l3c, l4)*theta(l3)*theta(l4c)+B(l3c, l4c)*theta(l3)*theta(l4)+B(l4, l4c)*theta(l3)*theta(l3c)+B(l3, l3c)*B(l4, l4c)+B(l3, l4)*B(l3c, l4c)+B(l3, l4c)*B(l3c, l4); u := simplify(12*(diff(f, `$`(x, 2)))/f^2-12*(diff(f, x))^2/f^3); return Re(u) end proc; times := [-70, 0, 70]; colors := [red, green, blue]; contourPlots := []; for i to 3 do contourPlots := [op(contourPlots), contourplot(Lump2(x, y, times[i]), x = -80 .. 80, y = -80 .. 80, contours = 50, grid = [400, 400], color = colors[i], thickness = 2)] end do; line1 := plot(-(1/3)*x-(1/6)*sqrt(30), x = -80 .. 80, color = black, thickness = 2); line2 := plot(-9*x-3*sqrt(26), x = -80 .. 80, color = brown, thickness = 2); display(contourPlots[], line1, line2, axes = boxed, scaling = constrained, view = [-80 .. 80, -80 .. 80], title = "Contour plot of 2-lump waves: t=-70 (red), t=0 (green), t=70 (blue)", labels = ["x", "y"])

 
 

info

 

 

Download 2-lump_waves_plot_25-2-2025_def_mprimes.mw

seems to be not the same 2 lump waves ?

@salim-barzani 
iI have already calculated a 2 lump wave and in that plot you can draw the two straight lines, from the information given
1 of the lines must then pass through the 2 lump wave?

@salim-barzani 

restart:
with(plots):

### Lump Parameters ### PROCEDURE ZONDER INITIELE POSITIE LUMPS ?
a := -1; b := -2; alpha := 1; beta := 1;
vx := -3/5; vy := 1/5;
trajectory_slope := vy/vx;  # automatisch bepaald
U := (x, y, t, a, b, alpha, beta) ->
    4*beta*((a*y - 2*alpha*t + x)*b^2 + a*(-2*beta*t + a*(a*y - 2*alpha*t + x))*b^2) /
    (-b^6*beta*y^2
    + (-4*t*y*beta^2 + (-2*a^2*y^2 + (4*alpha*t - 2*x)*a*y - 4*(alpha*t - x/2)^2)*beta + 3*a)*b^4
    + (-4*t^2*beta^3 + 4*a*t*(a*y - 2*alpha*t + x)*beta^2 - a^2*(a*y - 2*alpha*t + x)^2*beta + 6*a^3)*b^2
    + 3*a^5);

### �� Dynamische Lump-Procedure (met parameter-uitleg) �� ###
DynamicLumpPlot := proc(input::list, mode::symbol := 'tijd')
  local i, n, pos_initial, tijden, pos_shift, contour, kleuren, trajectory_plot, text_labels, U, extra_info, xmin, xmax, ymin, ymax, param_info;

  n := nops(input);
  pos_initial := [seq([200*(i-(n+1)/2), -200*(i-(n+1)/2)/3], i=1..n)];

  if mode = 'tijd' then
    tijden := input;
    for i from 1 to n do
      pos_shift[i] := [pos_initial[i][1] + vx*tijden[i], pos_initial[i][2] + vy*tijden[i]];
    end do:
    extra_info := cat(seq(sprintf("t=%.2f: (%.2f, %.2f)   ", tijden[i], pos_shift[i][1], pos_shift[i][2]), i=1..n));

  elif mode = 'positie' then
    pos_shift := input;
    for i from 1 to n do
      tijden[i] := (pos_shift[i][1] - pos_initial[i][1]) / vx;
      if abs(pos_shift[i][2] - trajectory_slope*pos_shift[i][1]) > 1e-3 then
        printf("⚠️ Lump %d ligt NIET precies op trajectory (afwijking=%.2f). Correcte positie: (%.2f, %.2f)\n",
          i, abs(pos_shift[i][2] - trajectory_slope*pos_shift[i][1]), pos_shift[i][1], trajectory_slope*pos_shift[i][1]);
      end if;
    end do:
    extra_info := cat(seq(sprintf("(%.2f, %.2f): t=%.2f   ", pos_shift[i][1], pos_shift[i][2], tijden[i]), i=1..n));

  else
    error "Kies modus 'tijd' of 'positie'";
  end if:

  xmin := min(seq(pos_shift[i][1], i=1..n)) - 50; xmax := max(seq(pos_shift[i][1], i=1..n)) + 50;
  ymin := min(seq(pos_shift[i][2], i=1..n)) - 50; ymax := max(seq(pos_shift[i][2], i=1..n)) + 50;

  xmin := min(xmin, -200): xmax := max(xmax, 200):
  ymin := min(ymin, trajectory_slope*xmin - 50): ymax := max(ymax, trajectory_slope*xmax + 50):

  U := (x, y, t, a, b, alpha, beta) ->
    4*beta*((a*y - 2*alpha*t + x)*b^2 + a*(-2*beta*t + a*(a*y - 2*alpha*t + x))*b^2) /
    (-b^6*beta*y^2
    + (-4*t*y*beta^2 + (-2*a^2*y^2 + (4*alpha*t - 2*x)*a*y - 4*(alpha*t - x/2)^2)*beta + 3*a)*b^4
    + (-4*t^2*beta^3 + 4*a*t*(a*y - 2*alpha*t + x)*beta^2 - a^2*(a*y - 2*alpha*t + x)^2*beta + 6*a^3)*b^2
    + 3*a^5);

  kleuren := [red, blue, green, orange, purple, cyan, magenta]:

  for i from 1 to n do
    contour[i] := contourplot(
      eval(U(x - pos_shift[i][1], y - pos_shift[i][2], 0, a, b, alpha, beta)),
      x = xmin..xmax, y = ymin..ymax, contours=30, color=kleuren[i mod 7 + 1],
      grid=[200,200], transparency=0.1
    );
  end do:

  trajectory_plot := implicitplot(y=trajectory_slope*x, x=xmin..xmax, y=ymin..ymax, color=black, thickness=2):

  text_labels := textplot([
    seq([pos_shift[i][1], pos_shift[i][2]+(ymax-ymin)*0.03,
         cat("t=", evalf[3](tijden[i])),
         'font'=["Arial",12,'bold'], 'color'=black], i=1..n)
  ]):

  param_info := sprintf("Lump-parameters betekenis:\n a=%.2f (richting/vormfactor), b=%.2f (breedte/hoogte-factor), α=%.2f, β=%.2f (amplitude/richting)\n → Trajectory-slope = %.2f",
                         a,b,alpha,beta,trajectory_slope);

  display(
    [seq(contour[i], i=1..n)], trajectory_plot, text_labels,
    title = cat(n, "-Lump Soliton(en) Dynamisch"),
    labels = ["x","y"], scaling = constrained,
    caption = typeset(extra_info, "\n\n", param_info)
  );
end proc:

-1

 

-2

 

1

 

1

 

-3/5

 

1/5

 

-1/3

 

proc (x, y, t, a, b, alpha, beta) options operator, arrow; 4*beta*((y*a-2*alpha*t+x)*b^2+a*(-2*beta*t+a*(y*a-2*alpha*t+x))*b^2)/(-b^6*beta*y^2+(-4*t*y*beta^2+(-2*a^2*y^2+(4*alpha*t-2*x)*a*y-4*(alpha*t-(1/2)*x)^2)*beta+3*a)*b^4+(-4*t^2*beta^3+4*a*t*(y*a-2*alpha*t+x)*beta^2-a^2*(y*a-2*alpha*t+x)^2*beta+6*a^3)*b^2+3*a^5) end proc

(1)

DynamicLumpPlot([0,1,2,3,4,5,6,7,8,9,10], 'tijd');# time in sec ?

 

DynamicLumpPlot([[-150,50],[-80,80/3],[50,-50/3],[0,0]],'positie');# position

 

 

DynamicLumpPlot([[-150,50]],'positie');

 
 

 

Download dynamische_lump_procedure_GPTDEFA-_24-2-2025.mw

@salim-barzani 
your question is about the 2 lump wave ....

@salim-barzani 
"is about add to line for and 2 y finction with a[1]a[2]b[1]b[2] inside of y[1] and y[2]"
I don't know what exactly you mean by this ?
explain this more 

@salim-barzani 

I am trying to create a a procedure that can handle  a dynamic contour plot.

@salim-barzani 
What happened then?

positions of the 1 lump waves 

First 16 17 18 19 20 21 22 Last Page 18 of 78