Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I have data that I've binned in list. I'd like to plot in as a histogram. 

dataplot sort of does it but doesn't give the x-axis that I used but just the bins.

Yes, I know about Histogram from Statistics. To plot 1000000 values I have to enter them all into a list which seems crazy when all I want is a 100 bin histogram. Doing the binning is trivial, but I can't figure out how to plot it with a sensible x-axis (show range used to define the 'histogram')

Hello,

I am experiencing difficulties using my old Maple programs with the newer version. I tried changing the types of inputs and the typesetting level, but it just doesn't work. I would appreciate it if someone could help me overcome my ignorance.

Some simple input is attached with the output.

Hi,

I use the RamdonGraph function quite a bit and wanted to know if it is possible to generate random graphs with specific properties, beyond the typical order, size, connectednes, etc. Specifically, I am interesting in generating eulerian (containing an eulerian circuit), semi-eulerian (containing an eulerian trail) and hamiltonian (containing a spanning cycle)  graphs. Also, the abiltiy to randomly generate graphs that have none of these properties would be helpful.

Dear all 

I have a system of  second order difference equation.

How, can I update the iterate solution and solve the system

System_of_equations.mw

Thank you

Maple (2023.1) opens regularly but I cannot use "open" or "save" or "save as" and after opening Maple I no longer can close it.

That is a big problem for me.

The issue is on my new laptop Lenovo L13 Yoga with Windows 11.

Any suggestion? Thanks

hi i have a problem where maple dosent have a varible theta inside cos and sin and when i give it a size it dosent solve the equtation 

The function f := x -> (x + 1)*(x^2 + (m - 5)*x - 7*m + 2) satifies
solve(discrim(f(x), x) = 0, m) has three solutions 1, -17, -1
How to find the integer numbers a, b, c, d, k, t so that the function 
f := x -> x^3 + (a*m + b)*x^2 + (c*m + d)*x + k*m+t  satifies the equation 

solve(discrim(f(x), x) = 0, m)  has three  integer numbers m?

Consider the function f:=x-> a*x^2 + b*m*x + x^3 + c*m.
I tried
restart;
f := x -> x^3 + a*x^2 + b*m*x + c*m;
solve(f(x) = 0, m);
g := x -> -x^2*(a + x)/(b*x + c);
solve(diff(g(x), x) = 0, x);

restart;
n := 0;
f := x -> -x^2*(a + x)/(b*x + c);
for a from -10 to 20 do
    for b to 20 do
for c from -10 to 20 do
mydelta := a^2*b^2 - 10*a*b*c + 9*c^2;
if 0 < mydelta and type(mydelta, integer) then
x1 := (-b*a - 3*c + sqrt(a^2*b^2 - 10*a*b*c + 9*c^2))/(4*b):
x2 := -(b*a + sqrt(a^2*b^2 - 10*a*b*c + 9*c^2) + 3*c)/(4*b):
x3 := 0:
if type(x1, integer) and type(x2, integer) and nops({0, x1, x2}) = 3 and type(f(x1), integer) and type(f(x2), integer) then n := n + 1; L[n] := [a, b, c]; end if; end if; end do; end do; end do;
L := convert(L, list);


I get
L := [[-10, 1, 6], [-10, 2, 12], [-9, 3, 5], [-8, 1, 10], [-5, 1, 3], [-4, 1, -6], [4, 1, 6], [5, 1, -3], [6, 3, 20], [7, 1, 15], [8, 1, -10], [8, 1, 12], [9, 3, -5], [10, 1, -6], [10, 1, 12], [12, 1, 18], [14, 1, -4], [15, 1, -9], [18, 1, 20], [18, 3, -10], [18, 3, 4], [20, 1, 2]]

With L[1], solve(discrim(x^3 - 10*x^2 + m*x + 6*m, x) = 0, m) ;
The equation has three integer solutions: 0, 12, -500

Dear all 
I have a PDE, with unknown u(t,x,t) ,  zero boundary condition and initial condition given

I converted the equaiton using finite difference to get a system of algebraic equation 

The system is solved at each time step 
I think i have a problem to update the solution inside the loop. 

I hope find the problem or why the numerical solution is different to exact solution at last time 

System_finite_difference.mw

Thank you for your help 

