MaplePrimes Questions

restart;

Here we have a pretty well-behaved trig function:

y := t -> 144*cos(t)^6 - 216*cos(t)^4 + 32*cos(t)^3 + 81*cos(t)^2 - 24*cos(t) + 17;

proc (t) options operator, arrow; 144*cos(t)^6-216*cos(t)^4+32*cos(t)^3+81*cos(t)^2-24*cos(t)+17 end proc

plot(y(t), t=0..2*Pi, view=0..35);

Maple 2023 plots y^(3/2) with a strange artifact at t = Pi:

plot(y(t)^(3/2), t=0..2*Pi, view=0..200);

Any reason for that?  Maple 2021 and earlier used to produce the correct plot:

  

Download bug-in-plot.mw

Hi.

why in eq1 some parameters such as beta 1, Q110,... are not placed (They defined before eq1 !!!!)

Thanks

TRASH.mw

When I use IdentifySmallGroup(DihedralGroup(4)), I will get result 8,3. Then I know DihedralGroup(4) is SmallGroup(8, 3) actually. But I will get different result when I use it in IsTransitive:

IsTransitive(DihedralGroup(4), [1, 2, 3, 4])

true

IsTransitive(SmallGroup(8, 3), [1, 2, 3, 4])

false

How to rectify this error.

NF-1.mw

How should optional input parameters be handled for procedures. The example has three optional inputs 

vars:=[x,y]   ,  clr:="b"   and prnt:="y"  . if one wants to change prnt to"n", vars and clr values must be entered.

{vars:=[x,y]  } , { clr:="b" }  and{ prnt:="y"}  this is a good method because one just enteres prnt="n".  But have to remember the input parameter name prnt.

I have a 3rd option, but it is to complicated and probably unreliable to use in practice.  and with more than 3 optional inputs too difficult to code.

I am wondering  are the other approaches and what is the prefered methodology. I have about 30+ procedures to apply this to in a package.

Edit:-  I can change the prnt to boolean true, false instead of "y" , "n".  That would make the all the optional inputs different types.

In Test1 its should be vars::list:=[x,y] not vars::{list , `string`}:=[x,y]

restart

Geomclr := "b"

"b"

(1)

NULL

NULL

NULL

Test1 := proc (A, B, vars::{list, string} := [x, y], clr::string := Geomclr, prnt::string := "y") if vars::string then clr := vars; vars := [x, y] end if; if clr = "y" or clr = "n" then prnt := clr; clr := Geomclr end if; print(clr); if prnt = "y" then print("good") end if; A*vars[1]+B*vars[2] end proc

NULL

Test1(A, B)

A*x+B*y

(2)

Test1(A, B, [r, s], "n")

Error, (in Test1) invalid left hand side in assignment

 

Test1(A, B, "g")

Error, (in Test1) invalid left hand side in assignment

 

Test1(A, B, "n")

Error, (in Test1) invalid left hand side in assignment

 

Test1(A, B, [x, y], "b", "n")

A*x+B*y

(3)

 

 

NULL

``

NULL

 

NULL

Test2 := proc (A, B, { vars::{list} := [x, y], clr::string := Geomclr, prnt::string := "y" }) print(clr); if prnt = "y" then print("good") end if; A*vars[1]+A*vars[2] end proc

NULL

NULL

Test2(A, B)

A*x+A*y

(4)

Test2(A, B, clr = "r")

A*x+A*y

(5)

Test2(A, B, prnt = "n")

A*x+A*y

(6)

Test2(A, B, prnt = "n")

A*x+A*y

(7)

Test2(A, B, prnt = "n", clr = "green", l = [r, s])

A*x+A*y

(8)

``

 

# 3 This is possible but is a very complicated method of handling the optional inputs and difficult the handle altered sequence on inputs.

NULL

Test3 := proc (A, B, vars::{list, string} := [x, y], clr::string := Geomclr, prnt::string := "y") local varsl, clrl, prntl; global Geomclr; varsl := vars; clrl := clr; prntl := prnt; if vars::string then varsl := [x, y]; if vars = "y" or vars = "n" then prntl := vars; clrl := Geomclr elif vars = "r" or vars = "g" or vars = "b" then clrl := vars end if elif vars::list and clr = "y" or clr = "n" then prntl := clr; clrl := Geomclr end if; if clr = "y" or clr = "n" and vars::string then prntl := clr; clrl := vars end if; print("Colour print out ", clrl); if prntl = "y" then print("This is a test Message") end if; A*varsl[1]+B*varsl[2] end proc

NULL

Test3(A, B)

A*x+B*y

(9)

Test3(A, B, [r, s])

A*r+B*s

(10)

Test3(A, B, [r, s], "n")

A*r+B*s

(11)

Test3(A, B, "n")

A*x+B*y

(12)

Test3(A, B, [r, s], "r", "n")

A*r+B*s

(13)

Test3(A, B, "r", "n")

A*x+B*y

(14)

Test3(A, B, "n", "r")

A*x+B*y

(15)

NULL


 

Download Q_2024-02-25_Test_proc_Args.mw

Cong:=proc(n)
 local  a,b,An,Bn,Cn,Dn:
if n mod 2 = 1    
An:=0:     Bn:=0:    
for a  from (round(-sqrt(n/(2)))) to round(sqrt(n/(2)) )
do:           
for b  from (round(-sqrt(n)) )to round(sqrt(n) )do :               
if (sqrt(n-2*a^(2)-b^(2)) )/(32)isInteger                      
then An:=An+1                
elif (sqrt(n-2*a^(2)-b^(2)) )/(8) isInteger                      
then Bn:=Bn+1  fi:          
od:  od:
 if 2*An=Bn  
 return(True)  else  return(False)
