MaplePrimes Questions

This worksheet loses contact with the kernel. I asked Tech Support. How do I report a bug?

Hung.mw

The last line was a typo, but, it should not lose contact with the kernel...

After executing the print statement,

> 1

produces the error message.

Tom Dean

For example, here are two equations containing trigonometric functions (Note that they do not form one system!): 

restart; # There are more examples, yet for the sake of briefness, they are omitted here. 
eqn__0 := cos(x)*cos(y)*cos(x + y) = 2*(sin(x)*sin(y) - 1)*2*(sin(x)*sin(x + y) - 1)*2*(sin(y)*sin(x + y) - 1):
eqn__1 := (cos(x + y) - (cos(x) + cos(y)) + 1)**2 + 2*cos(x)*cos(y)*cos(x + y) = 0:

Unfortunately, none of 

(* Tag0 *) RealDomain:-solve(eqn__0, {y, x}):
(* Tag1 *) solve(eqn__0, {y, x}) assuming y + x >= 0, (y, x) <=~ Pi:
(* Tag2 *) RealDomain:-solve(eqn__1, {y, x}):
(* Tag3 *) solve(eqn__1, {y, x}) assuming y + x >= 0, (y, x) <=~ Pi:

outputs concise solutions.
Using `plot3d`, it is easy to check that when "And(y + x >= 0, (y, x) <=~ Pi)", “{y = Pi/2, x = 0}, {y = Pi/3, x = Pi/3}, {y = 0, x = Pi/2}, {y = Pi/2, x = Pi/2}” is both the only solution to "eqn__0" and the only solution to "eqn__1". But how to get Maple to do so without manual intervention?

Edit. The main purpose is to automatically find the generic solutions to each of the two equations (Tag0 and Tag2) (separately). Now that the cosine and sine functions are both periodic with period 2π and both (lhs - rhs)(eqn__0) and (lhs - rhs)(eqn__1) are even symmetric, it is enough to focus only on the region y + x ≥ 0 ∧ (y, x) ≤~ Pi. So, in theory, a second-best workaround should be Tag1 and Tag3. However, why is Maple still unable to find the four exact solutions above?

This could be new bug in 2023.2.1, could someone else confirm if it is in earlier versions 2023.2 ?

restart;
ode:=diff(y(x),x)-y(x)^2-m*y(x)*cot(x)-b^2*sin(x)^(2*m) = 0;
DEtools:-symgen(ode)

Error, (in trig/reduce) too many levels of recursion

After about 30 seconds.

I tried it in Maple 2022.2  I waited for more than 10 minutes and it was still running.  If you think it is new bug, will send email to Maple support.

The big problem with these Maple internal errors, is that it is not possible to trap them with try/catch. So the program simply crashes and there is no workaround.

``

restart;

35880

interface(version)

