Ronan

95 Reputation

6 Badges

5 years, 13 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are replies submitted by Ronan

A workable fix is to RMB on the Maple file at the top of  the workbook pallet and select Rename, copy paste in the current file name, Then it displays correctly. Reason this file is the original name of the file when it was first saved as a workbook document. I would class this as bug.

 

@Preben Alsholm Thank you. That basicially sorted it. Many "signum" appeared. Used simplify(expr,assume=real) and that polished off the answer.

@Samir Khan Maple pushes strongly into the education sectior. Students basically understand scientific notation. It is neat and tidy. It would be good to have a command like Digits to create this output. e.g. ScientificNotation(5) so 123456789101112131415.01245689 is displayed as

1.2345x10^20 formated to to read nicely. Assuming I  have counted out the number of digits correctly)

Could also make it a bit more functional having an optional 2 digit ScientificNotation(5,3) so could be displayed as 123.45x10^18

Could lead to an interesting situation on integer/rational arithmetic. My take would be a 3rd option ScientificNotation(5,3,y) . So for 123456789 =123x10^6  and ScientificNotation(5,3,n) =123456789 (rationals unchanged) probable the default here should be no. ScientificNotation(5,y) ?? would be nice if possible too. This aspect would be really useful, say when producing a Groebner basis. 1000s of digit long numbers thats are necessary for the maths but you are not going to read them. Probably heresy to the mathmeticians!

Copy/paste would be on the real number not just what is displayed.

I'm sure I am not the first to ask for this. Understand that there could be core difficulties but feel it is really a display formatting issue.

 

 

@acer  Well it works and is far less torturous than my fisrt approach of having to animate each component of the body seperately.

How would I put in for a software enhacment to improve the situation?

 

@acer Thank you for you helpful insights. I have used your

f:=T->unapply(convert(eval(Q,t=T).Vector(3,[x,y,z]) , list ),  [x,y,z])

There definately room for improvement to transform command to make more like the rotate command.

I created Body2. It is in my worksheet posted at the start.' vv' was just saying that my rotate command as posted worked. I am using it to animate a body tumbling as it rotates about it's mid axis of inertia called the Dzhanibekov effect. A link to the blog on this is posted in a reply to Rouben Rostamain above. Even though it tumbles it's rotational momentum remains constant.

 

 

@Rouben Rostamian   I am following a blog on the Dzhanibekov effect. It starts here http://arkadiusz-jadczyk.eu/blog/2017/01/04/   . He is now getting into using quaternions.

@Kitonum That debugged it. I think the whole thing is a work around though. Not a criticism of you. I guess transfom has to look at a huge array of points that have been stored somewhere and operate on them all. Rotate only needed to inprinciple operate on about a dozen points in the body and the internal routines of arrow, point, line etc fill in the rest. There is definatels scopt for an improved rotate command to take matrices. I know matrices can also transform shape.

@Rouben Rostamian   Well Quaternions definately solve the problem of dismantling an Euler rotation matrix. See it is easy to convert the quaternion to get axis and angle. Have a little bit of familaity with them. Don't fully understand all the details of your worksheet but get the concept.  Nearly fell of my seat when I saw you reply this evening. I am using Eulers euqations of motion applied to a rigid body rotating about it's mid axis of inertia. It tumbles. Will update you soon.

Write that book. You have valuable knowledge.

 

@Scot Gould So do you use worksheet or document mode with 1D math input? I like an example if that is ok.

@Rouben Rostamian  I look forward to your corrected worksheet. What the problem with the one you posted. It pasted my body into it and it ran.

 

@vv Hi. Yes rotate works. The original question was that I have the rotation matrix not the original w1 w2 w3. I just threw in the Euler rotation matrix here as it is easy to produce for this example.

In my reply to you above I tried applying the transform command to the matrix (Rot). That I couldn't get to work. I dont think I did that correctly. I basicially used 

f:=t->plottools:-transform((x,y,z)->convert(Rot.Vector(3,[x,y,z]), list)): 

f2 := plots:-animate(plots:-display, [('f(t)')(Body2)], t = 0 .. 8*Pi, frames = 100, scaling = constrained)

This either produces an empty animation (10 frames)   or output exceeds 10000000   (100 frames) I tried unevaluation quotes around plots:-display.


 

@Kitonum  Tried this.