fi: else if n mod 2 = 0 : 
Cn:=0:  Dn:=0:      
for a  from (round(-sqrt(n/(8)))) to round(sqrt(n/(8)) )
do :          
 for b  from (round(-sqrt(n/(2)))) to round(sqrt(n/(2))) do:                 
f (sqrt(n/(2)-4*a^(2)-b^(2)) )/(32)isInteger                      
then Cn:=Cn+1                
elif (sqrt(n/(2)-4*a^(2)-b^(2)) )/(8) isInteger
then Dn:=Dn+1 fi: od:  od:  
if 2*Cn=Dn:   
return(True)  else  return(False)fi:  
end:  

Why do I get this messge : Error, unterminated procedure. Thank you.

ow to get plot for the exact solution of a piecewise function and i need the correct plot which has curve started at y-axis (0.5) and goes till 2?

Hello,
I am a beginner on Maple and I am working on approximate solutions of partial differential equations.
After finding the approximate solution I wanted to compare both the plots (The exact solution and the approximate one), is here any tool or command that allows me to do so ?

Thanks in Advance !

I want to know the change of the web during the web handling process, so I attached the probe, and it shows the checkboxes to observe the velocity and tension values as shown in the picture, but there are 3 additional checkboxes like Force - T2 / real - e / real - e2, what does this mean?

Using textplot  is there anything that can be done to to increase the offest of alignI would like to raise  P3 at top of graph up a bit and S3 down. they are {centre, above} and {centre,below}. I know I can tie them to a different point  coordinate to begin with but that is messy to control inside a procedure.

How to compare the magnitude (the absolute value, ignoring the sign) of two multi-parameter functions f_1 and f_2?

Note that all my parameters can only take stricly positive values. Specifically, I want to know the ranges of parameter values for which f_1 > f_2, f_1 < f_2, and f_1 = f_2. Is solve(f_1 > f_2) etc. the best way to do this? If so, how to specify solve() so that it incorporates all three (>,<,=) comparisons and do not ignore the strict positivity assumption? Is there any other command other than solve()?   

Example with only two parameters sigma__v and sigma__d:

restart

 # Parameters always positive

assume(0 < sigma__d, 0 < sigma__v);
interface(showassumed=0);

1

(1)

Diff('lambda__1', sigma__v) = sqrt(5)/(5*sigma__d);
f__1 := rhs(%);
Diff('lambda__1', sigma__d) = -sqrt(5)*sigma__v/(5*sigma__d^2);
f__2 := abs(rhs(%));

Diff(lambda__1, sigma__v) = (1/5)*5^(1/2)/sigma__d

 

(1/5)*5^(1/2)/sigma__d

 

Diff(lambda__1, sigma__d) = -(1/5)*5^(1/2)*sigma__v/sigma__d^2

 

(1/5)*5^(1/2)*sigma__v/sigma__d^2

(2)

plot3d([f__1,f__2], sigma__v=0.001..10, sigma__d=0.001..10, view=0..5, color=[red,blue]);

 

``

NULL

Download parametric_comparison.mw

Note that f_1 depends only on sigma__d but f_2 depends on both sigma__v and sigma__d. Of course I can directly plot the two curves in 3d in this simple case, but I am looking for a systematic way to do parametric comparisons so that I don't have to "eyeball" the threshold values (if any exist). Most importantly, I can't plot at all once my functions depend on more than two parameters.

 Thanks.

EDIT: perhaps "variables" is a better word than "parameters" here.

Can I link my MapleCloud application to the Application Center?

Several years ago I uploaded an installable workbook application for Clifford Algebra to the public maplecloud following the guidelines and formats set down in maple help. My intention was to make the application available in the application center, but I just noticed that a package uploaded to MapleCloud is not  available for searching in the Application Center. Unfortunately,the Maple Cloud site for public packages is a mess. One cannot readily browse the applications there like in the application center.

The submissions page for the application center is not helpful in this case. It seems to assume submissions will take the form of maple documents/ worksheets rather than applications written in a workbook). I could not navigate to the Maple Cloud to drop a link to my package using the submission form, but it should be possible to link the the package already installed on the MapleCloud to the Cloud? (Because I is easier to update the MapleCloud package and it can be installed by opening from the Cloud).

Hi there,

I would like this code to display all 4 roots of this equation. I have graphed it in Desmos, so I know it intersects the X-axis in 4 places (the two positive ones representing the subsonic and supersonic Mach number, the negative ones are not needed). However, Maple only shows the subsonic positive and negative values and says that there may be missing solutions. Code and results are provided at the bottom.

I would appreciate any guidance on this issue or with solving this particular equation.

Thank you,

Jack

Download Equation_1_Worksheet.mw

g := 1.402

1.402

(1)

a := .660416443

.660416443

(2)

b := .112815378

.112815378

(3)

eq1 := 0 = (2*(1+((g-1)*(1/2))*m^2)/(g+1))^((g+1)/(g-1))/m^2-(a/b)^2

0 = (.8326394672+.1673605329*m^2)^5.975124378/m^2-34.26881996

(4)

``

solution := solve({eq1}, {m})``

{m = -0.9942282680e-1}, {m = 0.9942282680e-1}

(5)

NULL

I am a beginner to Maple and I have to plot a three variable function with Maple.

The function I have to graph is a solution to a two dimensional and time dependent PDE which makes it three variables :

sol:= exp^{i*t}*sin(10*x)*sin(4*y)

Where the variables range is :  x=0..Pi, y=0..Pi,t=0..1

Hi,
I am a beginner in Maple. I want to calculate an integral [int(dx)=int(d_phi/sqrt(F(phi)))] and then plot phi vs x. But I do not know the commands.
Integral.mw

First 112 113 114 115 116 117 118 Last Page 114 of 2411