C_R

3412 Reputation

21 Badges

5 years, 312 days

MaplePrimes Activity


These are replies submitted by C_R

@Carl Love 

Very elegant and new to me! I am wondering what is the help page that I have overlooked?
Thank you!

@epostma 

This will save time and prevent us from scaling errors that can still happen with the work arounds.

To make it perfect (and I am repeating myself here), there should be a plot option to set plot label units and rescale accordingly. In this instance I would have preferred everything in mm.

@tomleslie

Thank you!

I wouldn't have thought of that. I always thought that with such a construct, simplify is executed first and then convert.
Is there an explanation what is different in a nested command compared to two separate input lines?

 

I have not observed it recently. It vanished after system restart. I am not using style management  often so I can’t tell whether this persists.

My guess is that it is related to a change in display resolution which happens in my case in two scenarios:

  • 4k on a 32’’ Monitor to 2k on internal laptop monitor and back
  • Switching between two large Monitors, one at 2k the other at 4k

My overall impression is that such issues have become less frequent with newer versions of windows.

Thank you for following up

Right click in the left pane would definitely save time without loosing focus. Otherwise: In a help page without appropriate cross-reference or hyperlink on the “new topic of interest” in the left pane, it would be required to somehow clone the current help page before opening the “new topic of interest” in the left pane.

Since this post is about improving the help system: I would welcome an option that highlights the search query in a selected result in the left pane. Something like “crtl+f and highlight all” in Firefox. Right now, in Maples crtl+f, the search query has to be entered again in the search field and only one search query is highlighted at the time. Personally, I would have it highlight all enabled by default any without using crtl+f.

@Rouben Rostamian

This would be very interesting. Reproducing mode coupling in Maple (analytically) could give other insights than MapleSim can provide. Swapping frequency for example: On which parameters does it depend?

You can extract parameters from the screen shot bellow. In the attached worksheet are details how I estimated the length of the vertical post. All cross-sections are circular and of the same size. At the start of the simulation the vertical post is slightly inclined by the parameter phi (i.e. the asymmetry in boundary conditions). Similar results are obtained if the arms are attached with a slight offset dx (i.e. structural asymmetry).

It might be easier for you to bend the structure in horizonal direction at the start of the simulation (asymmetry in initial conditions which I could not make work). There is a dimension less parameter q that I use to fine tune the length. Due to the large deflections in my simulation the length of the vertical post had to be shortened by 10%. Mode coupling is only pronounced within 5% tuning range as you can see form the plots bellow (amplitudes in meter, [1]: x-direction, [2]: y-direction).

I observed that the horizontal amplitude becomes largest when the leaf shaped amplitude envelope is symmetric. Detuning transforms it into a croissant (third screen shot).

Good luck!

Parameter set:

q=0.1 vs q=0.15

q=0.1 vs q=0.13

 

 

 

Flexible_beam_mode_coupling_Estimation_of_post_length.mw

 

@acer

Thank you for clarifying that this is an endpoint of automatic simplification.

It’s interesting to note that Maple treats names differently.

.

 

Anyway, I was actually hoping that someone could refer me to comands I might have overlooked (like simplification options ‘size’, ‘power’, ’sqrt’ or other commands like combine or collect).

I am interested in compact output that I can communicate without reentering by hand which is error prone. Also, when transferring expressions to other software (Excel, Maplesim) it makes sense to have them in a compact form.

From classroom perspective 2^2/3/2 is not the final result teachers would expect. Interesting also to note that the Maple Calculator does not simplify powers of 2 symbolically (as it simplifies names).

Others simplify to

which for me does not represent a huge benefit.

 

Thanks again!

@acer  Its a result of a computation:

@TechnicalSupport I do have the same issue with 2021 on a 4k monitor. Not all pallets are rendered crisp. In my case units, expressions and calculus are not rendered as in previous versions. On the contrary the Greek pallet renders nicely. I hope that can be appreciated in the screenshot below.

In my case the steps of the article were not effective. The inconsistent rendering persists also in normal HD resolution but is less noticeable.

I am using Maple in a setting where I switch between monitors of different size and resolution without closing Maple (32’’/4k to 15’’/(4k in 2k mode) to 30’’). I have noticed a substantial improvement over the past years where less and less adjustments are required to find a good compromise for such a demanding use case.

