Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi,

I want to solve a first order ODE and (i) plot phi vs. x and then (ii) export data of the plotted curve as an T-shape ASCII file. I try to do this by Maple, but there are some errors and I couldn’t get the mentioned curve and ASCII file. Please, help me to remove errors:
(dphi/dx)**2+2*V(phi)=0,

where V(phi)= (1-alpha)*M^2 - (1-alpha)*M*sqrt(M^2 - 2*phi) + mu*(mu + beta*nu)*(1 - exp(phi/(mu + beta*nu))) + 
            (nu/beta)*(mu + beta*nu)*(1 - exp(beta*phi/(mu + beta*nu))) + (alpha/gamma1)*(1 - exp(-gamma1*phi)),

where we assume mu := 0.01, nu := 1 - mu, beta := 0.05, alpha := 0.3, M := sqrt(0.704), gamma1 := 0.001.
As it is seen from the attached figure, V(phi) and dV(phi)/dx =0 for phi=0 and phi=phi_m (two extreme points of V(phi)) and d^V(phi)/dphi^2<0 at phi=0 and phi=phi_m (phi and x are real). 

From the attached figure, it seems that phi=phi_m at x=0 and phi->0 as x-> infinity. (Hint: I expect the plot of V(phi) vs. phi and phi vs. x be similar to the curve "A" in the attached file).

Thanks.
rk4.mw

i did pdetest without conjugate like the paper did i get zero but when i did pde test  with conjugate i didn't where is my problem 
i will do without conjugate but how change p[2]=conjugate(p[1])

restart

with(PDEtools)

with(LinearAlgebra)

NULL

with(SolveTools)

undeclare(prime)

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

(1)

declare(u(x, y, z, t))

u(x, y, z, t)*`will now be displayed as`*u

(2)

declare(f(x, y, z, t))

f(x, y, z, t)*`will now be displayed as`*f

(3)

pde := -4*(diff(u(x, y, z, t), x, t))+diff(u(x, y, z, t), `$`(x, 3), z)+3*alpha*(diff(u(x, y, z, t), `$`(y, 2)))+4*(diff(u(x, y, z, t), x))*(diff(u(x, y, z, t), x, z))+2*(diff(u(x, y, z, t), `$`(x, 2)))*(diff(u(x, y, z, t), z))

-4*(diff(diff(u(x, y, z, t), t), x))+diff(diff(diff(diff(u(x, y, z, t), x), x), x), z)+3*alpha*(diff(diff(u(x, y, z, t), y), y))+4*(diff(u(x, y, z, t), x))*(diff(diff(u(x, y, z, t), x), z))+2*(diff(diff(u(x, y, z, t), x), x))*(diff(u(x, y, z, t), z))

(4)

pde_nonlinear, pde_linear := selectremove(proc (term) options operator, arrow; has((eval(term, u(x, y, z, t) = a*u(x, y, z, t)))/a, a) end proc, pde)

4*(diff(u(x, y, z, t), x))*(diff(diff(u(x, y, z, t), x), z))+2*(diff(diff(u(x, y, z, t), x), x))*(diff(u(x, y, z, t), z)), -4*(diff(diff(u(x, y, z, t), t), x))+diff(diff(diff(diff(u(x, y, z, t), x), x), x), z)+3*alpha*(diff(diff(u(x, y, z, t), y), y))

(5)

thetai := t*w[i]+y*p[i]+x+z

t*w[i]+y*p[i]+x+z

(6)

eqw := w[i] = 3*alpha*p[i]^2*(1/4)

w[i] = (3/4)*alpha*p[i]^2

(7)

Bij := proc (i, j) options operator, arrow; 4/((p[i]-p[j])^2*alpha) end proc

proc (i, j) options operator, arrow; 4/((p[i]-p[j])^2*alpha) end proc

(8)

theta1 := normal(eval(eval(thetai, eqw), i = 1)); theta2 := normal(eval(eval(thetai, eqw), i = 2))

(3/4)*alpha*t*p[1]^2+y*p[1]+x+z

 

