MaplePrimes Questions

Anyone know about a Hypergraph package for maple like

HyperNetX in Python

https://pnnl.github.io/HyperNetX/build/overview/index.html

Is their anyway we can use python packages in maple

Hello:

I've changed my laptop this week and I'd like to know how to install Maple with my account in the new one.

Thanks in advance.

Sergio Sanz.

hi everybody, i have a question, i hope u can help me, i want to know how to convert a complex function to conjugate form, for example i want to convert  exp(Ix)  to exp(-Ix) when x is real. conjugate  command dosn't work for me, becuse it assume  that we dont khow x is real or not,when i use assume command befor conjugate,again it does not  solve my problem, in the other hand, evalc command dosn't work too, becuse i want to have exponential form. thanks so much

I have some maple procedures that worked fine for many years. However, I started to notice some important performance deterioration with the new versions (Maple 2021 and 2022). I could identify the "culprit", they are some simplify/sum commands like this one:

A := simplify( sum( sum( sum( sum(sum( sum( sum( sum(
((x-i1)^2+(y-i2)^2)*((x-j1)^2+(y-j2)^2)*((x-k1)^2+(y-k2)^2)*((x-l1)^2+(y-l2)^2) ,i1=1..N)
,j1=1..N),k1=1..N),l1=1..N) ,i2=1..N),j2=1..N),k2=1..N),l2=1..N) );


Using, for instance, Maple 2017, this command requires to complete:

N:=4
memory used=258.2MB, alloc=44.3MB, time=1.58
N:=6
memory used=5247.1MB, alloc=394.0MB, time=39.35
N:=7
memory used=16405.4MB, alloc=775.9MB, time=135.78

On the other hand, in Maple 2022 (similar results for 2021), we have

N:=4
memory used=527.7MB, alloc=44.3MB, time=3.85
N := 6
memory used=10763.4MB, alloc=409.6MB, time=97.22
N := 7
memory used=34564.2MB, alloc=1139.9MB, time=351.94

My laptop (16G RAM) cannot execute N:=8 in Maple 2022 in reasonable time, I guess due to RAM limitation.

Does someone have any hint on how to improve the performance of these commands in Maple newer versions?
 

Mathmatica give the right answer:

I am composing a note using a maple document to demonstrate how the  mathematics from a text (that I find rather dense) can be unfolded into actual calculations using Maple.   My problem is to relate a typeset expression to actual Maple notation that bears no resemblance to the formal expression.

What I would like to do is to convert the typeset notation into a maple name which I can then associate with the calculation written in the functional notation.  For example, the quantity

|A0|2 := leftcontract(reverse(A0),A0);

When I use convert(|A0|2, name);   The result is abs(A[0] ^2 ) which isn’t typeset.

Similarly, the use of single left quotes around the expression as in ` |A0|2 ` it produces an error message when I test the result.  

type( ` |A0|2 ` ,name);
 Error, mismatched or missing bracket/operator

Admittedly, for ordinary calculations, just using any convenient name is more than satisfactory. However, in this case, where I’m trying to link together formal mathematical notation with the Maple operations it implies, being able to link the calculations to a special typeset same would be useful.

Let's say we have a procedure with an optional keyword option and a second procedure is calling this procedure and we want to give the user the option to set the kwarg of the first procedure in the second procedure as well. A simple example (just for the sake of the question, nothing meaningful in this example) is given below. Look at the kwarg "b" in test1. test2 is calling test1 and we want to have the option of setting "b" of test1 in test2 as well. But if I use "b = b" when calling test1, it doesn't work! I thought of using "`b` = b" and even "'b' = b", but they don't work either. One solution is to use a new name, say "c" and calling test1 by "b = c". But that is a bad choice. Because if you call test1 in so many other procedures, then you have to use so many names for one parameter, clearly this is not user friendly too, the user would prefer to remember a parameter by a fixed name. Is there any solution so that I can use the same name here?