This issue however is particularly disturbing because intuitively you try to refocus on something that can’t be brought into focus whereas the rest on the screen looks perfectly sharp on a 4k monitor.

@dharr 

I was expecting that the description of the parameter f would specify this (i.e. in which from the polynominal system has to be entered)  and overlooked the other indications.

Thank you

 

@MarcinM 

I am afraid, I can’t help you with tutors. I learned Maple myself. At the time, only the help system and user manuals where available. Today the Maples start page should be the entry point for starters. If you are missing something, tell it to MapleSoft. If you are not afraid of manuals, I learned allot on essential commands and Maples foundation from the programming guide (in  Maple enter help("programmingguide")).  MaplePrimes is probably the best place to ask a specific question.

The map command (as the seq command) is particularly useful if you want to apply a function on elements of a data structures (otherwise you have to use the do statement).   

@acer 

At the end it comes down to definitions what round bracket parentheses are used for in Maple. I tried my best to figure it out myself with the help of distributed bits and pieces of Maples help system. It did not work out.

The fact that () serves several purposes makes an accurate definition challenging but not impossible. I have always been impressed by the consistence and accuracy of Maples help system, but maybe () is simply too big to be addressed appropriately.

I still have the feeling that we touch matters here that will stay with Maple forever. The more I think about it, the more I am puzzled that no explicit mentioning of the syntactic purposes of () is available.

Thanks again for clarifying!

 

PS.: You are right about whattype. I should have deleted it. It is a remainder of my struggle to work it out myself.

 

 

 

Thank you, this helped allot!

I really cannot understand why such a cool feature (most computer languages do not provide) is not worth mentioning in Maples official documentation. If my interpretation is correct ()() is rather a special syntax than anything else. A few sentences and examples in the programming guide would probably be sufficient.

After my delightful (and time consuming) but finally unsuccessful consultation of Maples help system I can at least see that it is not so easy to find an appropriate place for ()(). Its neither an operator nor a function (ignoring for a moment that almost everything is a procedure in Maple). It takes actions on “things” which can be arguments, parameters, or variables (and probably more). On top of it, parentheses are widely used in math and can therefore lead to misinterpretations in a different context. Compared to this, [] and {} are rather simple to interpret. On the contrary, math without parentheses is difficult to imagine. Even more astonishing is the fact that Maples help system is silent when it comes to parentheses. Still with the help of your explanations, it all makes sense now how ()() functions. So why not: do good things and talk about it?

From an academic standpoint I am still curious where (if at all) parenthesized expressions are located in Maples list of operator precedence.   

From a practical standpoint I am wondering if there is anything that can only be done with ()() syntax.

With all these insights I have taken the opportunity to brush up my “experiments” on ()() in the attached worksheet. I hope they are helpful for others – provided that they can find them here.
 

Parentheses
From: help("ProgrammingGuide,Chapter02")

The left and right parentheses group terms in an expression, arguments in a function call, and parameters in a procedure definition.

(a+b)*c; cos(Pi);
proc( x, y, z )
  x+y+z;
end proc:

(a+b)*c

 

-1

(1)

The left and right parentheses are also used to select components from certain data structures (programmer indexing).

 

 

In the absense of a dedicated help page one could add:

 

()(): Two pairs of parentheses

A pair of left and right parentheses (the left pair) entered directly before a second pair of parentheses (the right pair) group terms (of the left pair) before acting on terms of the second pair.

The content of left pair "transforms" the content of the right pair to an output.

No whitespace is allowed between pairs. An element-wise operator "~" can be placed between the parentheses.

 

Examples:

 

map() vs. ()()

map(proc (x) options operator, arrow; x+10 end proc, [1, 2, 3])

[11, 12, 13]

(2)

`~`[proc (x) options operator, arrow; x+10 end proc]([1, 2, 3])

[11, 12, 13]

(3)

`~`[proc (x) options operator, arrow; x+10 end proc]([1, 2, 3])

[11, 12, 13]

(4)

expr := u[1, 1]*u[2, 3]+u[1, 1, 2]