(3/4)*alpha*t*p[2]^2+y*p[2]+x+z

(9)

eqf := f(x, y, z, t) = theta1*theta2+4/((p[1]-p[2])^2*alpha)

f(x, y, z, t) = ((3/4)*alpha*t*p[1]^2+y*p[1]+x+z)*((3/4)*alpha*t*p[2]^2+y*p[2]+x+z)+4/((p[1]-p[2])^2*alpha)

(10)

eq17 := u(x, y, z, t) = 2*(diff(ln(f(x, y, z, t)), x))

u(x, y, z, t) = 2*(diff(f(x, y, z, t), x))/f(x, y, z, t)

(11)

eqt := eval(eq17, eqf)

u(x, y, z, t) = 2*((3/4)*alpha*t*p[2]^2+y*p[2]+2*x+2*z+(3/4)*alpha*t*p[1]^2+y*p[1])/(((3/4)*alpha*t*p[1]^2+y*p[1]+x+z)*((3/4)*alpha*t*p[2]^2+y*p[2]+x+z)+4/((p[1]-p[2])^2*alpha))

(12)

NULL

pdetest(eqt, pde)

0

(13)

NULL

Download p1.mw

I am in the process of trying to learn Maple. As an exercise I am trying to plot an amplitude modulated waveform. No problem plotting the waveform of the carrier and the modulating signal but for some reason (user error on my part) I can't plot the combined waveform y given by. 

y = [1 + M*cos(2*Pi*f__m*t)]*A*sin(2*Pi*f__c*t)

Where the following values have been set M = 0.5, A = 1, f_m = 2, f_c = 10.

Plotting y using the following

plot(y, t = 0 .. 1, title = "Graph of Carrier", labels = ["time (seconds)", "Amplitude (Volts)"], color = red);

Gives the following error. Having tried various combinations of variables, values, single parameter functions etc I need a pointer as to where I am going wrong. 

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct
What I am expecting is a graph similar to the below derived in Excel? My version of Maple is 2023.2

VC1.mw

How to solve this error?

i don't know how apply conversation language to matlab in righ hand side  don't show up to do conversation language for short is come up but for this not 

restart

