Maple 2022 Questions and Posts

These are Posts and Questions associated with the product, Maple 2022

Hi,

I just started to try out maple, as I'm testing out some software. So far it's been fairly easy to work in. I have ran into this interesting solution however

The issue I'm having is that the solution should not be... whatever that is. It should result in, off the top of my head, 2 or 4 numbers, and I'm only interested in one of them. None of the above is the answer to my question however. I don't know exacty what I'm supposed to do to get to that point. looking up the "RootOf" part on the support page didn't really explain it all that well.

Any chance to have "Evaluate->Remove Output From Worksheet" become active and usable when one is still running something in the worksheet?  May be in 2023 version?

This is something that has been missing in Maple for ages.

Maple definitely slows down when the worksheet becomes full of output (from print messages) when a command has been running for long time. Now there is no way to remove the output in the worksheet until the command completes which can take hours. May be this slow down because the scrolling/writing to the worksheet slows down, and this affects how long it takes to complete as the engine is waiting for the frontend to finish writing to the worksheet?. I do not know. I just know Maple slows down when this happens.

I do not understand why Maple can't implement this. Is there a tehnical reson which will make removing current output in the worksheet not possible while a command is running?

We have just released the 2022.2 updates for Maple and MapleSim. These updates are freely available to all customers who have the 2022 version of these products.

Maple 2022.2 includes improvements to worksheet performance, the math engine, and more. As always, we recommend that all Maple 2022 users install this update. It is available through Tools>Check for Updates in Maple, and is also available from our website on the  Maple 2022.2 download page, where you can also find more details.

The MapleSim 2022.2 family of products offers an enhanced user experience through an expansion of the modeling libraries, a range of new productivity features, and several new options requested by users. See the MapleSim 2022.2 update page for details on new features, and for instruction on how to obtain your update.

I have an Array A which I wanted to convert to Matrix. Doing B:=convert(A,Matrix); displays different on the screen than if A is first converted to list, then the list is next converted to Matrix.

Also the dimension in the first case if not the same as the dimension of the matrix done using the list conversion first. I expected both to give same dimension which is 10 by 3 in this example.

Should not both be the same? Does this to convert an Array to Matrix, one first needs to convert it to list, then convert the list to Matrix?

ps. thinking more about this, I think this seems to work as designed. I just expected convert to Matrix to generate the standard 2 dimensional matrix  10 by 3 automatically from the Array, but I see now that it probably does need that extra conversion to a list first.

 


 

interface(version);

`Standard Worksheet Interface, Maple 2022.1, Windows 10, May 26 2022 Build ID 1619613`

restart;

A:=Array(1..0);
for i from 1 to 10 do
   A ,= [i, i+1, i+2]
od:
B:=convert(A,Matrix);
whattype(B);
LinearAlgebra:-Dimension(B);

A := Vector[row](0, {})

Matrix(%id = 36893490060059048044)

Matrix

1, 10

restart;
A:=Array(1..0);
for i from 1 to 10 do
   A ,= [10-i, i+1, i+2]
od:
B:=convert(A,list);
B:=convert(B,Matrix);
whattype(B);
LinearAlgebra:-Dimension(B);

A := Vector[row](0, {})

B := [[9, 2, 3], [8, 3, 4], [7, 4, 5], [6, 5, 6], [5, 6, 7], [4, 7, 8], [3, 8, 9], [2, 9, 10], [1, 10, 11], [0, 11, 12]]

Matrix(%id = 36893490060058557844)

Matrix

10, 3

 

 


 

Download oct_25_2022.mw

Dear all:

    I am trying to use the subs command to replace 5 varibles with other specific 5 varibles.

to be simple, here is issue.

Now I and using the stupid way(manually replace eachstep by my self) which did work but with some small issue such as  simplify or subs not work for replacements

all the steps I did are contained inside here:

ModelExtrinsicParasiticExtraction_QuestionsV2.mw

thanks for your help.

best regards

with(Physics)

diff(x(t), `$`(t, 2)) = a(t)

diff(diff(x(t), t), t) = a(t)

(1)

dsolve(diff(diff(x(t), t), t) = a(t), arbitraryconstants = subscripted)

x(t) = Int(Int(a(t), t), t)+c__1*t+c__2

(2)

a(t) = 1.*Unit('m'/'s'^2), c__1 = 2*Unit('m'/'s'), c__2 = 3*Unit('m')

a(t) = 1.*Units:-Unit(m/s^2), c__1 = 2*Units:-Unit(m/s), c__2 = 3*Units:-Unit(m)

(3)

subs(a(t) = 1.*Units:-Unit(m/s^2), c__1 = 2*Units:-Unit(m/s), c__2 = 3*Units:-Unit(m), x(t) = Int(Int(a(t), t), t)+c__1*t+c__2)

x(t) = Int(Int(1.*Units:-Unit(m/s^2), t), t)+2*Units:-Unit(m/s)*t+3*Units:-Unit(m)

(4)

value(%)

x(t) = (1/2)*t^2*Units:-Unit(m/s^2)+2*Units:-Unit(m/s)*t+3*Units:-Unit(m)

(5)

NULL

Warning, units problem, not enough information to unambiguously deduce the units of the variables {t}; proceeding as if dimensionless

How can I provide the information to Maple that the unit of t is s?

 

Update: Temporarily disabling the warning would also be an option for the above case.

 

Download Unit_of_t.mw

I have 5 procedures saved in my library. Say Proc1, Proc2, Proc3, Proc4 and Proc5. They all work ok.

Proc5 calls Proc4 which calls Proc3 which calls Proc2 which calls Proc1. That is fine if I read them all in to the dodument.

