Maple 2022 Questions and Posts

These are Posts and Questions associated with the product, Maple 2022

I am slightly confused as I can't apply the seemingly correct function to a sequence. It seems like modp does not like my inverse. But I am not aware of any other way of finding the modular inverse.  

a := i -> (1025 - 2^(10 - 2^i))^(-1) mod (1025 - 2^(10 - 2*2^i));

proc (i) options operator, arrow; `mod`(1/(1025-2^(10-2^i)), 1025-2^(10-2*2^i)) end proc

(1)

a(1);

5

(2)

a(2);

17

(3)

map(i -> i + 1, {seq(1 .. 4)});

{2, 3, 4, 5}

(4)

map(i -> 1/(1025 - 2^(10 - 2^i)) mod (1025 - 2^(10 - 2*2^i)), {seq(1 .. 4)});

Error, invalid input: modp received 65599/64, which is not valid for its 2nd argument, m

 

map(a, {seq(1 .. 4)});

Error, invalid input: modp received 65599/64, which is not valid for its 2nd argument, m

 

NULL

NULL

Download example.mw

how I can plot phi[2] as a contour like attached figure?

tez-1.mw


 

restart

``

beta := 2.5; lambda := 0.1e-1; b := Pi; a := Pi; alpha := 1; y[1] := 1.5; y[2] := 1.5; x[1] := -1; x[2] := 1; Q[1] := 40; Q[2] := 35

2.5

 

0.1e-1

 

Pi

 

Pi

 

1

 

1.5

 

1.5

 

-1

 

1

 

40

 

35

(1)

NULL

NULL

v := (2*n-1)*Pi/(2*b)

n-1/2

(2)

Delta := exp(2*v*a)*(alpha*v+beta)*(1+lambda)-(1-lambda)*(alpha*v-beta)

1.01*exp(2*(n-1/2)*Pi)*(n+2.000000000)-.99*n+2.970000000

(3)

g[22] := ((alpha*v+beta)*((1+lambda)*exp(-v*abs(x-xi))+(-1+lambda)*exp(-v*(x+xi)))*exp(2*v*a)+(alpha*v-beta)*((1+lambda)*exp(-v*(x+xi))+(-1+lambda)*exp(-v*abs(x-xi))))/(2*v*Delta)

g[21] := ((alpha*v+beta)*exp(v*(2*a+xi))+(alpha*v-beta)*exp(-v*xi))*exp(-v*x)/(v*Delta)

NULL

u[2] := int(2*g[21]*Q[1]*Dirac(xi-x[1])*sin(n*Pi*y[1]/b)/b, xi = -a .. 0)+int(2*g[22]*Q[2]*Dirac(xi-x[2])*sin(n*Pi*y[2]/b)/b, xi = 0 .. infinity)

NULL

phi[2] := sum(u[2](x)*sin(v*y), n = 1 .. 30)

NULL

``

plot3d(phi[2], x = 0 .. 5, y = 0 .. b)

 

NULL


 

Download tez-1.mw


 

restart

``

beta := 2.5; lambda := 0.1e-1; b := Pi; a := Pi; alpha := 1; y[1] := 1.5; y[2] := 1.5; x[1] := -1; x[2] := 1; Q[1] := 40; Q[2] := 35

2.5

 

0.1e-1

 

Pi

 

Pi

 

1

 

1.5

 

1.5

 

-1

 

1

 

40

 

35

(1)

NULL

NULL

v := (2*n-1)*Pi/(2*b)

n-1/2

(2)

Delta := exp(2*v*a)*(alpha*v+beta)*(1+lambda)-(1-lambda)*(alpha*v-beta)

1.01*exp(2*(n-1/2)*Pi)*(n+2.000000000)-.99*n+2.970000000

(3)

g[22] := ((alpha*v+beta)*((1+lambda)*exp(-v*abs(x-xi))+(-1+lambda)*exp(-v*(x+xi)))*exp(2*v*a)+(alpha*v-beta)*((1+lambda)*exp(-v*(x+xi))+(-1+lambda)*exp(-v*abs(x-xi))))/(2*v*Delta)

g[21] := ((alpha*v+beta)*exp(v*(2*a+xi))+(alpha*v-beta)*exp(-v*xi))*exp(-v*x)/(v*Delta)

NULL

u[2] := int(2*g[21]*Q[1]*Dirac(xi-x[1])*sin(n*Pi*y[1]/b)/b, xi = -a .. 0)+int(2*g[22]*Q[2]*Dirac(xi-x[2])*sin(n*Pi*y[2]/b)/b, xi = 0 .. infinity)