K := (2*(k[1]*exp((3/4)*k[1]*t*alpha*p[1]^2+(1/4)*t*k[1]^3+k[1]*p[1]*y+k[1]*x+k[1]*z+eta[1])+((p[1]-p[2])^2*alpha-(k[1]-k[2])^2)*(k[1]+k[2])*exp((3/4)*k[1]*t*alpha*p[1]^2+(1/4)*t*k[1]^3+k[1]*p[1]*y+k[1]*x+k[1]*z+eta[1]+(3/4)*k[2]*t*alpha*p[2]^2+(1/4)*t*k[2]^3+k[2]*p[2]*y+k[2]*x+k[2]*z+eta[2])/((p[1]-p[2])^2*alpha-(k[1]+k[2])^2)+k[2]*exp((3/4)*k[2]*t*alpha*p[2]^2+(1/4)*t*k[2]^3+k[2]*p[2]*y+k[2]*x+k[2]*z+eta[2])+((p[2]-p[3])^2*alpha-(k[2]-k[3])^2)*(k[2]+k[3])*exp((3/4)*k[2]*t*alpha*p[2]^2+(1/4)*t*k[2]^3+k[2]*p[2]*y+k[2]*x+k[2]*z+eta[2]+(3/4)*k[3]*t*alpha*p[3]^2+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[2]*x+k[2]*z+eta[2])/((p[1]-p[2])^2*alpha-(k[1]+k[2])^2)+exp((3/4)*k[2]*t*alpha*p[2]^2+(1/4)*t*k[2]^3+k[2]*p[2]*y+k[2]*x+k[2]*z+eta[2])+((p[2]-p[3])^2*alpha-(k[2]-k[3])^2)*exp((3/4)*k[2]*t*alpha*p[2]^2+(1/4)*t*k[2]^3+k[2]*p[2]*y+k[2]*x+k[2]*z+eta[2]+(3/4)*k[3]*t*alpha*p[3]^2+(1/4)*t*k[3]^3+k[3]*p[3]*y+k[3]*x+k[3]*z+eta[3])/((p[2]-p[3])^2*alpha-(k[2]+k[3])^2)+((p[1]-p[2])^2*alpha-(k[1]-k[2])^2)*((p[1]-p[3])^2*alpha-(k[1]-k[3])^2)*((p[2]-p[3])^2*alpha-(k[2]-k[3])^2)*exp((3/4)*k[1]*t*alpha*p[1]^2+(1/4)*t*k[1]^3+k[1]*p[1]*y+k[1]*x+k[1]*z+eta[1]+(3/4)*k[2]*t*alpha*p[2]^2+(1/4)*t*k[2]^3+k[2]*p[2]*y+k[2]*x+k[2]*z+eta[2]+(3/4)*k[3]*t*alpha*p[3]^2+(1/4)*t*k[3]^3+k[3]*p[3]*y+k[3]*x+k[3]*z+eta[3])/(((p[1]-p[2])^2*alpha-(k[1]+k[2])^2)*((p[1]-p[3])^2*alpha-(k[1]+k[3])^2)*((p[2]-p[3])^2*alpha-(k[2]+k[3])^2))+((p[1]-p[3])^2*alpha-(k[1]-k[3])^2)*exp((3/4)*k[1]*t*alpha*p[1]^2+(1/4)*t*k[1]^3+k[1]*p[1]*y+k[1]*x+k[1]*z+eta[1]+(3/4)*k[3]*t*alpha*p[3]^2+(1/4)*t*k[3]^3+k[3]*p[3]*y+k[3]*x+k[3]*z+eta[3])/((p[1]-p[3])^2*alpha-(k[1]+k[3])^2)+exp((3/4)*k[3]*t*alpha*p[3]^2+(1/4)*t*k[3]^3+k[3]*p[3]*y+k[3]*x+k[3]*z+eta[3]))

2*(k[1]*exp((3/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4)*t*k[2]^3+k[2]*p[2]*y+k[2]*x+k[2]*z+eta[2]+(3/4)*k[3]*t*alpha*p[3]^2+(1/4)*t*k[3]^3+k[3]*p[3]*y+k[3]*x+k[3]*z+eta[3])/(((p[1]-p[2])^2*alpha-(k[1]+k[2])^2)*((p[1]-p[3])^2*alpha-(k[1]+k[3])^2)*((p[2]-p[3])^2*alpha-(k[2]+k[3])^2))+((p[1]-p[3])^2*alpha-(k[1]-k[3])^2)*exp((3/4)*k[1]*t*alpha*p[1]^2+(1/4)*t*k[1]^3+k[1]*p[1]*y+k[1]*x+k[1]*z+eta[1]+(3/4)*k[3]*t*alpha*p[3]^2+(1/4)*t*k[3]^3+k[3]*p[3]*y+k[3]*x+k[3]*z+eta[3])/((p[1]-p[3])^2*alpha-(k[1]+k[3])^2)+exp((3/4)*k[3]*t*alpha*p[3]^2+(1/4)*t*k[3]^3+k[3]*p[3]*y+k[3]*x+k[3]*z+eta[3]))

(1)
 

NULL

Download convert-to-matlab.mw

I have plotted a 3D figure by maple 2023. but all numbers and units on axes are seen a black boxes. How can fix this problem?

Dear Maple Community,

I come to you with a question about the reduced involutive form (rif) package. Namely, I decided to try the classic example from the "LONG GUIDE TO THE STANDARD FORM PACKAGE", which dates back to 1993. Here is the link to the complete documentation:

https://wayback.cecm.sfu.ca/~wittkopf/files/standard_manual.txt

So, the example is the following:

2.1 SIMPLE EXAMPLES

EXAMPLE A

Consider the system of nonlinear PDEs:       

y Zxxx - x Zxyy  =  Zyy - y Zy

                        2     2    2
2 y x Zxxx Zxyy + x Zxxx + x y Zxyy  =  0

                  2    2
y Zxyy - x W + 2 x  y Z  =  0

                 2    2
Zyy - y Zy  + 2 x  y W  =  x W

where the dependent variables W and Z are functions of the
independent variables x and y, and Zxxx denotes the third partial
derivative of Z with respect to x etc.

After making computations back in 1993 with Maple V, they obtain the following involutive form:

In our original notation the (considerably) simplified system is:
                                            2
  Zxxx = 0, Zxy = 0, Zyy = y Zy, W = 2 x y Z

So, I tried the same system of PDEs in the modern Maple and the modern rifsimp() command. You can find the result below:

demo_question.mw

The problem is that nowadays [Maple 2022.1] , I get only the trivial solution: z = 0 and w = 0.

Could someone clarify, please, where the truth is and what am I doing wrong?

Thanks a lot in advance for any help and clarification!

Best regards,

Dr. Denys D.
 

restart:

with(DETools):

PDE1 := y*diff(z(x,y), x$3) - x*diff(z(x,y),x,y$2) = diff(z(x,y),y$2) - y*diff(z(x,y), y);

y*(diff(diff(diff(z(x, y), x), x), x))-x*(diff(diff(diff(z(x, y), x), y), y)) = diff(diff(z(x, y), y), y)-y*(diff(z(x, y), y))

(1)

PDE2 := 2*x*y*diff(z(x,y),x$3)*diff(z(x,y),x,y$2) + x*(diff(z(x,y),x$3))^2 + x*y^2*(diff(z(x,y),x,y$2))^2 = 0;

2*x*y*(diff(diff(diff(z(x, y), x), x), x))*(diff(diff(diff(z(x, y), x), y), y))+x*(diff(diff(diff(z(x, y), x), x), x))^2+x*y^2*(diff(diff(diff(z(x, y), x), y), y))^2 = 0

(2)

PDE3 := y*diff(z(x,y),x,y$2) - x*w(x,y) + 2*x^2*y*z(x,y)^2 = 0;

y*(diff(diff(diff(z(x, y), x), y), y))-x*w(x, y)+2*x^2*y*z(x, y)^2 = 0

(3)

PDE4 := diff(z(x,y), y$2) - y*diff(z(x,y),y) + 2*x^2*y*w(x,y)^2 = x*w(x,y);

diff(diff(z(x, y), y), y)-y*(diff(z(x, y), y))+2*x^2*y*w(x, y)^2 = x*w(x, y)

(4)

sys := [PDE1, PDE2, PDE3, PDE4]:

rif := rifsimp(sys, [[w], [z]], indep = [x,y]);

table( [( Case ) = [[z(x, y)*(8*z(x, y)^2*y^2*x^2-1) = 0, diff(z(x, y), x), "false split"]], ( Solved ) = [w(x, y) = 0, z(x, y) = 0] ] )

(5)
 

 

I have one random variable as follows:  r := sqrt(RandomVariable(Uniform(0,1)))

I have another as follows:  x := cos(RandomVariable(Uniform(0, 2*Pi)));

The r variable returns a PDF of 2*t, where t<1; 0 otherwise.  The variable x returns a PDF of 1/(Pi*sqrt(1-t^2)), where |t|<1; 0 otherwise.

For both random variables, I have validated through simulated values.  I am convinced the above PDF functions are correct.  When I multiply r*x in Maple and then ask for a PDF of the resultant random variable, I fail.  Maple seems to not like this.

My question is then as follows...can anyone help me get the PDF of r*x?

Which version of Maple contains its most optimal and elegant coding, regardless of utility,  and was it the product of someone's direct creative input (not auto-coded with AI for example).

As an aside, there's a spelling mistake in the word "separate" below within the "Tags" instruction:

"Tags are words are used to describe and categorize your content. Combine multiple words with dashes(-), and seperate tags with spaces."

I am making changes in my code in order to make it work with Grid. This involves making many modules I had export on them as local.

I have lots of code of this form

use toX=A:-some_very_long_module_name:-toX in
local B := module() 
       export foo:=proc()
            toX(...);
       end proc;
end module;
end use;

This is done so I do not have to type A:-some_very_long_module_name:-toX() all the time as toX() is a very common call I make all over the place in many different modules.

This was working fine, except when I now changed some_very_long_module_name module to be local.

I really do not want to change all my code and change toX(...) to the explicit fully qualified name  some_very_long_module_name:-toX(....)

I could probably look into using alias instead, but I do not like aliases.

But before doing this, any one knows why this now makes Maple not happy? And if it possible to make use....end use while keep this long named module local?

Below is work sheet showing 4 examples. The first one is how I had things before, where the module was export.

The second and third examples showing the problems that show up when changing the module to local.

The last one showing it works if I remove use...end use and just type the full long name.

my goal is to keep this long named module local, but still use  use...end use. around other modules which needs to make calls to it. Just to safe typing, that is all. 

Any ideas to try are welcome. 

 

restart;

 

Original code work, but module has to be export

 

A := module()

  export main_entry:=proc()
     B:-foo();
  end proc;

  export some_very_long_name:= module() #NOTICE, export
        export toX:=proc(n::integer)::integer;
              n+1;
        end proc;
  end module;

  use toX=A:-some_very_long_name:-toX in  #works now
  local B:= module()
     export foo:=proc()
         toX(1);
     end proc;
  end module;
  end use;

end module;

_m1906974412096

A:-main_entry()

2

 

Example 1 where it now fails, since changed to local

 

A := module()

  export main_entry:=proc()
     B:-foo();
  end proc;

  local some_very_long_name:= module() #NOTICE, now local
        export toX:=proc(n::integer)::integer;
              n+1;
        end proc;
  end module;

  use toX=A:-some_very_long_name:-toX in
  local B:= module()
     export foo:=proc()
         toX(1);
     end proc;
  end module;
  end use;

end module;

_m1907025773216

A:-main_entry()

Error, (in foo) module does not export `some_very_long_name`

 

Example 2 remove A:- in the use call

 

A := module()

  export main_entry:=proc()
     B:-foo();
  end proc;

  local some_very_long_name:= module() #NOTICE, now local
        export toX:=proc(n::integer)::integer;
              n+1;
        end proc;
  end module;

  use toX= some_very_long_name:-toX in #notice, removed A:-
  local B:= module()
     export foo:=proc()
         toX(1);
     end proc;
  end module;
  end use;

end module;

Error, (in anonymous procedure created in anonymous module instantiated by anonymous module) nameless local variable in procedure

 

 

 

 

Example 3. One solution is to type the full name and remove use....end use; But I am trying to avoid this.

 

A := module()

  export main_entry:=proc()
     B:-foo();
  end proc;

  local some_very_long_name:= module() #NOTICE, now local
        export toX:=proc(n::integer)::integer;
              n+1;
        end proc;
  end module;
  
  local B:= module()
     export foo:=proc()
         some_very_long_name:-toX(1); #this works
     end proc;
  end module;


end module;

_m1907023851968

A:-main_entry()

2

 


 

Download trouble_with_use.mw

The following page of the documentation cites an article from the newsletter which I would be very interested in reading: 

- https://www.maplesoft.com/support/help/view.aspx?path=assume

The full citation for the article I'm interested in is as follows:
 

  

Corless, Robert, and Monagan, Michael. "Simplification and the Assume Facility." Maple Technical Newsletter, Vol. 1 No. 1. Birkhauser, 1994.

 

 

For Maple 17, in 2013, we introduced the GroupTheory package. It has seen a lot of improvements since its introduction, and I figured I would write something about how you can use it to teach a group theory course.

 

First of all, I think it would be a great idea to have your students just play with the GroupTheory package in Maple, and get some intuition for what makes group theory tick by getting their hands dirty. But that is not what I want to talk about today. Instead, I want to discuss how you might use it for giving your lectures - to show some visualizations while you show your beamer presentation or write on the black- or whiteboard.

 

When starting out with the definition of a group, you might want to compare the Cayley table of a group with that of a binary operation that doesn't define a group. A set with any binary operation is called a magma; to find good examples, we might want to use one group; one magma that has an identity and is associative but not invertible; and one magma that is has an identity and is invertible but not associative. Maybe we also want the group to not be cyclic (so the group order will have to not be prime), because those Cayley tables look a little boring. For this we can use the Magma package.

 

We note that a magma that is invertible and has an identity element is called a loop. We can enumerate all magmas of a given order and with certain properties using the command Magma:-Enumerate, finding either the number of such objects (by default) or a list of the multiplication tables (with the output = list option). Can we find interesting examples of order 4?

 

with(Magma)

Enumerate(4, group), Enumerate(4, loop), Enumerate(4, associative, identity)

2, 2, 35

(1)

 

No: all loops of order 4 are groups. Let's try order 6.

 

Enumerate(6, group), Enumerate(6, loop), Enumerate(6, associative, identity)

2, 109, 2237

(2)

 

Yes, we can find examples here. We find the Cayley tables of three suitable magmas; we call the non-cyclic group one m1, the non-associative loop one m2, and the non-invertible magma m3.

 

Enumerate(6, group, output = list)

(3)

"m1 := ?[2]:"

Enumerate(6, loop, output = list)[1 .. 5]

(4)

 

"m2 := ?[2]:"

Enumerate(6, associative, identity, output = list)[1 .. 5]

(5)

 

Most of these appear to have many more of one value than of another (e.g., many more threes). Let's find one where that is not so extreme. For example, we might want to minimize the standard deviation of the frequencies of the values occurring in the Cayley table.

 

lst := Enumerate(6, associative, identity, output = list)

lst := remove(IsLeftInvertible, lst)

numelems(lst)

2235

(6)

frequencies := map(proc (m) options operator, arrow; map2(numboccur, m, [seq(1 .. 6)]) end proc, lst)``

with(Statistics)

sds := map(StandardDeviation, convert(frequencies, 'set'))

{HFloat(2.449489742783178), HFloat(3.0983866769659336), HFloat(3.1622776601683795), HFloat(3.22490309931942), HFloat(3.286335345030997), HFloat(3.3466401061363027), HFloat(3.4058772731852804), HFloat(3.4641016151377544), HFloat(3.464101615137755), HFloat(3.521363372331802), HFloat(3.5213633723318023), HFloat(3.5777087639996634), HFloat(3.6331804249169903), HFloat(3.687817782917155), HFloat(3.7416573867739413), HFloat(3.794733192202055), HFloat(3.8470768123342687), HFloat(3.847076812334269), HFloat(3.898717737923586), HFloat(3.9496835316262997), HFloat(3.9496835316263), HFloat(3.9999999999999996), HFloat(4.0), HFloat(4.049691346263318), HFloat(4.09878030638384), HFloat(4.147288270665544), HFloat(4.195235392680606), HFloat(4.1952353926806065), HFloat(4.2895221179054435), HFloat(4.33589667773576), HFloat(4.3817804600413295), HFloat(4.427188724235731), HFloat(4.47213595499958), HFloat(4.5166359162544865), HFloat(4.560701700396552), HFloat(4.604345773288535), HFloat(4.604345773288536), HFloat(4.6475800154489), HFloat(4.69041575982343), HFloat(4.732863826479693), HFloat(4.774934554525329), HFloat(4.77493455452533), HFloat(4.8166378315169185), HFloat(4.857983120596447), HFloat(4.898979485566356), HFloat(4.9396356140913875), HFloat(4.939635614091388), HFloat(4.979959839195493), HFloat(5.019960159204453), HFloat(5.059644256269407), HFloat(5.0990195135927845), HFloat(5.138093031466052), HFloat(5.176871642217914), HFloat(5.215361924162119), HFloat(5.253570214625479), HFloat(5.291502622129181), HFloat(5.329165037789691), HFloat(5.366563145999495), HFloat(5.403702434442518), HFloat(5.440588203494177), HFloat(5.477225575051661), HFloat(5.513619500836089), HFloat(5.549774770204643), HFloat(5.585696017507577), HFloat(5.621387729022079), HFloat(5.656854249492381), HFloat(5.692099788303083), HFloat(5.727128425310542), HFloat(5.761944116355173), HFloat(5.796550698475776), HFloat(5.830951894845301), HFloat(5.865151319446072), HFloat(5.8991524815010505), HFloat(5.93295878967653), HFloat(5.932958789676531), HFloat(5.966573556070519), HFloat(6.0), HFloat(6.0332412515993425), HFloat(6.066300355241241), HFloat(6.066300355241242), HFloat(6.099180272790763), HFloat(6.131883886702357), HFloat(6.164414002968976), HFloat(6.196773353931867), HFloat(6.228964600958975), HFloat(6.260990336999411), HFloat(6.29285308902091), HFloat(6.324555320336759), HFloat(6.356099432828282), HFloat(6.418722614352485), HFloat(6.48074069840786), HFloat(6.511528238439883), HFloat(6.542170893518451), HFloat(6.572670690061994), HFloat(6.603029607687671), HFloat(6.603029607687672), HFloat(6.6332495807108), HFloat(6.663332499583073), HFloat(6.6932802122726045), HFloat(6.693280212272605), HFloat(6.723094525588644), HFloat(6.723094525588645), HFloat(6.752777206453653), HFloat(6.782329983125268), HFloat(6.811754546370561), HFloat(6.928203230275509), HFloat(6.957010852370435), HFloat(6.985699678629192), HFloat(7.014271166700073), HFloat(7.042726744663604), HFloat(7.0710678118654755), HFloat(7.127411872482185), HFloat(7.155417527999327), HFloat(7.183313998427188), HFloat(7.18331399842719), HFloat(7.293833011524188), HFloat(7.429670248402684), HFloat(7.4565407529228995), HFloat(7.4565407529229), HFloat(7.483314773547883), HFloat(7.536577472566709), HFloat(7.53657747256671), HFloat(7.563068160475615), HFloat(7.64198926981712), HFloat(7.77174369109018), HFloat(7.8993670632526), HFloat(7.92464510246358), HFloat(7.9498427657407165), HFloat(8.024961059095553), HFloat(8.12403840463596), HFloat(8.366600265340756), HFloat(8.390470785361211), HFloat(8.390470785361213), HFloat(8.414273587185052), HFloat(8.438009243891594), HFloat(8.508818954473059), HFloat(8.854377448471462), HFloat(8.87693640846886), HFloat(8.921883209278185), HFloat(9.338094023943), HFloat(9.338094023943002), HFloat(9.359487165438072), HFloat(9.81835016690686), HFloat(9.818350166906862), HFloat(10.295630140987)}

(7)

 

Aha, the smallest standard deviation is a bit under two and a half, and the next possible value is greater than 3. Let's examine the Cayley tables that show this standard deviation.

NULL

small_sd_index := select(proc (i) options operator, arrow; StandardDeviation(frequencies[i]) < 3 end proc, [seq(1 .. numelems(frequencies))])

[1636, 1638, 2234, 2235]

(8)

small_sd := lst[small_sd_index]

(9)

 

The last of these looks interesting.

 

m3 := small_sd[-1]

NULL

Now we can display these three Cayley tables:

CayleyColorTable(m1); CayleyColorTable(m2); CayleyColorTable(m3)

 

It's clear that the multiplication shown in the third Cayley table is not invertible (because multiplying by any element other than 1, on either side, is not a permutation of the elements: rows and columns beyond the first don't have all colors). It's less visually obvious that the second Cayley table doesn't show an associative multiplication, but a quick loop showed that 5*(3*3) = 5*5 and 5*5 = 4 whereas 3*(3*5) = 3 and 3 = 3. I'm not sure if there is something real underpinning this, but to my mind this is a nice parallel to the fact that when you're proving a set with a given operation is a group, it's easier to show that there are inverses than that the operation is associative.

 

