tomleslie

9290 Reputation

17 Badges

11 years, 215 days

MaplePrimes Activity


These are replies submitted by tomleslie

@The function 

one of them plots Re(f(x)) versus x together with Im(f(x)) versus x and the other plots Im(f(x)) versus Re(f(x)) - exactly ehat is difficut to understand?

@vv 

till I played around a little more.

The success/failure of the add() command appears to depend on whether or not it was preceded by a seq() command.

Since these two commands *ought* to be independent (compartmentalised?) this is just seriously weird

@vv 

As yu can see from the original worksheet I posted, with compile=false, both add() and seq()  work.

I thing that the source of the error may be due to the fact that one is doing an elementwise add of two-element arrays. Maybe such an operation is not available when "compiled".

@acer 

For the expression 1/sin(x*y), can someone provide me with values for 'x' and 'y' which would make 1/sin(x*y)=0.

Cos if you can't then most of the above is pretty fair crap

Sometimes wetware beats software?

Both Maple and the referenced wikipedia article us the classification produced here

https://www.gap-system.org/

It is relatively simple to generate the numbers of groups of given order, subdivided into Abelian and non-Abelian, as shown in the attached

  restart;
#
# Number of Abelian groups of order up to 31.
# Compare with the equivalent table at
#
# https://en.wikipedia.org/wiki/List_of_small_groups#Small_groups_library
#
# and the integer sequence at
#
# https://oeis.org/A000688
#
  seq(GroupTheory:-NumAbelianGroups(j), j=1..31);
#
# Number of non- Abelian groups of order up to 31.
# Compare with the equivalent table at
#
# https://en.wikipedia.org/wiki/List_of_small_groups#Small_groups_library
#
# and the integer sequence at
#
# https://oeis.org/A060689
#
  seq(GroupTheory:-NumGroups(j)-GroupTheory:-NumAbelianGroups(j), j=1..31);

1, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 5, 1, 2, 1, 2, 1, 1, 1, 3, 2, 1, 3, 2, 1, 1, 1

 

0, 0, 0, 0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 9, 0, 3, 0, 3, 1, 1, 0, 12, 0, 1, 2, 2, 0, 3, 0

(1)

 

Download smallG.mw

@Wolfgang Gellien 

for asny given expression, the two operations simplify(expression) and solve(expression=0) are not the same. In the OP's case, the first operation results in the expression b-1, and the second results in the equation b=1,

@jalal 

A quick search with your favourite search engine will show that the the "principal' angle is in the range 0..360. If you really want angles in the range -180..180, then all you need to do is subtract Pi from and of the methods I gave previously, as in the attached


 

  restart;
  randomize():
 

  L1:= [ seq( modp(j,360)*2*Pi/360,
              j=-720..-30, 15
            ),
         seq( modp(j,360)*2*Pi/360,
              j=30..720, 15
            )
       ]:
  r1:= rand(1..numelems(L1)):
  Da:= L1[r1()]-Pi;

-(2/3)*Pi

(1)

  L2:= [ seq( j,
              j=-720..-30, 15
            ),
         seq( j,
              j=30..720, 15
            )
       ]:
  r2:= rand(1..numelems(L2)):
  Da:= modp( L2[r2()], 360)*2*Pi/360-Pi;

(3/4)*Pi

(2)

  L3:= [ seq( j*2*Pi/360,
              j=30..360, 15
            )
       ]:
  r3:= rand(1..numelems(L3)):
  Da:= L3[r3()]-Pi;

(5/12)*Pi

(3)

 


 

Download ang2.mw

To perfom numeric integration 'n' must be given a numeric value!

But there are other issues, such as

  1. the integrand is infinite when x=1, because of the term (x-1) in the denominator
  2. depending on the value of 'n', the argument of the ln() function can be negative for part of the range x=0..1, meaning that ln() will be complex

@lcz 

'positive' just means >0, doesn't have to be an integer. 'posint' means >0 and must be an integer. So type(2.1, positve) will return true because 2.1>0, but type(2.1, posint) will return false because 2.1 is not an iinteger.

You can define new types interms of MAple's existing types. See this exerpt from the Maple help (my highlighting) as well as the attached

Definition of a Type in Maple
Description

  • By definition, a type in Maple is any expression that is acceptable as the second argument to the procedure type, and that, for any choice of first argument to type causes it to return either true or false. For example, in type(expr, typexpr), expr is of type typexpr if and only if the first expression evaluates to true.
  • Any particular type belongs to one of the following four categories:
  1. A system type: a type which is a name that is defined in the kernel of the Maple system. System types usually correspond to primitive algebraic or data structure concepts, such as integer, float, list, and relation.
  2. A procedural type where the type is a name, for example abc, and there is a procedure `type/abc` which will perform the type analysis of the argument and will return true or false accordingly. This procedure may be available from the global Maple environment or from a library (for the latter case it is automatically loaded into the environment). This is one of the mechanisms to define new types in Maple. For example, monomial, algnum, and specindex are presently implemented as Maple library procedures.
  3. An assigned type where the type is a name, such as abc, and the global name `type/abc` is assigned a type expression. The type evaluation proceeds as if the type checking were done with the expression assigned to `type/abc`. Thus

`type/intargs` := [algebraic, {name,name=algebraic..algebraic}];

....:

