Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

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 !

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

These two results seem contradictory:

  1. The first one means the type real doesn't exist, which can be easily verified by looking to the help(type) page, 
  2. Given the definition of '::' ( from help(coloncolon`) 'The  "::" operator serves several purposes in Maple, all related to types.') the second one suggests that real is a known type (for there is no error returned).
restart
f := x -> `if`(x::real, x, I*x):
f(3)
Error, (in f) type `real` does not exist
g := x -> is(x::real);
g(3), g(3*I)
                              true, false

Does assuming transforming "real" into a property in function g explains why it returns true?

Thank in advance for your explanations

(
Bulk questions:

Why doesn't real type exist, whereas complex type does?
From help(complex):
General complex numbers are numbers of the form x + I*y, where x and y are integers, rationals, or floats. In the general complex number case, if either x or y is a floating-point number, then an automatic conversion takes place, coercing both x and y into type float.
seems to mean that the complex is built upon floats and not reals.
But the dictionnary says
complex: adj. 1. of, involving, or of the form of a complex number, consisting of a real and an imaginary part, either of which may be zero. 2.- n. another term for a simplicial complex. Sometimes, however, less is required of a complex than of a simplicial complex. 3. (Group theory) an archaic term for a subset of a group.
real: adj.  1. involving or consisting of real numbers alone, having no imaginary part, or imaginary part equal to zero.  2. (as substantive) a real number.
The dictionnary doesn't mention floating point number but real ones, whereas the help pages do the opposite.

Why some numbers are considered as types whereas others are properties?
For instance, help(property) says that property rational is related to parent property real, but rational is also a type.
)

Applying Maple 2023's dsolve to the ODE shown below yields the solution y(t)=0 which is obviously incorrect.  Maple 2021 and earlier used to give a nonzero (albeit not very useful) answer.

restart;

F := (t-1)*(t-2)/(t^2+1)^3*(Heaviside(t-2)-Heaviside(t-1));

(t-1)*(t-2)*(Heaviside(t-2)-Heaviside(t-1))/(t^2+1)^3

plot(F, t=0..4);

de := diff(y(t),t,t) + diff(y(t),t) = F;

diff(diff(y(t), t), t)+diff(y(t), t) = (t-1)*(t-2)*(Heaviside(t-2)-Heaviside(t-1))/(t^2+1)^3

ic := y(0)=0, D(y)(0)=0;

y(0) = 0, (D(y))(0) = 0

Huh?

dsolve({de,ic}, y(t));

y(t) = 0

Specifying method=laplace will make that work, but how is an

unsuspecting user to know that what's obtained above is incorrect?

Download dsolve-bug.mw

I have a problem. Maple wants to create and a palette, I can add content and icons to the palette, but as soon as I restart Maple, the palette content has disappeared and says that Maple cannot find the added icons.

I have used the method described in Maple Help.

Is there anyone who can help?

Kind regards

Dear sir ,

I have implemented Dsolve method the code was executed, but i need to apply Kellor Box method to solve the ODES 

Please can any one help how to implement? 

because there is no post regarding the Kellor box method. 

restart; with(plots)

``

S := 1; Rd := .1; delta := .1; Hs := 1; Sc := .1; Pr := 6.8; n := 1; Rc := .1; E := .1; M := 1

NULL

 

OdeSys := a1*(diff(f(eta), eta, eta, eta, eta))/a2-S*(3*(diff(f(eta), eta, eta))+eta*(diff(f(eta), eta, eta, eta))+(diff(f(eta), eta))*(diff(f(eta), eta, eta))-f(eta)*(diff(f(eta), eta, eta, eta)))-a5*M*(diff(f(eta), eta, eta))/a2-a1*Kp*(diff(f(eta), eta, eta))/a2 = 0, (a4+4*Rd)*(diff(Theta(eta), eta, eta))+12*Rd*delta*((diff(Theta(eta), eta))*(diff(Theta(eta), eta))+Theta(eta)*(diff(Theta(eta), eta, eta)))+Hs*Theta(eta)-a3*Pr*S*(diff(Theta(eta), eta))*(eta-f(eta)) = 0, diff(Phi(eta), eta, eta)-S*Sc*(diff(Phi(eta), eta))*(eta-f(eta))-Sc*Rc*(1+delta*Theta(eta))^n*Phi(eta)*exp(-E/(1+delta*Theta(eta))) = 0; Cond := f(0) = 0, ((D@@2)(f))(0) = 0, (D(Theta))(0) = 0, (D(Phi))(0) = 0, f(1) = 1, (D(f))(1) = 0, Theta(1) = 1, Phi(1) = 1

   

KpVals := [1, 2, 3, 4]

for j to numelems(KpVals) do Ans[j] := dsolve(eval([OdeSys, Cond], Kp = KpVals[j]), numeric, output = listprocedure) end do

 

with(plots):
 cols := [red, blue, black,green]:

 plotA:= display
  ( [ seq
      ( odeplot
        ( Ans[k],[eta,(f(eta))],
          eta=0..1,
          color=cols[k]
        ),
        k=1..numelems(KpVals)
      )
    ],linestyle = "solid",
    'axes'= 'boxed',labels=[eta,'f(eta)'],labelfont=[TIMES,BOLD,16]
  );
 

with(plots):
  cols := [red, blue, black,green]:

plotB:= display( [ seq( odeplot
        ( Ans[k],[eta,Theta(eta)],
          eta=0..1,
          color=cols[k]
        ),
        k=1..numelems(KpVals)
      )
    ],linestyle = "solid",
    'axes'= 'boxed',labels=[eta,'Phi(eta)'],labelfont=[TIMES,BOLD,16]
  );

 

 

with(plots):
  cols := [red, blue, black,green]:

plotC:= display( [ seq( odeplot
        ( Ans[k],[eta,Phi(eta)],
          eta=0..1,
          color=cols[k]
        ),
        k=1..numelems(KpVals)
      )
    ],linestyle = "solid",
    'axes'= 'boxed',labels=[eta,'Phi(eta)'],labelfont=[TIMES,BOLD,16]
  );

 

with(plots):
 cols := [red, blue, black,green]:

 plotA:= display
  ( [ seq
      ( odeplot
        ( Ans[k],[eta,(diff(f(eta),eta))],
          eta=0..1,
          color=cols[k]
        ),
        k=1..numelems(KpVals)
      )
    ],linestyle = "solid",
    'axes'= 'boxed',labels=[eta,"f '(eta)"],labelfont=[TIMES,BOLD,16]
  );

 

 

 

Download kellor_box_method.mw

Is there an equivalent to Pivot Table in Excel?
I'm working on some investing data, and am using Maple to gather information from various sources and using DataFrame to combine all the data. I could export the dataframe and open in Excel or other spreadsheet and use the Pivot table to summarize the data, but is there an easy way to do all of it in Maple?

Thanks

Good evening,could you please help me to find the values of Phi[2],Phi[3],Phi[4],....

The right hand side of the for loop is the equation i need.Is this maple code correct.

rps1.mw

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