A second nice visualization, also usable in the first week or two of a group theory course, is also named after Cayley: Cayley graphs. Here is a Cayley graph for the dihedral group D[3] of order 6:

 

with(GroupTheory)

D3 := DihedralGroup(3)

_m132248572811840

(10)

with(GraphTheory)

DrawGraph(CayleyGraph(D3), layout = spring)

 

NULL

Here is a well-known presentation of the alternating group on 4 letters. I find "grabbing and turning" the 3D plot shows the structure much better than simply an embedding of the graph in the plane.

 

a4 := `<|>`(`<,>`(a, b), `<,>`(a^3, b^2, a.b.a = b.(a^2).b))

_m132249105458016

(11)

DrawGraph(CayleyGraph(a4), layout = spring, dimension = 3, size = [800, 800])

 

 

Another great opportunity for a visualization comes a couple of weeks later, when you talk about subgroup lattices. Here are a few examples:

 

with(GroupTheory)``

qd := QuasiDihedralGroup(2)

_m132249751531168

(12)

GroupOrder(qd)

16

(13)

DrawSubgroupLattice(qd, normal = false, center = false)

 

 

This is the plain subgroup lattice. Note how the subgroups in the first and second nontrivial "layer" from the bottom are grouped by conjugacy class. The default visualization of a subgroup lattice highlights the centre in light blue and the (in this case six) other normal subgroups in green.

 