NULL

phi[2] := sum(u[2](x)*sin(v*y), n = 1 .. 30)

NULL

``

plot3d(phi[2], x = 0 .. 5, y = 0 .. b)

 

NULL


 

Download tez-1.mw

 

 

How to get same graph from maple with finite difference method for differential equations 

I m new here how to plot this i have seen related posts no where given clear idea for FDM method

plase help me to get the results Thank you

 

 

 For the command LieAlgebras[RootSpaceDecomposition] I don't understand what the command return, I read the help and see the examples but still not understanding.

 

for example it returns:

RSD := RootSpaceDecomposition(CSA);

RSD := table([[-2, -1] = E31, [2, 1] = E13, [1, 2] = E23, [1, -1] = E12, [-1, 1] = E21, [-1, -2] = E32])

I don't understand what means [-2, -1] even they said that is the root but I know that a root is in h* so it must be only a number not a vector.

I found another big problem. 

In 2022, I get Error, (in SolveTools:-Polynomial) too many levels of recursion when using alias(seq(c[k] = _C||k, k = 0..10)); at the top of my code and the solution to the ode has c[2],c[3] etc.. as constants of integration.

This solution was given by Kitonum in this answer

I had this for years in the code (i.e. the alias) code.

In Maple 2022 the following gives the above exception error from odetest. I am using 2022, because in 2023 it just hangs on the same code.  

If I remove the alias code, no error shows. (solution is wrong, but that is different story). 

Also, If I remove the alias code, 2023 no long hangs!  

restart;

#kernelopts('assertlevel'=2):

alias(seq(c[k] = _C||k, k = 0..10));

c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], c[8], c[9], c[10]

ode:=diff(diff(y(x),x),x)+4*diff(y(x),x)+12*y(x) = 80*sin(2*x);
sol:=y(x) = -10*exp(-1/2*2^(1/2)*arctan(sin(2*2^(1/2)*x)/cos(2*2^(1/2)*x)))*(c[3]*cos(2*2^(1/2)*x)+c[2]*sin(2*2^(1/2)*x))*((-1/10*exp(4*I*2^(1/2)*x)+1/10)*c[2]-1/10*I*c[3]*exp(4*I*2^(1/2)*x)-1/10*I*c[3])/((exp(4*I*2^(1/2)*x)-1)*c[2]+I*c[3]*exp(4*I*2^(1/2)*x)+I*c[3])*c[1]-10*I*exp(-1/2*2^(1/2)*arctan(sin(2*2^(1/2)*x)/cos(2*2^(1/2)*x)))*(c[3]*cos(2*2^(1/2)*x)+c[2]*sin(2*2^(1/2)*x))*(cos(2*x)-sin(2*x))*exp(2*I*2^(1/2)*x)*exp(2*I*2^(1/2)*x)^(-1/2*I*2^(1/2))/((exp(4*I*2^(1/2)*x)-1)*c[2]+I*c[3]*exp(4*I*2^(1/2)*x)+I*c[3]);

odetest(sol,ode);

diff(diff(y(x), x), x)+4*(diff(y(x), x))+12*y(x) = 80*sin(2*x)

y(x) = -10*exp(-(1/2)*2^(1/2)*arctan(sin(2*2^(1/2)*x)/cos(2*2^(1/2)*x)))*(c[3]*cos(2*2^(1/2)*x)+c[2]*sin(2*2^(1/2)*x))*((-(1/10)*exp((4*I)*2^(1/2)*x)+1/10)*c[2]-((1/10)*I)*c[3]*exp((4*I)*2^(1/2)*x)-((1/10)*I)*c[3])*c[1]/((exp((4*I)*2^(1/2)*x)-1)*c[2]+I*c[3]*exp((4*I)*2^(1/2)*x)+I*c[3])-(10*I)*exp(-(1/2)*2^(1/2)*arctan(sin(2*2^(1/2)*x)/cos(2*2^(1/2)*x)))*(c[3]*cos(2*2^(1/2)*x)+c[2]*sin(2*2^(1/2)*x))*(cos(2*x)-sin(2*x))*exp((2*I)*2^(1/2)*x)*(exp((2*I)*2^(1/2)*x))^(-((1/2)*I)*2^(1/2))/((exp((4*I)*2^(1/2)*x)-1)*c[2]+I*c[3]*exp((4*I)*2^(1/2)*x)+I*c[3])