Either it gives empty plot or for 100 frames `[Length of output exceeds limit of 10000000]`. Tried the usual combinations of delay evaluation quotes. No luck.

f := proc (t) options operator, arrow; transform(proc (x, y, z) options operator, arrow; convert(Rot . Vector(3, [x, y, z]), list) end proc) end proc

f2 := plots:-animate(plots:-display, [('f(t)')(Body2)], t = 0 .. 8*Pi, frames = 100, scaling = constrained)

@Scot Gould  Thanks for the useful info. Yes I know a lot of pros. use the worksheet format. I home thought so started off on the pretty interface.

@vv That make it simple. I confused rotate with the Rotate command in Image tools. It uses lefthand rule. Odd but not a shot stopper.

@acer  Firstly I replyed to this hours ago but it never appeared here. You have masterful insight/experience with Maple. I tested your solutions under the following condition. I replaced, e.g sin(0.25 t) with sin(w t), then defined w later after the display/animate commands. The 'point' produces an error still, 'line' works fine. Worksheet posted, I made before I saw your posts.

      I have included the OriginalBody. I wanted to rotate this without having to define the functions inside the plot/display/animate commands. What I have done works but I certainly don't like the level of workaround required.

restart

with(plots):

with(plottools):

NULL
OriginalBody := display([point([1, -.2, 0], colour = red, symbolsize = 50, symbol = solidsphere), point([-1, -.2, 0], colour = red, symbolsize = 50, symbol = solidsphere), point([0, 1, 0], colour = purple, symbolsize = 50, symbol = solidsphere), line([0, 0, 0], [1, -.2, 0]), line([0, 0, 0], [-1, -.2, 0]), line([0, 0, 0], [0, 1, 0]), line([0, 0, 0], [.5, 0, 0], colour = red, thickness = 4), line([0, 0, 0], [0, .5, 0], colour = yellow, thickness = 4), line([0, 0, 0], [0, 0, .5], colour = blue, thickness = 4)], scaling = constrained)

 

``

``

c1 := Vector(3, [1, -.2, 0]):

c2 := Vector(3, [-1, -.2, 0]):

c3 := Vector(3, [0, 1, 0]):

c4 := Vector(3, [1, -.2, 0]):

c5 := Vector(3, [-1, -.2, 0]):

c6 := Vector(3, [0, 1, 0]):

c7 := Vector(3, [.5, 0, 0]):

c8 := Vector(3, [0, .5, 0]):

c9 := Vector(3, [0, 0, .5]):

c := [seq(c || n, n = 1 .. 9)]

[Vector[column](%id = 18446744074369140486), Vector[column](%id = 18446744074369140606), Vector[column](%id = 18446744074369140726), Vector[column](%id = 18446744074369140846), Vector[column](%id = 18446744074369140966), Vector[column](%id = 18446744074369141086), Vector[column](%id = 18446744074369141206), Vector[column](%id = 18446744074369141326), Vector[column](%id = 18446744074369141446)]

(1)

Rot1 := Matrix(3, 3, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = cos(w1*t), (2, 3) = -sin(w1*t), (3, 1) = 0, (3, 2) = sin(w1*t), (3, 3) = cos(w1*t)})