if not type([args],intargs) then error ...;

  The type last_name_eval is presently implemented as an assigned structured type in the library.

     4. A type expression which is a general Maple expression as described in type/structured.
 

  restart;
  f:= s -> type(s, posint)
           and
           type(log2(s), posint):
  f~([0, 4, -2]);

[false, true, false]

(1)

#
# An aside, what are the 'operands' associated
# with "simple" numbers in Maple
#
  op([0..], 2);
  op([0..], 2.0);
  op([0..], evalf(Pi));

Integer, 2

 

Float, 20, -1

 

Float, 3141592654, -9

(2)

#
# Difference between type::positive and type::posint
#
  type(2.1, positive);
  type(2.1, posint);

true

 

false

(3)

#
# Add/use new type
#
 `type/myType`:=And(posint, satisfies(s -> type(log2(s), posint))):
  type(2.1, myType);
  type(2, myType);

false

 

true

(4)

 

Download posType2.mw

 

 

@JAMET 

see the output in the attached, whihc clearly identifies the Maple version as

`Standard Worksheet Interface, Maple 18.02, Windows 7, October 20 2014 Build ID 991181`

 

If you are still having trouble, I  can only suggest that you actually do what I suggested previously - that is

 

  1. download the attached worksheet (use the link at the bottom of this post)
  2. run the attached worksheet using the !!! icon in the Maple toolbar
  3. save the resulting worksheet (with output) to a filename of your choosing
  4. upload the worksheet obtained at (3) above to this site using the big green up-arrow in the Mapleprimes toolbar

 

  restart;
  interface(version);
  a:= [3*t-7, -2*t+4, 3*t+4]:
  b:= [m+1, 2*m-9, -m-12]:
  c:= {x = -200/29-2*t, y = 114/29+3*t, z = 119/29+4*t}:
  doPlot:= proc( v )
                 uses geom3d:
                 local pName, j:
                 for j from 1 by 1 to 3 do
                     pName:=`union`(indets~(v[j])[])[]:
                   #
                   # The 3D line
                   #
                     line( cat(l, 4*j-3), v[j], pName);
                   #
                   # Projection of line on to x=0
                   #
                     line(cat(l, 4*j-2), [0, v[j][2], v[j][3]], pName);
                   #
                   # Projection of line on to y=0
                   #
                     line(cat(l, 4*j-1), [v[j][1], 0, v[j][3]], pName);
                   #
                   # Projection of line on to z=0
                   #
                     line(cat(l, 4*j), [v[j][1], v[j][2], 0], pName);
                 end do:
               #
               # The plane x=0
               #
                 plane(pl1, x=0, [x,y,z]);
               #
               # The plane y=0
               #
                 plane(pl2, y=0, [x,y,z]);
               #
               # The plane z=0
               #
                 plane(pl3, z=0, [x,y,z]):
               #
               # Draw everything
               #
                 draw( [ l1(color=black, thickness=4, linestyle=1),
                         l2(color=blue, thickness=2, linestyle=1),
                         l3(color=red, thickness=2, linestyle=1),
                         l4(color=green, thickness=2, linestyle=1),
                         l5(color=black, thickness=4, linestyle=3),
                         l6(color=blue, thickness=2, linestyle=3),
                         l7(color=red, thickness=2, linestyle=3),
                         l8(color=green, thickness=2, linestyle=3),
                         l9(color=black, thickness=4, linestyle=4),
                         l10(color=blue, thickness=2, linestyle=4),
                         l11(color=red, thickness=2, linestyle=4),
                         l12(color=green, thickness=2, linestyle=4),
                         pl1(color=yellow, style=surface, transparency=0.8),
                         pl2(color=yellow, style=surface, transparency=0.8),
                         pl3(color=yellow, style=surface, transparency=0.8)
                       ],
                       axes=normal,
                       scaling=constrained
                     );
           end proc:

`Standard Worksheet Interface, Maple 18.02, Windows 7, October 20 2014 Build ID 991181`

(1)

 doPlot([a, b, rhs~(convert(c,list))]);

 

 

Download drawLines3.mw

@Dr Jean-Michel Collard 

It took about 20 minutes.

And when you have retired, sometimes you find you have too much time, so don't knock it!

@tomleslie 

with the year at 2022, obviously both dates are in the future - I'd still check my systemTime/date from the control panel though

that (depending exactly on what you are trying to achieve) you *might* be able to "work around" this problem by using the plots:-pointplot() command. This will allow you to assign individual colors to each point (and it seems to work!), although you are restricted to using the same 'symbol' and 'symbolsize' for alll poinrts

See the attached
 

  restart;
  with(geom3d):
  point(A, [1, 2, 3]):
  point(B, [-2, 3, -1]):
  point(C, [0,-3, 1]):
  plots:-pointplot3d( [ coordinates(A),
                        coordinates(B), coordinates(C)
                      ],
                      color=[red, blue, green],
                      symbolsize=24,
                      symbol=solidsphere,
                      axes=none
                  );;

 

 

 

 

 


Download geomCol2.mw

and the impression given by PDE textbooks, most  PDEs cannot be solved analytically. It may be possible to solve your particular problem numerically, although this will require you to suppy numeric values for all parameters (alpha, beta, sigma) as well as another couple of boundary/initial conditions

in the Mapleprimes toolbar to upload your worksheet.

It is unlikely that anyone here will retype your worksheet in order to work on it.

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