GunnerMunk

35 Reputation

5 Badges

13 years, 299 days

MaplePrimes Activity


These are replies submitted by GunnerMunk

Thank you (all) very very much.

I will try it tomorrow on real-world examples.

It looks fantastic, just what I need.

Thank you (all) very much!

Using the output from A:=.... (without :) gives me the expression for A (expression (1)). I can insert it after the " A = "

Modyfying your suggestion gives med almost what I need (see file).

However, I would like til 'hide the machine' in one proc(), avoiding the use-in-end and use of labels from outputs:

A := ......

a := 2 [[m]]

b := 3[[m]]

c := ...

magicFunc(A)

Output from magicFunc(A):

A = 'the expression for A' = 'the expression for A, with values and units inserted' = 'the result'

Sample_reply_reply.mw

I guess you all can see what I am looking for.

I have an expression. It could be an expression with just two variables

A = a * b

or with three variables

A = sqrt(1+a^2+b^1+c^2)

or with 95 variables.

After the definition af the expression: A = ..... , I assign values to the variables, with units [[ ]]

a := 2 [[m]]

b := 2 [[N]]

c := 7 [[J/s]]

Then I 'just' want to automatically output the following

A = 'the expression for A' = 'the expression for A, with values and units inserted' = 'the result'

I see a lot of good ideas; thank you all so very much.

The answer I found was (see Maple document). It works with any(?) expression. One problem is, that I have to enter the expression directly inside the use-in-end expression. If I insert the name of the expression, Maple will evaluate it, before looking at it in the use-in-end expression. But maybe I can use some of your very good ideas?

Sample.mw

Thank you for a quick responce.

I had no idear that the order of assignmentes is important!

I can understand that, if I define A as 'a' times 'b', and THEN assigning 'a' to a new value, then the value of A is updated.

That makes sense.

However, i Maple 2020, and 2019, 2008, ... I have not observed that the order were important? Therefore the confusion. It should be 100% clear what is happining, I have to tell the students that if they write ... then it works, and if it dosn't work, explain why.

@acer 

Her is another example:

First I define a as sin(10).
Then I define A as 3 times a.
Then I type 'A', then option+Enter (mac). Answer is correct 3*sin(10).

I then redefine a as sin(20).
I type 'A', then option+Enter. Answer incorrekt, still 3*sin(10).
Last I check the value of a: Is is sin(20).

Even using 'option+Enter' on result dosn't work, even using ! or !!! dosn't work.

Same situation using worksheet. Something have changes, something is not working.

Updateproblem.mw

Thank you for a response.

Yes, the document is nothing more than the four lines, just to show the problem.

I am teaching in math, and the problem is that now I have to tell the students that sometimes a line with math is executeted when pressing Enter on that line, sometimes nothing happens, sometime there is no response when pressing Enter. Can you see the frustration with 30 students in a class, learning math and learning to use Maple?

Everything worked fine in Maple 2020 !!!

If there isn't a workaround (not using the ! or the !!!), then is is a obvious error.

 

Page 1 of 1