`Standard Worksheet Interface, Maple 2023.2, Windows 10, November 24 2023 Build ID 1762575`

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1615 and is the same as the version installed in this computer, created 2023, November 29, 17:28 hours Pacific Time.`

ode:=diff(y(x),x)-y(x)^2-m*y(x)*cot(x)-b^2*sin(x)^(2*m) = 0;

diff(y(x), x)-y(x)^2-m*y(x)*cot(x)-b^2*sin(x)^(2*m) = 0

DEtools:-symgen(ode);

Error, (in tools/map) too many levels of recursion

 


reported to Maple support

Download trig_reduce_recursion_dec_20_2023.mw

sachi_stream_error_3d.mw  3d_sachin_p1.mw

Dear sir, there is something missing why it is not able to evaluate?

By reference of some posts I have implemented to my ODE but not getting the graph.

what is the mistake in both files?

Hello,

At the moment I am focused on learning the Math (Calculus, then Differential Equations) and have been using Maple primarily to check the answers I got on a textbook problem.

I learn best by example but I realize that not knowing how to read the help pages really is a disadvantage.  I would like to learn how to use this amazing application more effectively in the future.  Can anyone give me tips on learning Maple with the help pages?  I got a primer on Maple but that hasn't been enough because I haven't used Maple enough.  How did you learn Maple and how do you think one can do this more quickly?

Thank You in advance.

 I have been trying to run a code to plot a region of stability for a numerical method for solving IVPs. Apart from the fact that it is taking time to run, it is giving me errors: 'Error; (inplots/ implicitplot/factor) and  Error; (inplot/ iplot2d:-Levels ) could not evaluate expression' 

 Attached here is the code:

K=4

NULL

with(LinearAlgebra):

NULL

P1 := simplify(A1-ScalarMultiply(A3, z)-ScalarMultiply(A5, z^3)):

Error, (in plots/implicitplot/factor) invalid input: the following extra unknowns were found in the input expression: {P5[4]}

Error, (in plot/iplot2d:-Levels) could not evaluate expression

NULL

Download RAS(TDFFAM).mw

Hello,

I am trying to learn how to use SurfaceInt in the VectorCalculus package to check my work on the even numbered problems in my Calculus book.

I can't seem to figure out how to define any surface in general.

One example in the help page is

SurfaceInt(1, [x, y, z] = Surface(<r, s, t>, s = 0 .. Pi, t = 0 .. 2*Pi, coords = spherical)) assuming (0 < r)

I can decode this one but can someone tell me what the word Surface is supposed to be? I think the surface is defined parametrically.  I can't find this command(?) or option(?) in the help pages. I am not even sure what part of the syntax it would be.

I don't want to ask for a lesson from anyone (time is so precious and valuable).  I just need a pointer to learn how to use "Surface."  Where is it defined?  What concepts in maple do I need to decode and also construct a Surface for the SurfaceInt command?  Do I just need to learn how to do paramterizations in Maple?

Thank You in advance

I have this image on a vase and I want to flatten it using Maple to see how it would look on a flat piece of paper.  How can we go about it. 

The image is attached.

Image1-Greek.zip

Please help me check why my minmax optimization is not having these errors:

Error, (in minimize/cell/function/multidependence/univariate) 

Error, n should be an integer for integer[n]
Error, (in minimize/cell/function/multidependence/univariate) invalid input: `minimize/continuous` expects its 2nd argument, yFP, to be of type {name, list(name)}, but received `X[4,3]` = -infinity

Error, invalid input: `convert/Array` expects its 1st argument, A, to be of type {Array, Matrix, Vector, array, sequential}, but received 0

my design optimization objective function is to carry out a minimize the maximum assignments from vector B overlap  between any two members in A , such that in vector A all members fall under a group and there is no duplication of membership, further   a member from each group representing the group  is to be assigned to vector B such that only one member of a group should be assigned each member of vector B, while ensuring that every member in vector B has represntation from every group in vector A. 

with(Optimization); num_profiles := 4; num_websites := 3; num_groups := 2; X := Array(1 .. num_profiles, 1 .. num_websites, datatype = integer[0 .. 1]); obj := minimize(max(seq(add(X[i, j], j = 1 .. num_websites), i = 1 .. num_profiles))); constraints := {seq(add(add(X[i, j], i = k*num_profiles/num_groups+1 .. (k+1)*num_profiles/num_groups), k = 0 .. num_groups-1) = 1, j = 1 .. num_websites)}; sol := Optimization[Minimize](obj, constraints, assume = binary); optimal_assignment := convert(sol[1], Array); for i to num_profiles do for j to num_websites do if optimal_assignment[i, j] = 1 then print("Profile ", i, " assigned to Website ", j) end if end do end do; print("Objective Value (Minimized Maximum Website Overlap): ", sol[2])

"Objective Value (Minimized Maximum Website Overlap): ", [obj = 0, X[1, 1] = 0, X[1, 2] = 0, X[1, 3] = 0, X[2, 1] = 0, X[2, 2] = 0, X[2, 3] = 1, X[3, 1] = 1, X[3, 2] = 1, X[3, 3] = 0, X[4, 1] = 0, X[4, 2] = 0, X[4, 3] = 0]

(1)

``

Download firstworkablecode.mw

Hi. I need some help.... Where can i find my purchase Code to activate? Without it i can not work now.. 

I am trying to decompose an isprime into sum of 2 squares.
Can you tell me why yhse procedure are not goog.
                       

Sumof2Squares:= proc(p::And(prime, satisfies(p-> irem(p,4)=1)))
local x, y:= 1;
   x:= mods(Roots(x^2+y^2), p)[2,1];
   while x^2+y^2 > p do
      (x,y):= FermatDescent(x,y,p)
   end do;
   (x,y)
end proc:

FermatDescent:= proc(x::posint, y::posint, p::posint)
local 
   m:= (x^2+y^2)/p,
   a:= mods(x,m),  
   b:= mods(y,m);

   (abs((a*x+b*y)/m), abs((a*y-b*x)/m))
end proc:
   
trace(FermatDescent);

Sumof2Squares(1973);
Thank you.

My equation is

at  x=0

I got g'(0) in my previous equation,

,,

 

And all the parameters are mensioned in the worksheet.Then how to plot eta.Help me.

Thank you

FE-2.mw

restart:

with(LinearAlgebra):

with(plots):

with(Maplets[Examples]):

with(Student[Calculus1]):

Digits:=100:

 

NULL

``

``lambda[C] := .5

.5

(1)

lambda[L] := .5

.5

(2)

beta := 0.1e-1

0.1e-1

(3)

alpha := .5

.5

(4)

NULL

X[0]:=0;X[1]:=0.5;X[2]:=1;

1

(5)

 #A: Governing Equations:

 EQ[1] := lambda[C]^2*(diff(v[1](x), x, x, x, x, x, x))-(diff(v[1](x), x, x, x, x))

.25*(diff(diff(diff(diff(diff(diff(v[1](x), x), x), x), x), x), x))-(diff(diff(diff(diff(v[1](x), x), x), x), x))

(6)

EQ[2] := lambda[C]^2*(diff(v[2](x), x, x, x, x, x, x))-(diff(v[2](x), x, x, x, x))

.25*(diff(diff(diff(diff(diff(diff(v[2](x), x), x), x), x), x), x))-(diff(diff(diff(diff(v[2](x), x), x), x), x))

(7)

EQ[3] := s[1](x)+diff(v[1](x), x)-lambda[C]^2*(diff(s[1](x), x, x)+diff(v[1](x), x, x, x))-beta*(diff(v[1](x), x, x, x)-lambda[C]^2*(diff(v[1](x), x, x, x, x, x)))

s[1](x)+diff(v[1](x), x)-.25*(diff(diff(s[1](x), x), x))-.26*(diff(diff(diff(v[1](x), x), x), x))+0.25e-2*(diff(diff(diff(diff(diff(v[1](x), x), x), x), x), x))

(8)

``

EQ[4] := s[2](x)+diff(v[2](x), x)-lambda[C]^2*(diff(s[2](x), x, x)+diff(v[2](x), x, x, x))-beta*(diff(v[2](x), x, x, x)-lambda[C]^2*(diff(v[2](x), x, x, x, x, x)))

s[2](x)+diff(v[2](x), x)-.25*(diff(diff(s[2](x), x), x))-.26*(diff(diff(diff(v[2](x), x), x), x))+0.25e-2*(diff(diff(diff(diff(diff(v[2](x), x), x), x), x), x))

(9)

assign(dsolve({EQ[1], EQ[2], EQ[3], EQ[4]}, {s[1](x), s[2](x), v[1](x), v[2](x)}))

NULL

V[1] := subs(_C1 = A[1], _C2 = A[2], _C3 = A[3], _C4 = A[4], _C5 = A[5], _C6 = A[6], _C7 = A[7], _C8 = A[8], _C9 = A[9], _C10 = A[10], _C11 = A[11], _C12 = A[12], _C13 = A[13], _C14 = A[14], _C15 = A[15], _C16 = A[16], v[1](x))

NULL

V[2] := subs(_C1 = A[1], _C2 = A[2], _C3 = A[3], _C4 = A[4], _C5 = A[5], _C6 = A[6], _C7 = A[7], _C8 = A[8], _C9 = A[9], _C10 = A[10], _C11 = A[11], _C12 = A[12], _C13 = A[13], _C14 = A[14], _C15 = A[15], _C16 = A[16], v[2](x))

NULL

S[1] := subs(_C1 = A[1], _C2 = A[2], _C3 = A[3], _C4 = A[4], _C5 = A[5], _C6 = A[6], _C7 = A[7], _C8 = A[8], _C9 = A[9], _C10 = A[10], _C11 = A[11], _C12 = A[12], _C13 = A[13], _C14 = A[14], _C15 = A[15], _C16 = A[16], s[1](x))

NULL``

S[2] := subs(_C1 = A[1], _C2 = A[2], _C3 = A[3], _C4 = A[4], _C5 = A[5], _C6 = A[6], _C7 = A[7], _C8 = A[8], _C9 = A[9], _C10 = A[10], _C11 = A[11], _C12 = A[12], _C13 = A[13], _C14 = A[14], _C15 = A[15], _C16 = A[16], s[2](x))

``

# B: Costitutive Boundary Conditions:

eq[1] := evalf(eval((alpha*lambda[C]^4+lambda[C]^2*lambda[L]^2)*(diff(V[1], x, x, x, x, x))-alpha*lambda[C]^3*(diff(V[1], x, x, x, x))+(-alpha*lambda[C]^2+lambda[C]^2-lambda[L]^2)*(diff(V[1], x, x, x))+(alpha*lambda[C]-lambda[C])*(diff(V[1], x, x)), x = X[0]))

-4.00000*A[16]-.750*A[14]-.50*A[13]

(10)

NULL

eq[2] := evalf(eval((alpha*lambda[C]^4+lambda[C]^2*lambda[L]^2)*(diff(V[2], x, x, x, x, x))+alpha*lambda[C]^3*(diff(V[2], x, x, x, x))+(-alpha*lambda[C]^2+lambda[C]^2-lambda[L]^2)*(diff(V[2], x, x, x))+(-alpha*lambda[C]+lambda[C])*(diff(V[2], x, x)), x = X[2]))

10.87312731383618094144114988541064999102898837479983829986787051089630652141419037828552871410066571*A[9]+.50*A[7]

(11)

````

eq[3] := evalf(eval(lambda[C]^2*(diff(S[1], x)+diff(V[1], x, x))-lambda[C]*(S[1]+diff(V[1], x))+alpha*beta*lambda[C]*(diff(V[1], x, x, x)-lambda[C]^2*(diff(V[1], x, x, x, x, x))), x = X[0]))

-1.00*A[3]+0.8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-1*A[16]-0.1500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-1*A[14]

(12)

 

eq[4] := evalf(eval(lambda[C]^2*(diff(S[2], x)+diff(V[2], x, x))+lambda[C]*(S[2]+diff(V[2], x))-alpha*beta*lambda[C]*(diff(V[2], x, x, x)-lambda[C]^2*(diff(V[2], x, x, x, x, x))), x = X[2]))

7.389056098930650227230427460575007813180315570551847324087127822522573796079057763384312485079121795*A[2]+.5911244879144520181784341968460006250544252456441477859269702258018059036863246210707449988063297436*A[9]+0.1500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-1*A[8]

(13)

NULLNULL

eq[5] := evalf(eval(alpha*lambda[C]^4*(diff(V[1], x, x, x, x, x))-alpha*lambda[C]^3*(diff(V[1], x, x, x, x))+(-alpha*lambda[C]^2+lambda[C]^2)*(diff(V[1], x, x, x))+(alpha*lambda[C]-lambda[C])*(diff(V[1], x, x))+(1-alpha)*(int(exp((z-x)/lambda[C])*(diff(V[1], x, x)-lambda[C]^2*(diff(V[1], x, x, x, x))), z = X[0] .. X[1]))-lambda[L]^2*(diff(int(exp((z-x)/lambda[C])*(diff(V[1], x, x, x)-lambda[C]^2*(diff(V[1], x, x, x, x, x))), z = X[0] .. x), x)), x = X[1]))

-1.471517764685769286382095080645843469783244524127071338031347206789845982979599213428589097383678575*A[16]-0.777287426357452235899284828632869517530750448214776276426328038192883654260245575535813672783191983e-1*A[14]-.1839397205857211607977618850807304337229055655158839172539184008487307478724499016785736371729598218*A[13]

(14)

NULL

NULL``

NULL

eq[6] := evalf(eval(alpha*lambda[C]^4*(diff(V[2], x, x, x, x, x))+alpha*lambda[C]^3*(diff(V[2], x, x, x, x))+(-alpha*lambda[C]^2+lambda[C]^2)*(diff(V[2], x, x, x))+(-alpha*lambda[C]+lambda[C])*(diff(V[2], x, x))-(1-alpha)*(int(exp((x-z)/lambda[C])*(diff(V[2], x, x)-lambda[C]^2*(diff(V[2], x, x, x, x))), z = X[1] .. X[2]))+lambda[L]^2*(diff(int(exp((x-z)/lambda[C])*(diff(V[2], x, x, x)-lambda[C]^2*(diff(V[2], x, x, x, x, x))), z = x .. X[2]), x)), x = X[1]))

10.87312731383618094144114988541064999102898837479983829986787051089630652141419037828552871410066571*A[9]+.4740904191214182588033571723789043494156416517261741241191223987269038781913251474821395442405602671*A[8]+.1839397205857211607977618850807304337229055655158839172539184008487307478724499016785736371729598218*A[7]

(15)

NULL

eq[7] := evalf(eval(lambda[C]^2*(diff(S[1], x)+diff(V[1], x, x))-lambda[C]*(S[1]+diff(V[1], x))+alpha*beta*lambda[C]*(diff(V[1], x, x, x)-lambda[C]^2*(diff(V[1], x, x, x, x, x)))+(1-alpha)*beta*(int(exp((z-x)/lambda[C])*(diff(V[1], x, x, x)-lambda[C]^2*(diff(V[1], x, x, x, x, x))), z = X[0] .. X[1])), x = X[1]))

-.3678794411714423215955237701614608674458111310317678345078368016974614957448998033571472743459196437*A[3]+0.2943035529371538572764190161291686939566489048254142676062694413579691965959198426857178194767357150e-1*A[16]-0.5518191617571634823932856552421913011687166965476517517617552025461922436173497050357209115188794656e-2*A[14]

(16)

NULL

eq[8] := evalf(eval(lambda[C]^2*(diff(S[2], x)+diff(V[2], x, x))+lambda[C]*(S[2]+diff(V[2], x))-alpha*beta*lambda[C]*(diff(V[2], x, x, x)-lambda[C]^2*(diff(V[2], x, x, x, x, x)))-(1-alpha)*beta*(int(exp((x-z)/lambda[C])*(diff(V[2], x, x, x)-lambda[C]^2*(diff(V[2], x, x, x, x, x))), z = X[1] .. X[2])), x = X[1]))

2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427*A[2]+.2174625462767236188288229977082129998205797674959967659973574102179261304282838075657105742820133142*A[9]+0.551819161757163482393285655242191301168716696547651751761755202546192243617349705035720911518879466e-2*A[8]

(17)

# D: Variationally Consistent Conditions:

 

eq[9] := evalf(eval(V[1], x = X[0]))

A[11]+A[15]+A[16]

(18)

NULL

NULL

eq[10] := evalf(eval(V[2], x = X[2]))

A[5]+A[6]+A[7]+A[8]+7.389056098930650227230427460575007813180315570551847324087127822522573796079057763384312485079121795*A[9]+.1353352832366126918939994949724844034076315459095758814681588726540733741014876899370981224906570488*A[10]

(19)

 

eq[11] := evalf(eval(V[1]-V[2], x = X[1]))

A[11]+.5*A[12]+.25*A[13]+.125*A[14]+2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427*A[15]+.3678794411714423215955237701614608674458111310317678345078368016974614957448998033571472743459196437*A[16]-1.*A[5]-.5*A[6]-.25*A[7]-.125*A[8]-2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427*A[9]-.3678794411714423215955237701614608674458111310317678345078368016974614957448998033571472743459196437*A[10]

(20)

 

eq[12] := evalf(eval(S[1]-S[2], x = X[1]))

2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427*A[4]+.3678794411714423215955237701614608674458111310317678345078368016974614957448998033571472743459196437*A[3]-1.*A[12]-1.0*A[13]-.6900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000*A[14]-5.219101110641366851891751944997111995693914419903922383936577845230227130278811381577053782768319540*A[15]+.7063285270491692574634056387100048654959573715809942422550466592591260718302076224457227667441657159*A[16]-2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427*A[2]-.3678794411714423215955237701614608674458111310317678345078368016974614957448998033571472743459196437*A[1]+A[6]+1.0*A[7]+.6900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000*A[8]+5.219101110641366851891751944997111995693914419903922383936577845230227130278811381577053782768319540*A[9]-.7063285270491692574634056387100048654959573715809942422550466592591260718302076224457227667441657159*A[10]

(21)

 

eq[13] := evalf(eval(lambda[C]^2*(diff(V[1], x, x, x, x))-(diff(V[1], x, x)), x = X[0]))

-2.*A[13]

(22)

NULL

eq[14] := evalf(eval(lambda[C]^2*(diff(V[2], x, x, x, x))-(diff(V[2], x, x)), x = X[2]))

-2.*A[7]-6.*A[8]

(23)

NULL````

eq[15] := evalf(eval(diff(V[1], x, x)-(diff(V[2], x, x))-lambda[C]^2*(diff(V[1], x, x, x, x)-(diff(V[2], x, x, x, x))), x = X[1]))

-2.*A[7]-3.0*A[8]+2.*A[13]+3.0*A[14]

(24)

NULL

eq[16] := evalf(eval(diff(V[1], x, x, x)-(diff(V[2], x, x, x))-lambda[C]^2*(diff(V[1], x, x, x, x, x)-(diff(V[2], x, x, x, x, x)))-1, x = X[1]))

6.*A[14]-1.-6.*A[8]

(25)

 

equations := [seq(eq[i], i = 1 .. 16)]:
unknowns := [seq(A[i], i = 1 .. 16)]:  

assign( solve(equations, unknowns)):

 

 

 

display(plot(V[1],x=X[0]..X[1]))

Warning, expecting only range variable x in expression A[11]+A[12]*x+A[13]*x^2+A[14]*x^3+A[15]*exp(2*x)+A[16]*exp(-2*x) to be plotted but found names [A[11], A[12], A[13], A[14], A[15], A[16]]

 

 

eval(V[1], x = .5)

A[11]+.5*A[12]+.25*A[13]+.125*A[14]+2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427*A[15]+.3678794411714423215955237701614608674458111310317678345078368016974614957448998033571472743459196437*A[16]

(26)

 

Hi.

I have faced a problem in solving a system of differential equations with 16 boundary conditions with maple. Unfortunately, maple does not solve it and I could not find out what the problem is. I share the maple file here and I will be grateful for any 

Download Timoshenko_Beam.mw

I should like to find the list of Friday 13 of a year

First 142 143 144 145 146 147 148 Last Page 144 of 2426