janhardo

690 Reputation

12 Badges

11 years, 36 days

MaplePrimes Activity


These are replies submitted by janhardo

@salim-barzani 

"@janhardo  no comment " from what ?


 

restart; with(plots); printf("Step 1: Declare l and b as free variables for the 3D plot.\n"); l := 'l'; b := 'b'; printf("Step 2: Set fixed values for remaining parameters.\n"); a := 1; c := 1; d := .2; f := 1; epsilon := 1; printf("Step 3: Define the 3D gain function G(l,b) with fixed a,c,d and variable l,b.\n"); G := proc (l, b) options operator, arrow; 2*Im(sqrt(-a^2*f*d-a*b+(1/2)*l^2-3*a+(1/2)*sqrt(-48*a^3*f*d+4*epsilon*l^3*c-24*a*epsilon*l*c+l^4+4*l^2*c^2-48*a^2*b-12*a*l^2+36*a^2))) end proc; printf("Step 4: Create a 3D surface plot of G(l,b).\n"); gainPlot := plot3d(G(l, b), l = -6 .. 4, b = .1 .. 1.2, labels = ["Wave number l", "Parameter b", "Gain G(l,b)"], title = "3D MI Gain Spectrum over (l, b)", shading = zhue, axes = boxed, grid = [60, 60]); printf("Step 5: Display the 3D surface plot.\n"); gainPlot

Step 1: Declare l and b as free variables for the 3D plot.
Step 2: Set fixed values for remaining parameters.
Step 3: Define the 3D gain function G(l,b) with fixed a,c,d and variable l,b.
Step 4: Create a 3D surface plot of G(l,b).
Step 5: Display the 3D surface plot.

 

 

 


 

Download can_we_plotthisin_3Dshapemprimes5-5-2025.mw

@salim-barzani 
If there is a gain function G for 3D , correct?

you code is correct.
 


restart; with(plots); with(LinearAlgebra); printf("Step 1: Define the wave number variable l and the plotting range.\n"); printf("        The wave number l determines how rapidly perturbations oscillate in space.\n"); lrange := -6 .. 4; printf("Step 2: Set physical parameters used in the growth rate function.\n"); printf("        f = nonlinear interaction factor (set to 1 for simplicity)\n"); printf("        d = dispersion-related coefficient (affects stability threshold)\n"); printf("        epsilon = scaling factor on nonlinear terms (modulation coefficient)\n"); f := 1; d := .2; epsilon := 1; printf("Step 3: Define the gain function G(l, a, b, c).\n"); printf("        This function comes from the imaginary part of a complex dispersion relation.\n"); printf("        Gain G(l) > 0 means exponential growth of perturbations at wave number l (modulation instability).\n"); printf("        The inner square root captures the dispersion and nonlinear interaction effects.\n"); G := proc (l, a, b, c) options operator, arrow; 2*Im(sqrt(-a^2*f*d-a*b+(1/2)*l^2-3*a+(1/2)*sqrt(-48*a^3*f*d+4*epsilon*l^3*c-24*a*epsilon*l*c+l^4+4*l^2*c^2-48*a^2*b-12*a*l^2+36*a^2))) end proc; printf("Step 4: Create plots for fixed a = 1 and different b-values (1, 0.5, 0.3).\n"); printf("        Here, b may represent a damping or coupling strength. Changing b alters the stability region.\n"); plot1 := plot(G(l, 1, 1, 1), l = lrange, color = red, thickness = 2); plot2 := plot(G(l, 1, .5, 1), l = lrange, color = blue, thickness = 2); plot3 := plot(G(l, 1, .3, 1), l = lrange, color = green, thickness = 2); printf("Step 5: Overlay the plots to compare the impact of different b values on growth rate G(l).\n"); printf("        Observe how the instability band (where G > 0) broadens or narrows depending on b.\n"); overlay := display([plot1, plot2, plot3], title = "Overlay of G(l) for b = 1, 0.5, 0.3 (a = 1, c = 1)", labels = ["Wave number l", "Growth rate G(l)"], legend = ["b = 1", "b = 0.5", "b = 0.3"], axes = boxed, size = [700, 500]); printf("Step 6: Display the final combined plot.\n"); overlay

Step 1: Define the wave number variable l and the plotting range.
        The wave number l determines how rapidly perturbations oscillate in space.
Step 2: Set physical parameters used in the growth rate function.
        f = nonlinear interaction factor (set to 1 for simplicity)
        d = dispersion-related coefficient (affects stability threshold)
        epsilon = scaling factor on nonlinear terms (modulation coefficient)