DrawSubgroupLattice(qd)

 

 

We see that every conjugacy class of size one is a normal subgroup. We can also highlight other subgroups, if we want. Maybe we want to show which are the (cyclic) subgroups generated by one of the chosen generators:

 

generators := Generators(qd)

[_m132249751506336, _m132249751509600]

(14)

DrawSubgroupLattice(qd, highlight = [seq({g}, `in`(g, generators))])

 

 

Of course you can also show more advanced topics in this way. For example, here is the Frattini series of this group.

 

DrawSubgroupLattice(qd, highlight = FrattiniSeries(qd))

 

NULL NULL


 

Download blogpost-algebra.mw

Hello,

I have updated to maple 2024 on both my desktop and my laptop, and now I am missing the feature "Convert Output Units:" in the context tab on my windows 11 laptop. It's still available on my windows 10 desktop.

I have tried reinstalling maple and installing java, but it unfortunately did not help. Due to limited school licences, I am unable to test with maple 2023.

Is this an issue you have heard of?

Thank you in advance,

Daniel

 

And here is the context menu on windows 11. Also nothing happens when I click "Format -> Convert Output Units" in the top menu. 

 

Hello, i have been drawing some cool 3d plots for my assignment, but when i use the export button and export it as pdf the plots turn out very low quality. 