u[1, 1]*u[2, 3]+u[1, 1, 2]

(5)

map(`[]`@op, indets(expr, indexed));

{[1, 1], [2, 3], [1, 1, 2]}

(6)

(`[]`@op)~(indets(expr, indexed));

{[1, 1], [2, 3], [1, 1, 2]}

(7)

`~`[`[]`@op](indets(expr, indexed));

{[1, 1], [2, 3], [1, 1, 2]}

(8)
 

White space between parentheses, nested parentheses and more than two parentheses  

((f(x))(g))(x)NULL

((f(x))(g))(x)

(9)

(f(x))(g(x))

(f(x))(g(x))

(10)

f(x)*g(x)

f(x)*g(x)

(11)
 
The grouping effect of the left pair of parentheses

`~`[`@`(`[]`, op)](indets(expr, indexed))

{[1, 1], [2, 3], [1, 1, 2]}

(12)

`@`(`[]`, `~`[op](indets(expr, indexed)))

`@`(`[]`, {1, 2, 3})

(13)

' ' instead of ()

`~`['`@`(`[]`, op)'](indets(expr, indexed))

{[1, 1], [2, 3], [1, 1, 2]}

(14)
 

Number of terms

One term

whattype(`^`)

procedure

(15)

2 terms

whattype(seq)

procedure

(16)

3 terms (2 one the lhs, 1 on the rhs)

`~`[whattype]([sin, cos, sin^2, cos^2, 1])

[procedure, procedure, `^`, `^`, integer]

(17)

a^b

a^b

(18)

(seq, seq)(i, i = 1 .. 4)

1, 2, 3, 4, 1, 2, 3, 4

(19)

(cos^2+sin^2 = 1)(x)

cos(x)^2+sin(x)^2 = 1

(20)

whattype(a^b)

`^`

(21)

whattype(1, 2, 3, 4, 1, 2, 3, 4)

exprseq

(22)

whattype(cos(x)^2+sin(x)^2 = 1)

`=`

(23)

whattype(a, b)

exprseq

(24)

whattype(i, i = 1 .. 4)

exprseq

(25)

On the rhs 2D-Math x = x was not applied. Instead 1D-Math (1)(x)=1 was executed.  

 

() vs. ()()

sin(x)

sin(x)

(26)

a^b

a^b

(27)

lhs(a = b)^2/rhs(a = b)^2

a^2/b^2

(28)

f(g(h(x)))

f(g(h(x)))

(29)

plot(sin)

 

sin(x)

sin(x)

(30)

a^b

a^b

(31)

((lhs/rhs)^2)(a = b)

a^2/b^2

(32)

(`@`(`@`(f, g), h))(x)

f(g(h(x)))

(33)

plot(sin)

 
 

 

Other related help pages

help("syntax") a parenthesized expression "

help("operators,precedence")

help("examples,functional") 

help("Definition,bracket")

help("term")

 

NULL


 

Download On_parentheses.mw

Can you provide an enlarged screen shot?

“Substitute Into”: I am not sure if I understand correctly. What I frequently do is for example: subs((2),(1)). Here I do not need to attribute a name to (1) in order to substitute something into it.

But maybe you refer to the following behavior of Maple that I overlooked: When hiding an equation label by Format>Equation Labels>Selection each instance of an equation label in a Maple input is replaced by the output the equation label is referring to. This could cause two unwanted effects: Firstly, all Maple inputs referring to equation labels to be hidden would blow up by output insertion. Secondly, this replacement process might be not reversible (although it is in the attached example on “hidden labels” in text passages; see Note 1).

With that in mind only two supposedly low hanging fruits are left from my original list:

  • In a text passage or Maple input: Double click on a label reference to open the insert label dialogue (crtl-L) in order to change the reference (instead of deleting the reference and inserting a new reference). A nice time saver because I frequently have to correct or modify input.
  • For larger documents: A search function for equation labels in a document.

Would this be feasible without changing the equation label iimplementaion too much?

In case a rethink of equation labels is something you consider it might be an opportunity to rename them to “expression labels” since they refer to much more than equations.

 

Labeling_inside_text_passages.mw

First 64 65 66 67 Page 66 of 67