Step 3: Define the gain function G(l, a, b, c).
        This function comes from the imaginary part of a complex dispersion relation.
        Gain G(l) > 0 means exponential growth of perturbations at wave number l (modulation instability).
        The inner square root captures the dispersion and nonlinear interaction effects.
Step 4: Create plots for fixed a = 1 and different b-values (1, 0.5, 0.3).
        Here, b may represent a damping or coupling strength. Changing b alters the stability region.
Step 5: Overlay the plots to compare the impact of different b values on growth rate G(l).
        Observe how the instability band (where G > 0) broadens or narrows depending on b.
Step 6: Display the final combined plot.

 

 

 


Download i_wantsome_option_if_is_exist_mprimes-5-5-2025.mw


 

restart; with(plots); with(LinearAlgebra); printf("Step 1: Define the wave number variable l and parameter range for plotting.\n"); l := 'l'; lrange := -3 .. 3; printf("Step 2: Define constants and gain parameters used in the equation.\n"); b := .5; c := .3; d := .2; epsilon := 1; f := 1; printf("Step 3: Define gain function G(l,a) using corrected version with l instead of k.\n"); G := proc (l, a) options operator, arrow; 2*Im(sqrt(-a^2*f*d-a*b+(1/2)*l^2-3*a+(1/2)*sqrt(-48*a^3*f*d+4*epsilon*l^3*c-24*a*epsilon*l*c+l^4+4*l^2*c^2-48*a^2*b-12*a*l^2+36*a^2))) end proc; printf("Step 4: Create individual plots for a = 1, 0.5, 0.3 over wave number l.\n"); plot1 := plot(G(l, 1.0), l = lrange, color = red, thickness = 2); plot2 := plot(G(l, .5), l = lrange, color = blue, thickness = 2); plot3 := plot(G(l, .3), l = lrange, color = green, thickness = 2); printf("Step 5: Overlay all plots together with proper labels, legend, and styling.\n"); overlay := display([plot1, plot2, plot3], title = "Overlay G(l) for a = 1, 0.5, 0.3", labels = ["Wave number l", "Growth rate G(l)"], legend = ["a = 1", "a = 0.5", "a = 0.3"], axes = boxed, size = [600, 500]); printf("Step 6: Display the final combined plot.\n"); overlay

Step 1: Define the wave number variable l and parameter range for plotting.
Step 2: Define constants and gain parameters used in the equation.
Step 3: Define gain function G(l,a) using corrected version with l instead of k.

 

proc (l, a) options operator, arrow; 2*Im(sqrt(-a^2*f*d-a*b+(1/2)*l^2-3*a+(1/2)*sqrt(-48*a^3*f*d+4*epsilon*l^3*c-24*a*epsilon*l*c+l^4+4*l^2*c^2-48*a^2*b-12*a*l^2+36*a^2))) end proc

 

Step 4: Create individual plots for a = 1, 0.5, 0.3 over wave number l.
Step 5: Overlay all plots together with proper labels, legend, and styling.
Step 6: Display the final combined plot.

 

 

 


 

Download i_have_another_function_instead_of_m_ewhatthis_mprimes5-5-2025.mw

correct?
 

restart; with(plots); printf("Step 1: Declare symbolic variables used in the gain expression.\n"); k := 'k'; a := 'a'; b := 1; c := 1; d := 1; e := 1; f := 1; printf("Step 2: Define the discriminant D, which arises from the stability analysis of a nonlinear wave.\n"); printf("         This expression comes from the square root part of a complex frequency solution w.\n"); Discr := -18*a^3*d*f-48*a^2*b^2-24*a*c*e*k+4*a*c*k^2+4*c^2*k^2+4*k^4-12*a*k^2+36*a^2; printf("Step 3: Define the gain function G(k,a).\n"); printf("         Gain is defined as the imaginary part of the square root of D.\n"); printf("         If Discr is negative, the square root becomes imaginary , this corresponds to instability.\n"); Gain := proc (k, a) options operator, arrow; Im(sqrt(Discr)) end proc; printf("Step 4: Physically, G(k,a) > 0 implies that perturbations with wave number k grow exponentially.\n"); printf("         This is the signature of modulation instability in nonlinear wave systems.\n"); printf("         The region where G > 0 is the unstable region in the (k,a)-parameter space.\n"); printf("Step 5: Generate a 3D plot over k ∈ [-3, 3] and a ∈ [0.1, 2] to visualize the instability region.\n"); gainPlot := plot3d(Gain(k, a), k = -3 .. 3, a = .1 .. 2, axes = boxed, labels = ["Wave number k", "Parameter a", "Gain G(k,a)"], title = "3D Generalized MI Gain Spectrum", grid = [60, 60], shading = zhue); printf("Step 6: Display the gain surface. Regions with high gain indicate fast-growing perturbations.\n"); gainPlot