See the image below is using the export function

Then i tried something different i tried using the print button and printing to a pdf.

That resulted in a different looking plot

This plot using the print to pdf feature looks much nicer, but the 3d text plot has become impossible to read.

 

Is there a way to fix that? Or to make the export to pdf feature export at higher quality? 

Best Regards

I have a list of values in the range from 1 to 6 inclusive:

    [> y := [ seq(rand(1..6)(), i = 1..10) ] : # step 1

I would like to replace all elements <= 3 with -1 and all elements > 3 with 1

    [> y := subs(1=-1, 2=-1, 3=-1, 4=1, 5=1, 6=1, y) : # step 2

Then calculate the cumulative sum

    [> y := [ seq(add(y[ .. i]), i = 1..n) ] : # step 3

And plot the results

    [> plot([ seq(i, i = 1..n) ], y) # step 4
 

This all works, but step 2 is downright ugly. Is there a more elegant expression available?

And step 4 requires I generate an extra data set for the x-axis. Is there a way to specify just the the y-values and have Maple assume the x-values are in the range  1..nops(y)? (Something akin to just  plot(y), which produces output I don't understand.)

By way of example, I am trying to replicate this MATLAB expression:

    > y = cumsum(2*(randi(6, 10, 1) <= 3) - 1); plot(y)

 

 

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