Delay differential equations in Chebfun lists 15 examples "taken from the literature". Many of them can be (numerically) solved in Maple without difficulty, yet when I attempt to solve the  in the above link, Maple's internal solver `dsolve/numeric` just halts with an error. 

plots:-odeplot(dsolve({D(u)(t) + u(t)**2 + 2*u(1/2*t) = 1/2*exp(t), u(0) = u(1/3)}, type = numeric, range = 0 .. 1/3), size = ["default", "golden"]);
Error, (in dsolve/numeric) delay equations are not supported for bvp solvers

Even if I guess an initial (or final) value artificially, the solution is still less reliable (For instance, what is the approximate endpoint value? 0.26344 or 0.2668?): 

restart;
dde := D(u)(t) + u(t)**2 + u(t/2)*2 = exp(t)/2:
x__0 := 2668/10000:
sol0 := dsolve([dde, u(0) = x__0], type = numeric, 'delaymax' = 1/6, range = 0 .. 1/3):
plots['odeplot'](sol0, [[t, u(t)], [t, x__0]], 'size' = ["default", "golden"]);

x__1 := 26344/100000:
sol1 := dsolve([dde, u(1/3) = x__1], type = numeric, 'delaymax' = 1/6, range = 0 .. 1/3):
plots['odeplot'](sol1, [[t, u(t)], [t, x__1]], size = ["default", "golden"]);

Compare:  (Note that the reference numerical solution implies that its minimum should be no less than 0.258 (Is this incorrect?).).

And actually, the only known constraint is simply u(0)=u(⅓) (so neither value is known beforehand). Can Maple process this boundary condition automatically (that is, without the need for manual preprocessing and in absence of any other prior information)?
I have read the help page How to | Numeric Delay Differential Equations and Numerical Solution of Difficult ODE Boundary Value Problems, but it appears that those techniques are more or less ineffective here. So, how do I solve such a "first order nonlinear 'BVP' with pantograph delay" in Maple?

restart;
Pr:=0.71: n:=-1:

eta0:=0.0699;

EQ1:=diff(H(x), x ) - x*diff(F(x), x ) ;
 

EQ2:=(1+x^2)*diff(F(x), x$2) + (3*x + x*F(x)-H(x))*diff(F(x), x) + F(x)^2 + G(x)^2 +2*P(x) + x*diff(P(x), x) ;

EQ3:=(1+x^2)*diff(G(x), x$2) + (3*x + x*F(x)-H(x))*diff(G(x), x) ;

EQ4:=(1+x^2)*diff(H(x), x$2) + (3*x + x*F(x)-H(x))*diff(H(x), x) + (1+F(x))*H(x)- diff(P(x), x);

EQ5:=(1+x^2)*diff(theta(x), x$2) + x*(1-2*n)*diff(theta(x), x) + n^2*theta(x) - Pr*( n*F(x)*theta(x) + ( H(x)-x*F(x) )*diff(theta(x), x)  ) ;


EQ:={EQ1=0, EQ2=0,EQ3=0,EQ4=0 ,EQ5=0}:


IC:={ F(0)=0, G(0)=12, H(0)=0, theta(0)= 1, F(eta0)=0, G(eta0)=12, H(eta0)=0, theta(eta0)= 0, P(0)=0};
 

sol:= dsolve(EQ union IC,numeric,output=Array([0,0.0699]));

ques.mw

HPM.mw

  • Please help me
  • How do I write Homotopy Perturbation method for a partial differential equation for this question in Maple?

Download HPM.mw

 

dS/dt=qnv-alpha_1*S*H-mu_sh*S

dH/dt=lamda_h-alpha_1*S*H-mu_h*H

dI/dt=alpha_1*S*H-beta_1*I-mu_i*I

dS/dt=beta_1*I-delta_1*S-mu_s*S

DATA:

q=0.75; n=15;v=20; alpha_You1=0.001; S=2000; H=3000; mu_sh=0.000000000012; lambda=3000;mu_h=0.94; beta_1=0.125; I=0; mi_i=0.95; delta_1=0.0975; S=0; mu_s=0.029

Good day all,

please I am new Maple user, i used the same code to solve boundary layer flow. Itried to use the same code in solving nanofluid but the solution is not coverging at some point. But the author i want to compared my results with had solution at those points.

Is there any way i can get solution of this model at this with these values?. Please i need your help. Thank you in advance

secod_code.mw

NULL

restart