Step 1: Declare symbolic variables used in the gain expression.
Step 2: Define the discriminant D, which arises from the stability analysis of a nonlinear wave.
         This expression comes from the square root part of a complex frequency solution w.
Step 3: Define the gain function G(k,a).
         Gain is defined as the imaginary part of the square root of D.
         If Discr is negative, the square root becomes imaginary , this corresponds to instability.
Step 4: Physically, G(k,a) > 0 implies that perturbations with wave number k grow exponentially.
         This is the signature of modulation instability in nonlinear wave systems.
         The region where G > 0 is the unstable region in the (k,a)-parameter space.
Step 5: Generate a 3D plot over k ∈ [-3, 3] and a ∈ [0.1, 2] to visualize the instability region.
Step 6: Display the gain surface. Regions with high gain indicate fast-growing perturbations.

 

 

 


 

Download do3D_plot_w_from_eq_131_mprimes5-02-2025.mw


 

 

 

 

 

 

 

restart; with(plots); with(LinearAlgebra); printf("Step 1: Define the variables: wave number l and parameter a.\n"); l := 'l'; a := 'a'; printf("Step 2: Define the MI gain function G(l,a) = 2 * Im(sqrt(l^4 - 2*a*l^2)).\n"); G := proc (l, a) options operator, arrow; 2*Im(sqrt(l^4-2*a*l^2)) end proc; printf("Step 3: Create a 3D plot over a range of l and a.\n"); gainPlot := plot3d(G(l, a), l = -3 .. 3, a = .1 .. 2, axes = boxed, labels = ["l", "a", "G(l)"], title = "3D MI Gain Spectrum", grid = [50, 50], style = surfacecontour, shading = zhue); printf("Step 4: Display the 3D plot.\n"); gainPlot

Step 1: Define the variables: wave number l and parameter a.
Step 2: Define the MI gain function G(l,a) = 2 * Im(sqrt(l^4 - 2*a*l^2)).
Step 3: Create a 3D plot over a range of l and a.
Step 4: Display the 3D plot.

 

 

 


 

Download modulatio_instability_plot_of_eq_26_paper_3D_plotmprimes5-5-2025.mw

@salim-barzani 
Another parameter name for l  .. must  be k in first  plot ?


 

restart; with(plots); with(LinearAlgebra); printf("Step 1: Define the wave number variable l and parameter range for plotting.\n"); l := 'l'; lrange := -3 .. 3; printf("Step 2: Define values for the parameter a: a = 1, 0.5, and 0.3.\n"); a1 := 1; a2 := .5; a3 := .3; printf("Step 3: Define the growth rate function G(l) = 2 * Im(sqrt(l^4 - 2*a*l^2)).\n"); G := proc (l, a) options operator, arrow; 2*Im(sqrt(l^4-2*a*l^2)) end proc; printf("Step 4: Create individual plots for each value of a.\n"); plot1 := plot(G(l, a1), l = lrange, color = red, thickness = 2); plot2 := plot(G(l, a2), l = lrange, color = blue, thickness = 2); plot3 := plot(G(l, a3), l = lrange, color = green, thickness = 2); printf("Step 5: Overlay all plots together with proper labels, legend, and styling.\n"); overlay := display([plot1, plot2, plot3], title = "Overlay G(l) for a = 1, 0.5, 0.3", labels = ["Wave number l", "Growth rate G(l)"], legend = ["a = 1", "a = 0.5", "a = 0.3"], axes = boxed, size = [600, 500]); printf("Step 6: Display the final combined plot.\n"); overlay

Step 1: Define the wave number variable l and parameter range for plotting.
Step 2: Define values for the parameter a: a = 1, 0.5, and 0.3.
Step 3: Define the growth rate function G(l) = 2 * Im(sqrt(l^4 - 2*a*l^2)).
Step 4: Create individual plots for each value of a.
Step 5: Overlay all plots together with proper labels, legend, and styling.
Step 6: Display the final combined plot.

 

 

 

 

 




Download modulatio_instability_plot_of_eq_26_papermprimes5-5-2025.mw

@salim-barzani 
Probably not a NLSE pde, so another techniques needed for solving ?
With a example of this pde , ai can maybe decipher the code and explains its working

@salim-barzani 
Here it is done for NLSE pde, so yes how it works immediately other pde?
Finding coeffiecent is a hassle, but in this procedure i could make progress finding them with a matrix

experiment with procedure parameters 

@mmcdara 
"I always wonder how to interpret a question like "How to show these two expressions are the same?"
we are working in Maple and trying to get an answer in Maple, it's as simple as that

@nm
i am using maple 2024...

4 5 6 7 8 9 10 Last Page 6 of 73