Error, (in SolveTools:-Polynomial) too many levels of recursion

 

Download odetest_error_june_15_2023.mw

Why using the alias line above causes this error?  If you remove the alias line, you will see it completes with no error.

But it hangs in 2023. I am no longer using 2023 but went back to 2022 due to too many hangs in 2023. I wonder now if it because of this alias line I had there all the time.  I will remove now and see if this solves some of the hangs I had in 2023.

Anyone can shed some more light on what is going on?

Windows 10.

I want to plot phase portrait for 4 dimension. help me

4_equation_phase_portrait.mw

thank youvery much

 I run the attached code, but after waiting for a few minutes, there is no response, does anyone know the reason?

 It only shows Evaluating!!!!

 sy01.mw

120523_problem_parallel.mw

Last execution block is not producing any output. Why?

The 3x3 nonlinear system I am trying to solve is already a stylized version of my problem, as I already:

  1. Calibrated my equations before attempting to solve for them (search for "Calib_1" in my script)
  2. Split the original 6x6 system into two 3x3 sub-systems (since 3 out of 6 variables only appear in 3 out of 6 equations) and solved for one sub-system

What else can you think of? Should I instead use the parallel solver on the whole 6x6 system rather than just the unsolved 3x3 sub-system?

How to find, if exist, singular solutions? That is, some valuation of some parameters that will yield a solution that cannot be obtained by applying the same valuation to a general solution. Carl Love (who I cannot tag) once mentioned: "The parameter valuations that lead to singular solutions can often be guessed by using valuations that would produce zeros in denominators in the general solution. A singular solution can't be expressed as any instantiation of a generic symbolic solution. By instantiation I mean an assigment of numeric values to some parameters. Here's an example:"

#2x2 matrix and 2x1 vector. 5 parameters (a, b, d, x, y). The 2 decision variables are
#unseen and unnamed in this pure matrix-vector form. Their values are the two entries 
#in the solution vectors S0 and S1.

A:= <a, b; 0, d>;  B:= <x, y>;

#Get a generic solution:
S0:= LinearAlgebra:-LinearSolve(A, B);

#Instantiate 3 parameters (a, d, y) to 0 and solve again:
S1:= LinearAlgebra:-LinearSolve(eval([A, B], [a, d, y]=~ 0)[]);

#Note that no possible instantiation of S0 can produce S1.

Thank you!

I have this tedious looking function that I want to write in terms of the other expression but the command i usually use does not work here because the expressions are not polynomials. I am wondering if there is an alternative to doing this manually.
Temp.mw

Hi everyone
how can i overcome this error to solve this ODE ? tnx in advanced.

restart

U := 1:L := 10:k := 1:Dea := 0.00001:CA0 := 10:Pe := U*L/Dea:Da := k*CA0^2/Dea:

Eq1 := diff(CA(x), x, x) - Pe*diff(CA(x), x)/L = Da*L*CA(x)^2/CA0;

diff(diff(CA(x), x), x)-100000.0000*(diff(CA(x), x)) = 10000000.00*CA(x)^2

(1)

BCs := CA(0) = CA0, D(CA)(L) = 0

CA(0) = 10, (D(CA))(10) = 0

(2)

ans := dsolve([Eq1, BCs], numeric);

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

 

 

Download Hw.mw

Please check: Finding_Chi_Version1.mw

My end goal is to find the following three expressions:

chi_1 := collect(X_A,[nnu[1],nnu[2]]);

chi_2 := collect(X_B,[nnu[1],nnu[2]]);

chi_3 := collect(X_C,[nnu[1],nnu[2]]);

I expect these three expressions to be linear combinations of random variables nu[1] (nnu[1]) and nu[2] (nnu[2]).

While calling solve(), I encounter this error:

Error, (in assuming) when calling 'SolveTools:-Engine:-Dispatch'. Received: 'badly formed input to solve: not fully algebraic'

What is exactly the issue here? If it can help you answer my doubt, that argmin expression I defined is composed by conditional means and variances which I computed as in here: conditional_distributions_Version1.mw

The two formulas I am trying to implement in Maple are conditional distribution of a multivariate normal distributionAm I already doing any mistake in conditional_distributions_Version1.mw? An alternative interpretation of mine for these two formulas is: conditional_distributions_Version2.mw. Please check the light-blue-highlighted differences in the conditional variance calculation. This alternative interpretation leads to Finding_Chi_Version2.mw, which I also can't solve() (solver stuck in "evaluating") but at least I don't get the error mentioned above...