with*plots; ode1 := (1+1/bet)*(diff(f(eta), eta, eta, eta))-(diff(f(eta), eta))^2+f(eta)*(diff(f(eta), eta, eta))+Gr*(theta(eta)+lambda1*theta(eta)^2)+Gc*(phi(eta)+lambda2*phi(eta)^2)-M*(diff(f(eta), eta)) = 0

(1+1/bet)*(diff(diff(diff(f(eta), eta), eta), eta))-(diff(f(eta), eta))^2+f(eta)*(diff(diff(f(eta), eta), eta))+Gr*(theta(eta)+lambda1*theta(eta)^2)+Gc*(phi(eta)+lambda2*phi(eta)^2)-M*(diff(f(eta), eta)) = 0

(1)

ode2 := (diff(theta(eta), eta, eta))*(1+(4*R*(1/3))*(theta(eta)+CT)^3)/Pr+4*R*(theta(eta)+CT)^2*(diff(theta(eta), eta))^2+f(eta)*(diff(theta(eta), eta))+Nb*(diff(phi(eta), eta))*(diff(theta(eta), eta))+Nt*(diff(theta(eta), eta))^2-de*(f(eta)*(diff(f(eta), eta))*(diff(theta(eta), eta))+f(eta)^2*(diff(theta(eta), eta, eta))) = 0

(diff(diff(theta(eta), eta), eta))*(1+(4/3)*R*(theta(eta)+CT)^3)/Pr+4*R*(theta(eta)+CT)^2*(diff(theta(eta), eta))^2+f(eta)*(diff(theta(eta), eta))+Nb*(diff(phi(eta), eta))*(diff(theta(eta), eta))+Nt*(diff(theta(eta), eta))^2-de*(f(eta)*(diff(f(eta), eta))*(diff(theta(eta), eta))+f(eta)^2*(diff(diff(theta(eta), eta), eta))) = 0

(2)

ode3 := diff(phi(eta), eta, eta)+Pr*Le*(diff(phi(eta), eta))*f(eta)+Nt*(diff(theta(eta), eta, eta))/Nb-Pr*Le*dc*(f(eta)*(diff(f(eta), eta))*(diff(phi(eta), eta))+f(eta)^2*(diff(phi(eta), eta, eta))) = 0

diff(diff(phi(eta), eta), eta)+Pr*Le*(diff(phi(eta), eta))*f(eta)+Nt*(diff(diff(theta(eta), eta), eta))/Nb-Pr*Le*dc*(f(eta)*(diff(f(eta), eta))*(diff(phi(eta), eta))+f(eta)^2*(diff(diff(phi(eta), eta), eta))) = 0

(3)

bcs1 := f(0) = 0, (D(f))(0) = 1+xi*((D^2)(f))(0), (D(f))(6) = 0, theta(6) = 0, phi(0) = 1+`&varsigma;`*(D(phi))(0), theta(0) = 1+Zeta*(D(theta))(0), phi(6) = 0

f(0) = 0, (D(f))(0) = 1+xi*(D(f))(0)^2, (D(f))(6) = 0, theta(6) = 0, phi(0) = 1+varsigma*(D(phi))(0), theta(0) = 1+Zeta*(D(theta))(0), phi(6) = 0

(4)

NULL

 

L := [0., .1, .4, 1]

[0., .1, .4, 1]

(5)

 
  

NULL


  for k to 10 do
      sol_All := dsolve
                 ( eval
                   ( {bcs1, ode1, ode2,ode3},
                     [xi= L[k],R=1, CT=0.2, Gr=0.5, Gc=0.5, lambda1=0.2, lambda2=0.2, Pr=0.72, Nb=0.5,  Le=1, dc=0.2, de=0.2, Nt=0.5, Zeta=0.5, varsigma=0.5, M=1.5, bet=1.5]
                   ),
                   [f(eta), theta(eta),phi(eta)],
                   numeric,
                   output = listprocedure
                 );
      Y_sol || k := rhs(sol_All[5]);
      YP_sol || k := -rhs(sol_All[6]);

feta || k := rhs(sol_All[4]);
      fpeta || k := rhs(sol_All[3]);

phieta || k := rhs(sol_All[8]);
      phipeta || k := rhs(sol_All[7])
  end do:

Error, (in dsolve/numeric/bvp) initial Newton iteration is not converging

 

for k to 10 do L[k], [(Y_sol || k)(0), (YP_sol || k)(0)] end do