test1 := proc( a :: posint, { b :: posint := 1 } ) :: posint:
	return( a + b ):
end proc:
test2 := proc( a :: posint, { b :: posint := 1 } ) :: posint:
	return( a * test1( a, b = b ) ):
end proc:
test3 := proc( a :: posint, { b :: posint := 1 } ) :: posint:
	return( a * test1( a, `b` = b ) ):
end proc:
test4 := proc( a :: posint, { c :: posint := 1 } ) :: posint:
	return( a * test1( a, b = c ) ):
end proc:

What does the & is doing in the following expressions:

1. for m from n by (-2) while n  & gt; 2 do
2.  if errr & gt ; perrr or errrs & gt ; perrrs then
3. if derrr & gt ; 10^(10) then
4. printf(" \134n");

 Help in writing Maple code to transform differential equation with partial derivatives into ordinary differential equation

Hello everyone!

Please help me with this issue.
I have a plot with three curves and when I do any modification to the view (zoom in/out, pan) one of those curves disappears.

This is the plot before the modification of the view:


And this is the plot after the modification: (I just selected the "pan" option and clicked the plot)


What can I do to keep in view all the curves?
Thanks.

SDFS_primer_intento.mw

I use the command line mint  since all my code in .mpl files.

First question:

I noticed mint complains that module name is global, for proc inside the module itself, when the name is used as type of a local variable. But maplemint does not complain. Here is an example

A:=module()
   local B:=module()
         option object;
         export n::integer:=1;
   end module;

   export foo:=proc()
      local a::A:-B;  #mint complains that A is global not declared!
      a:=Object(A:-B);
      a:-n:=2;
   end proc;
end module;

running mint -i 2 A.mpl gives

These names were used as global names but were not declared:  A

But A is the module name where the whole code is sitting inside it?  To fix this, I have to add

A:=module()
   local B:=module()
         option object;
         export n::integer:=1;
   end module;

   export foo:=proc()
      global A;  ###################add this
      local a::A:-B;
      a:=Object(A:-B);
      a:-n:=2;
   end proc;
end module;

And now the message/warning is gone. But the above looks really strange.  maplemint does not complain about global A:

But notice that maplemint gives waring that n is never used but mint do not. Another difference!

Which is right about the global name message?

Second question is: I do not understand the message

     These local variables were assigned a value, but otherwise unused:  B

which both mint and maplemint give,

What does it mean B is not used?? I used it to make object a inside proc foo().

What would one do to get rid of this message?

Final comment:

I find many message come out that are not real problems at all. For example, if I declare local variable and use it in equation, as symbol, mint complains that the variable was not assigned a value. Here is an example

foo:=proc()
   local x,eq;
   eq := x^2;
   return eq;
end proc;

now maplemint(foo) gives

Procedure foo()
  These local variables were used but never assigned a value:  x

I know there are ways to filter out these messages. But I am afraid if I do that, I will filter out a message that indicates a real problem?

According to help   -i 2 shows Display severe and serious errors (default)

if I use -i 1, then these message do not show. What do others use?  Level 1 or 2? If I use level 3, then more strange messages show which I do not understand at all how to remove. Such as

These parameters or local variables are also system defined names:
      thismodule
  These names are special to Maple:
      thismodule

So I stick to level 2 for now. but 90% of the messages I get are not real errors at all.

 I want to do the program to convert equation 6 to equation 8 or 7 to 8.

 

Dear colleagues,

how can i plot streamlines and isothermes and also 3D graphes of Nussult number and skin friction coefficient for boundary layer flow problem with Maple? 

Regards

MAXR

Modified.mw

3D plots of nusselt number like:

Streamline like:

Hello to anyone, 

i am trying to change the valué of x downwards in to the matrix of the next code, but my loop is failing. 
 

n:=5

R:=Matrix(5,n):

for i from 1 to n do 

R[..,i]:=(sin(i*x));

end do:

R;

Untill here all okay, but the next loop is the problem

for i from 1 to 5 do