Rot2 := Matrix(3, 3, {(1, 1) = cos(w2*t), (1, 2) = 0, (1, 3) = sin(w2*t), (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (3, 1) = -sin(w2*t), (3, 2) = 0, (3, 3) = cos(w2*t)})

Rot3 := Matrix(3, 3, {(1, 1) = cos(w3*t), (1, 2) = -sin(w3*t), (1, 3) = 0, (2, 1) = sin(w3*t), (2, 2) = cos(w3*t), (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1})

Rot := Rot1.Rot2.Rot3

Matrix(%id = 18446744074369136510)

(2)

d := seq(Rot.c[n], n = 1 .. 9)

Vector[column](%id = 18446744074369118686), Vector[column](%id = 18446744074369118806), Vector[column](%id = 18446744074369118926), Vector[column](%id = 18446744074369119046), Vector[column](%id = 18446744074369119166), Vector[column](%id = 18446744074369119286), Vector[column](%id = 18446744074369119406), Vector[column](%id = 18446744074369119526), Vector[column](%id = 18446744074369119646)

(3)

Bdyprt1 := unapply(display(POINTS([d[1][1], d[1][2], d[1][3]]), colour = red, symbolsize = 50, symbol = solidsphere), t); Bdyprt1a := plots:-animate(Bdyprt1, [t], t = 0 .. 8*Pi, frames = 100)

Bdyprt2 := unapply(display(POINTS([d[2][1], d[2][2], d[2][3]]), colour = red, symbolsize = 50, symbol = solidsphere), t); Bdyprt2a := plots:-animate(Bdyprt2, [t], t = 0 .. 8*Pi, frames = 100)

Bdyprt3 := unapply(plots:-display(POINTS([d[3][1], d[3][2], d[3][3]]), colour = purple, symbolsize = 50, symbol = solidsphere), t):
NULL
Bdyprt3a := plots:-animate(Bdyprt3, [t], t = 0 .. 8*Pi, frames = 100)

Bdyprt4 := unapply(display(line([0, 0, 0], [d[4][1], d[4][2], d[4][3]])), t); Bdyprt4a := plots:-animate(Bdyprt4, [t], t = 0 .. 8*Pi, frames = 100)

Bdyprt5 := unapply(display(line([0, 0, 0], [d[5][1], d[5][2], d[5][3]])), t); Bdyprt5a := plots:-animate(Bdyprt5, [t], t = 0 .. 8*Pi, frames = 100)

Bdyprt6 := unapply(display(line([0, 0, 0], [d[6][1], d[6][2], d[6][3]])), t); Bdyprt6a := plots:-animate(Bdyprt6, [t], t = 0 .. 8*Pi, frames = 100)

Bdyprt7 := unapply(display(line([0, 0, 0], [d[7][1], d[7][2], d[7][3]], colour = red, thickness = 4)), t); Bdyprt7a := plots:-animate(Bdyprt7, [t], t = 0 .. 8*Pi, frames = 100)

Bdyprt8 := unapply(display(line([0, 0, 0], [d[8][1], d[8][2], d[8][3]], colour = yellow, thickness = 4)), t); Bdyprt8a := plots:-animate(Bdyprt8, [t], t = 0 .. 8*Pi, frames = 100)

Bdyprt9 := unapply(plots:-display(plottools:-line([0, 0, 0], [d[9][1], d[9][2], d[9][3]], colour = blue, thickness = 4)), t):

NULL

NULL

w1 := .35; 1; w2 := .45; 1; w3 := .15

.15

(4)

NULL

``

NULL

``

NULL

plots:-display(Bdyprt1a, Bdyprt2a, Bdyprt3a, Bdyprt4a, Bdyprt5a, Bdyprt6a, Bdyprt7a, Bdyprt8a, Bdyprt9a, scaling = constrained)

 

NULL


 

Download Anim_How-2.mw


 

restart

with(plots):

with(plottools):

NULL
OriginalBody := display([point([1, -.2, 0], colour = red, symbolsize = 50, symbol = solidsphere), point([-1, -.2, 0], colour = red, symbolsize = 50, symbol = solidsphere), point([0, 1, 0], colour = purple, symbolsize = 50, symbol = solidsphere), line([0, 0, 0], [1, -.2, 0]), line([0, 0, 0], [-1, -.2, 0]), line([0, 0, 0], [0, 1, 0]), line([0, 0, 0], [.5, 0, 0], colour = red, thickness = 4), line([0, 0, 0], [0, .5, 0], colour = yellow, thickness = 4), line([0, 0, 0], [0, 0, .5], colour = blue, thickness = 4)], scaling = constrained)

 

``

``

c1 := Vector(3, [1, -.2, 0]):

c2 := Vector(3, [-1, -.2, 0]):

c3 := Vector(3, [0, 1, 0]):

c4 := Vector(3, [1, -.2, 0]):

c5 := Vector(3, [-1, -.2, 0]):

c6 := Vector(3, [0, 1, 0]):

c7 := Vector(3, [.5, 0, 0]):

c8 := Vector(3, [0, .5, 0]):

c9 := Vector(3, [0, 0, .5]):

c := [seq(c || n, n = 1 .. 9)]

[Vector[column](%id = 18446744074369140486), Vector[column](%id = 18446744074369140606), Vector[column](%id = 18446744074369140726), Vector[column](%id = 18446744074369140846), Vector[column](%id = 18446744074369140966), Vector[column](%id = 18446744074369141086), Vector[column](%id = 18446744074369141206), Vector[column](%id = 18446744074369141326), Vector[column](%id = 18446744074369141446)]

(1)

Rot1 := Matrix(3, 3, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = cos(w1*t), (2, 3) = -sin(w1*t), (3, 1) = 0, (3, 2) = sin(w1*t), (3, 3) = cos(w1*t)})

Rot2 := Matrix(3, 3, {(1, 1) = cos(w2*t), (1, 2) = 0, (1, 3) = sin(w2*t), (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (3, 1) = -sin(w2*t), (3, 2) = 0, (3, 3) = cos(w2*t)})

Rot3 := Matrix(3, 3, {(1, 1) = cos(w3*t), (1, 2) = -sin(w3*t), (1, 3) = 0, (2, 1) = sin(w3*t), (2, 2) = cos(w3*t), (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1})

Rot := Rot1.Rot2.Rot3

Matrix(%id = 18446744074369136510)

(2)

d := seq(Rot.c[n], n = 1 .. 9)

Vector[column](%id = 18446744074369118686), Vector[column](%id = 18446744074369118806), Vector[column](%id = 18446744074369118926), Vector[column](%id = 18446744074369119046), Vector[column](%id = 18446744074369119166), Vector[column](%id = 18446744074369119286), Vector[column](%id = 18446744074369119406), Vector[column](%id = 18446744074369119526), Vector[column](%id = 18446744074369119646)

(3)

Bdyprt1 := unapply(display(POINTS([d[1][1], d[1][2], d[1][3]]), colour = red, symbolsize = 50, symbol = solidsphere), t); Bdyprt1a := plots:-animate(Bdyprt1, [t], t = 0 .. 8*Pi, frames = 100)

Bdyprt2 := unapply(display(POINTS([d[2][1], d[2][2], d[2][3]]), colour = red, symbolsize = 50, symbol = solidsphere), t); Bdyprt2a := plots:-animate(Bdyprt2, [t], t = 0 .. 8*Pi, frames = 100)

Bdyprt3 := unapply(plots:-display(POINTS([d[3][1], d[3][2], d[3][3]]), colour = purple, symbolsize = 50, symbol = solidsphere), t):
NULL
Bdyprt3a := plots:-animate(Bdyprt3, [t], t = 0 .. 8*Pi, frames = 100)

Bdyprt4 := unapply(display(line([0, 0, 0], [d[4][1], d[4][2], d[4][3]])), t); Bdyprt4a := plots:-animate(Bdyprt4, [t], t = 0 .. 8*Pi, frames = 100)

Bdyprt5 := unapply(display(line([0, 0, 0], [d[5][1], d[5][2], d[5][3]])), t); Bdyprt5a := plots:-animate(Bdyprt5, [t], t = 0 .. 8*Pi, frames = 100)

Bdyprt6 := unapply(display(line([0, 0, 0], [d[6][1], d[6][2], d[6][3]])), t); Bdyprt6a := plots:-animate(Bdyprt6, [t], t = 0 .. 8*Pi, frames = 100)

Bdyprt7 := unapply(display(line([0, 0, 0], [d[7][1], d[7][2], d[7][3]], colour = red, thickness = 4)), t); Bdyprt7a := plots:-animate(Bdyprt7, [t], t = 0 .. 8*Pi, frames = 100)

Bdyprt8 := unapply(display(line([0, 0, 0], [d[8][1], d[8][2], d[8][3]], colour = yellow, thickness = 4)), t); Bdyprt8a := plots:-animate(Bdyprt8, [t], t = 0 .. 8*Pi, frames = 100)

Bdyprt9 := unapply(plots:-display(plottools:-line([0, 0, 0], [d[9][1], d[9][2], d[9][3]], colour = blue, thickness = 4)), t):

NULL

NULL

w1 := .35; 1; w2 := .45; 1; w3 := .15

.15

(4)

NULL

``

NULL

``

NULL

plots:-display(Bdyprt1a, Bdyprt2a, Bdyprt3a, Bdyprt4a, Bdyprt5a, Bdyprt6a, Bdyprt7a, Bdyprt8a, Bdyprt9a, scaling = constrained)

 

NULL


 

Download Anim_How-2.mw

1 2 3 4 5 6 Page 1 of 6