0., [Y_sol1(0), YP_sol1(0)]

 

.1, [Y_sol2(0), YP_sol2(0)]

 

.4, [Y_sol3(0), YP_sol3(0)]

 

1, [Y_sol4(0), YP_sol4(0)]

 

Error, invalid subscript selector

 

for k to 10 do L[k], [(feta || k)(0)] end do

0., [feta1(0)]

 

.1, [feta2(0)]

 

.4, [feta3(0)]

 

1, [feta4(0)]

 

Error, invalid subscript selector

 

NULL

Error, mismatched or missing bracket/operator

"for k  from 1 to  10 do L[k], ([phieta ||k(0),phipeta||k(0)]); od; "

 

NULL

  plot( [ seq((Y_sol||j)(eta), j = 1..6)],
         eta = 0 .. 6,
         labels = [eta, theta(eta)],
         axes = boxed
      );
plot( [ seq((YP_sol||j)(eta), j = 1..6)],
         eta = 0 .. 8,
         labels = [eta, thetaprime(eta)],
         axes = boxed
      );

 plot( [ seq((feta||j)(eta), j = 1..6)],
         eta = 0 .. 8,
         labels = [eta, f(eta)],
         axes = boxed
      );
  plot( [ seq((fpeta||j)(eta), j = 1..6)],
         eta = 0 .. 5,
         labels = [eta, fprime(eta)],
         axes = boxed
      );
plot( [ seq((phipeta||j)(eta), j = 1..6)],
         eta = 0 .. 5,
         labels = [eta, phiprime(eta)],
         axes = boxed
      );

plot( [ seq((phieta||j)(eta), j = 1..6)],
         eta = 0 .. 5,
         labels = [eta, phi(eta)],
         axes = boxed
      );

Warning, expecting only range variable eta in expression Y_sol1(eta) to be plotted but found name Y_sol1

 

 

Warning, expecting only range variable eta in expression YP_sol1(eta) to be plotted but found name YP_sol1

 

 

Warning, expecting only range variable eta in expression feta1(eta) to be plotted but found name feta1

 

 

Warning, expecting only range variable eta in expression fpeta1(eta) to be plotted but found name fpeta1

 

 

Warning, expecting only range variable eta in expression phipeta1(eta) to be plotted but found name phipeta1

 

 

Warning, expecting only range variable eta in expression phieta1(eta) to be plotted but found name phieta1

 

 

How to conver a patial differetial equation to ordinary differential equation with or without dchange?
 

restart

declare(u(x, y, t), v(x, y, t), T(x, y, t), C(x, y, t), eta(x, y, t), psi(x, y, t), f(eta), theta(eta), phi(eta));

declare(u(x, y, t), v(x, y, t), T(x, y, t), C(x, y, t), eta(x, y, t), psi(x, y, t), f(eta), theta(eta), phi(eta))

(1)

eta := proc (x, y, t) options operator, arrow; y/(nu*t+nu*x/U[w])^(1/2) end proc:

eq1 := diff(T(x, y, t), t)+u*(diff(T(x, y, t), x))+v*(diff(T(x, y, t), y))-sigma*(diff(T(x, y, t), y, y))-epsilon*D[B]*(diff(T(x, y, t), y))*(diff(C(x, y, t), y)) = 0

diff(T(x, y, t), t)+U[w]*(D(f))(y/(nu*t+nu*x/U[w])^(1/2))*(diff(T(x, y, t), x))+(-(1/2)*f(y/(nu*t+nu*x/U[w])^(1/2))*nu/(nu*t+nu*x/U[w])^(1/2)+(1/2)*(D(f))(y/(nu*t+nu*x/U[w])^(1/2))*y*nu/(nu*t+nu*x/U[w]))*(diff(T(x, y, t), y))-sigma*(diff(diff(T(x, y, t), y), y))-epsilon*D[B]*(diff(T(x, y, t), y))*(diff(C(x, y, t), y)) = 0

(2)

``


 

Download pde_to_ode.mw

Dear Maple experts,

I am running a Maple code with several lines/ curves in a plot.

For two of the curves, I use style=pointline. But in the legend the symbols on the lines are not shown. Can you advise how we can make them appear?

I have attached the file. Thank you so much! 

Download LegendPlot.mw

First 10 11 12 13 14 15 16 Last Page 12 of 2097