I am a bit lost to be honest: Is Finding_Chi_Version1 or Finding_Chi_Version2 the correct interpretation? 

Thanks!

I can derive a symbolic solution by hand for the following ODE, but cannot get Maple to do it for me.  Any tricks?

restart;

Velocity field, -infinity < x and x < infinity,  t > 0.

v := (x,t) -> piecewise(x <= -t, 0, x < t, 1 - 1/2*(1 - x/t));

v := proc (x, t) options operator, arrow; piecewise(x <= -t, 0, x < t, 1/2+(1/2)*x/t) end proc

Position x(t):

de := diff(x(t),t) = v(x(t),t);

de := diff(x(t), t) = piecewise(x(t) <= -t, 0, x(t) < t, 1/2+x(t)/(2*t))

Initial condition, assuming a > 0

ic := x(0) = -a;

x(0) = -a

Symbolic solution, calculated by hand:

x__exact := t -> piecewise(t < a, -a, t - 2*sqrt(t)*sqrt(a));

x__exact := proc (t) options operator, arrow; piecewise(t < a, -a, t-2*sqrt(t)*sqrt(a)) end proc

Verify exact solution by comparing it against the numeric solution for some a > 0:

a := 3;  # any a>0 should do
dsol := dsolve({de,ic}, numeric):
plots:-odeplot(dsol, t=0..5);   # dsolve solution
plot(x__exact(t), t=0..5);      # symbolic solution (calculated by hand)
a := 'a';

3

a

Can Maple's dsolve find the exact solution?  This one returns empty in Maple 2022:

dsolve({de, ic}) assuming a > 0, t > 0;

Download ode-piecewise.mw

 

perturb_mag_current_density_2.mw

I am trying to calculate the electric field E induced in a vibrating cantilever of conductive material, oscillating in the field of a permanent magnet.  However, I am having some difficulty getting pdsolve to work the way I want it to.  I'm also not sure if the partial differential eqations I derived from Maxwell's equations are correct, or if the boundary conditions for the electric field in the cantilever are correct.  Currently pdsolve gives me no solutions, which makes me think that either my PDEs or my BCs are not correct.  It may be that I need to try some sort of numerical method as well.  I am assuming that the z component of the electric field is just 0.  My third PDE comes from setting the divergence of the electric field to 0.  My first two PDEs come from the vector laplacian and its relation to the divergence and curl:

Laplacian * E = Div(E) -Curl(Curl(E))

The x and y components of this should be my first and second PDE, respectively.  Note that in this equation the divergence of E is 0, and the curl of E is -dB/dt, where B is the magnetic field.

My boundary conditions are simply that the components of the electric field at the surface of the cantilever is always tangent to the surface.

I have tried various simplifications, such as setting the right hand side of the PDEs to 0, and still I don't get any solution.

My question:  Are my PDEs and BCs sensible?  And if so, what do I need to do with pdsolve to get a proper solution?

Hello!

I have changed the the global character size from 12 to 14 but it is not stable. Suddenly size 12 is coming up when a try to copy a row to a another row in the same worksheet.

It is very annoying!!

Any tips????

Regards

Kjell

Just experienced a strange response from Maple when I changed the Font anti-aliasing to enabled.

With Font anti-aliasing disabled I ran evalf(Pi,100) and Maple returned 100 digits - no problem.  I then did some other errands in other programs leaving Maple idle, when I came back I thought I would change anti-aliasing to enabled and see if maybe that's the reason why some users are experiencing icons disappearing etc..

Well I re entered and evalueated evalf(Pi,100) and Maple only output 10 digits.  Huh??? What!? Why?  changed font anti-aliasing back but no joy.  So I closed Maple and I got a pop up

Maybe it was hiding behind Maple I don't know but I don't think it was there until I closed Maple.  It seems this OpenJDK platform I believe is causing a lot of Maple issues.

Whoa!  That's really odd.  My restart was with Maple Font anti-aliasing enabled I performed a evalf(Pi,100) and no problem.  I changed to Font anti-aliasing disabled and evalf(Pi,100) presented me with 10 digits!

What the heck is going on.  This font anti-aliasing enabled caused my Maple to slow down as the screen filled up (as I recorded in a earlier post months ago) and now toggling anti-aliasing causes the outputs to not work as expected.  It's gotta be an open JDK issue. (FYI closing Maple did not produce the same pop-up as earlier - I expect idling maple for a while might)

1 2 3 4 5 6 7 Last Page 3 of 39