i:=i

x:=i

R[i,..] := sin(x));

end do:

R;


Thanks for your kind help 

I have a relatively simple procedure that attempts to provide a continuous function from arctan.

This function, when called is not returning values properly for some unknown reason. It is not updating variables.

The code is relatively simple, given a continuous vector valued function it gets the angle using arctan(y,x). The problem with this function is that it is not continuous as it only evaluates the function along the principle branch.

What the function below attempts to do is find out when the function has a jump discontinuility and it provides the amount to shift to make the output continuous. To do this requires some memory which is stored in the global variable l.

vs := t->[cos(3*t), sin(t)];
nvs := t->sqrt(vs(t)[1]^2 + vs(t)[2]^2);
v := t->vs(t); l/~nvs;

l := 0:
ls := [0,0]:
ArgK := proc(f, t)
    local e := 0.005, q := 0, y1, y2:
    global l, ls:    
    y1 := evalf(arctan(f(t)[2], f(t)[1]),50);
    y2 := evalf(arctan(f(t+e)[2], f(t+e)[1]),50);
    if ls[1] = 0 then
        if abs(y2 - y1) > 1.5 then l := l - sgn(y2 - y1)*2*Pi; ls := [1,t]: q := 1434: fi;

    fi;
    #arctan(f(t)[2], f(t)[1]) + l;
    [l,q, IF(abs(y2 - y1) > 1.5)];
end proc:

l := 0:
ArgK(v,Pi/2);
ArgK(v,Pi);
([seq([2*Pi*k/10, ArgK(v,2*Pi*k/10)],k=0..10)]);
listplot([seq([2*Pi*k/1000, ArgK(v,2*Pi*k/1000)[1]],k=0..1000)]);

output:

                           [0, 0, 0]

                        [2 Pi, 1434, 1]

[                   [1                 ]  [2                 ]  
[[0, [2 Pi, 0, 0]], [- Pi, [2 Pi, 0, 0]], [- Pi, [2 Pi, 0, 0]],
[                   [5                 ]  [5                 ]  

  [3                 ]  [4                 ]                      
  [- Pi, [2 Pi, 0, 0]], [- Pi, [2 Pi, 0, 0]], [Pi, [2 Pi, 0, 1]],
  [5                 ]  [5                 ]                      

  [6                 ]  [7                 ]  
  [- Pi, [2 Pi, 0, 0]], [- Pi, [2 Pi, 0, 0]],
  [5                 ]  [5                 ]  

  [8                 ]  [9                 ]                      
  [- Pi, [2 Pi, 0, 0]], [- Pi, [2 Pi, 0, 0]], [2 Pi, [2 Pi, 0, 0]]
  [5                 ]  [5                 ]                      

  ]
  ]
  ]

The nonsense output is not my fault, copying directly from maple. The main thing is thatat 2pi, the output should be 1434(see 2nd line) but there is no 1434. The output is completely ignored. It seems the correct jump is never calculated properly in the sequence although it works fine manually and has worked before when messing with the code.

e.g., these should be identical

[2 Pi, 1434, 1]

[Pi, [2 Pi, 0, 1]],

yet there is a 0 where there should be a 1434. (I was using q to figure out why the thing was not working)

I've been playign around with the code trying to get it to work but I've not been able to as maple is doing something very funky.  It should be a very simple problem of detecting a jump discontinuility then adding an appropriate amount(which must be tracked).

ls was used because I was getting wierd results around the discontinuity where the test would be called multiple times, I guess because something to do with the evaluation in plotting.

E.g., commenting out the ls if statement will get the step function one epects except it's not the right values.

The idea is simple though. For a continuous function theta(t) one should be able to provide a full and meaningful angle that takes in to account the correct branch when extracting this angle from a continuous function that is known to provide a continuous theta(t). i.e., Ang(f(t)) should be continuous. This is what I'm trying to achieve.

First 257 258 259 260 261 262 263 Last Page 259 of 2415