Is it ok ok to put read commands in procedures 5..2 so I don't have to manually load them all myself into a new document or is there a better way to do this. These procedures are not part of a package.
I hace set 

currentdir();
      "C:\Users\Ronan\Documents\maple\Alibrary\Procedures"

which is where the procedures are stored. If I just load Proc5 it doesn't find the other procedures

dear all,

I am trying to use the solve to get symbolic answer.

to be simple, here is issue:

I have 15equations with 16 varibles.

the 15 equation as follows:

first 4 equation set 

equList_Ya :=

[ Va1 Ya11 + Va2 Ya12 + Va3 Ya13 + Va4 Ya14 = Ia1, 

  Va1 Ya21 + Va2 Ya22 + Va3 Ya23 + Va4 Ya24 = Ia2, 

  Va1 Ya31 + Va2 Ya32 + Va3 Ya33 + Va4 Ya34 = Ia3, 

  Va1 Ya41 + Va2 Ya42 + Va3 Ya43 + Va4 Ya44 = Ia4]

2nd 4 equation set

equList_Yb := 

[ Vb1 Yb11 + Vb2 Yb12 + Vb3 Yb13 + Vb4 Yb14 = Ib1, 

  Vb1 Yb21 + Vb2 Yb22 + Vb3 Yb23 + Vb4 Yb24 = Ib2, 

  Vb1 Yb31 + Vb2 Yb32 + Vb3 Yb33 + Vb4 Yb34 = Ib3, 

  Vb1 Yb41 + Vb2 Yb42 + Vb3 Yb43 + Vb4 Yb44 = Ib4]

the 3rd 4 equation set

equList_ConnectCondition :=

[Ia3 = -Ib1, Ia4 = -Ib2, Va3 = Vb1,  Va4 = Vb2]

the 4th 3 equation set

 equList_Y11Condition := [Va2 = 0, Vb3 = 0, Vb4 = 0]

so total equation number is 4+4+4+3=15

equList_Y11all := {Ia3 = -Ib1, Ia4 = -Ib2, Va2 = 0, Va3 = Vb1, Va4 = Vb2, Vb3 = 0, 
 Vb4 = 0, Va1*Ya11 + Va2*Ya12 + Va3*Ya13 + Va4*Ya14 = Ia1,
 Va1*Ya21 + Va2*Ya22 + Va3*Ya23 + Va4*Ya24 = Ia2,
 Va1*Ya31 + Va2*Ya32 + Va3*Ya33 + Va4*Ya34 = Ia3, 
 Va1*Ya41 + Va2*Ya42 + Va3*Ya43 + Va4*Ya44 = Ia4,
 Vb1*Yb11 + Vb2*Yb12 + Vb3*Yb13 + Vb4*Yb14 = Ib1,
 Vb1*Yb21 + Vb2*Yb22 + Vb3*Yb23 + Vb4*Yb24 = Ib2, 
 Vb1*Yb31 + Vb2*Yb32 + Vb3*Yb33 + Vb4*Yb34 = Ib3,
 Vb1*Yb41 + Vb2*Yb42 + Vb3*Yb43 + Vb4*Yb44 = Ib4}

the 16 varible is 

var_Y11 :=

[ Va1, Va2, Va3, Va4,

  Ia1, Ia2, Ia3, Ia4,

  Vb1, Vb2, Vb3, Vb4,

  Ib1, Ib2, Ib3, Ib4]

I hope to get Ia1=f(Va1) to calculate Y11(=Ia1/Va1)

but the solve give nothing:

Y11_all := solve(equList_Y11all, {Ia1}, symbolic = true);                        

Y11_all := NULL

Question1: why the above solve output nothing???

since not work,so I try another way:

polys_Y11 := map(lhs - rhs = 0, equList_Y11all);
    polys_Y11 := {Va2 = 0, Vb3 = 0, Vb4 = 0, Ia3 + Ib1 = 0, 

      Ia4 + Ib2 = 0, Va3 - Vb1 = 0, Va4 - Vb2 = 0, 

      Va1 Ya11 + Va2 Ya12 + Va3 Ya13 + Va4 Ya14 - Ia1 = 0, 

      Va1 Ya21 + Va2 Ya22 + Va3 Ya23 + Va4 Ya24 - Ia2 = 0, 

      Va1 Ya31 + Va2 Ya32 + Va3 Ya33 + Va4 Ya34 - Ia3 = 0, 

      Va1 Ya41 + Va2 Ya42 + Va3 Ya43 + Va4 Ya44 - Ia4 = 0, 

      Vb1 Yb11 + Vb2 Yb12 + Vb3 Yb13 + Vb4 Yb14 - Ib1 = 0, 

      Vb1 Yb21 + Vb2 Yb22 + Vb3 Yb23 + Vb4 Yb24 - Ib2 = 0, 

      Vb1 Yb31 + Vb2 Yb32 + Vb3 Yb33 + Vb4 Yb34 - Ib3 = 0, 

      Vb1 Yb41 + Vb2 Yb42 + Vb3 Yb43 + Vb4 Yb44 - Ib4 = 0}

and solve it with 

what I expected is Ia1=f(Va1) which Va1 as indepentent,but the above solution have no Va1 
Question2: is the (22) give the right answer for Ia1 ? what is the indepent var for the above solution?

here is my full maple worksheet

CoupleLineSeriesConnect_Question.mw

thx for your help.

best regards

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.

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:

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'm trying to get the plot command to display correctly on a logarithmic axis. The calculations in Maple are correct but the plots using logarithmic axis are wrong and start at different points on the x-axis. Is there a way to force Maple to display set points along the axis? e.g. 1, 3, 5, 10 of each logarithmic range. 

Log_plot_example.mw

First 26 27 28 29 30 31 32 Last Page 28 of 39