Items tagged with evaluation_rules

I am experimenting with rotating a group of pionts, lines cylinders etc. the only aminations that  will display are where I put the transformations directly as the point coordinates. This is very tedious. Is there a way around this problem efficiently? Attached worksheet shows problem(s). Ultimately I will have a whole group of objects to rotate.
 

restart

with(plots)

[animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, densityplot, display, dualaxisplot, fieldplot, fieldplot3d, gradplot, gradplot3d, implicitplot, implicitplot3d, inequal, interactive, interactiveparams, intersectplot, listcontplot, listcontplot3d, listdensityplot, listplot, listplot3d, loglogplot, logplot, matrixplot, multiple, odeplot, pareto, plotcompare, pointplot, pointplot3d, polarplot, polygonplot, polygonplot3d, polyhedra_supported, polyhedraplot, rootlocus, semilogplot, setcolors, setoptions, setoptions3d, shadebetween, spacecurve, sparsematrixplot, surfdata, textplot, textplot3d, tubeplot]

(1)

with(plottools)

[annulus, arc, arrow, circle, cone, cuboid, curve, cutin, cutout, cylinder, disk, dodecahedron, ellipse, ellipticArc, exportplot, extrude, getdata, hemisphere, hexahedron, homothety, hyperbola, icosahedron, importplot, line, octahedron, parallelepiped, pieslice, point, polygon, prism, project, rectangle, reflect, rotate, scale, sector, semitorus, sphere, stellate, tetrahedron, torus, transform, translate]

(2)

``

``

``

a1 := proc (t) options operator, arrow; display(line([0, 0, 0], [10*sin(t), 0, 0], colour = red), point([10*sin(t), 0, 0], colour = green, symbolsize = 50, symbol = solidsphere), line([0, 0, 0], [0, 10*sin(t+1.6), 0], colour = orange), point([0, 10*sin(t+1.6), 0], colour = green, symbolsize = 40, symbol = solidsphere), line([0, 0, 0], [0, 0, 10*sin(t+.5)^2], colour = yellow), point([0, 0, 10*sin(t+.5)^2], colour = green, symbolsize = 30, symbol = solidsphere)) end proc

animate(a1, [t], t = 0 .. 2*Pi, frames = 100)

 

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 = 18446744074349586662), Vector[column](%id = 18446744074349586782), Vector[column](%id = 18446744074349586902), Vector[column](%id = 18446744074349587022), Vector[column](%id = 18446744074349587142), Vector[column](%id = 18446744074349587382), Vector[column](%id = 18446744074349587502), Vector[column](%id = 18446744074349587622), Vector[column](%id = 18446744074349587742)]

(3)

Rot := Matrix([[cos(w*t), -sin(w*t), 0], [sin(w*t), cos(w*t), 0], [0, 0, 1]])

Matrix(%id = 18446744074349582806)

(4)

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

Vector[column](%id = 18446744074349577870), Vector[column](%id = 18446744074349577990), Vector[column](%id = 18446744074349578110), Vector[column](%id = 18446744074349578230), Vector[column](%id = 18446744074349578350), Vector[column](%id = 18446744074349578590), Vector[column](%id = 18446744074349578710), Vector[column](%id = 18446744074349578830), Vector[column](%id = 18446744074349578950)

(5)

``

w := .25

.25

(6)

``

``

[d[1][1], d[1][2], d[1][3]]

[cos(.25*t)+.2*sin(.25*t), sin(.25*t)-.2*cos(.25*t), 0.]

(7)

ff1 := proc (t) options operator, arrow; plots:-display([plottools:-line([0, 0, 0], [d[1][1], d[1][2], d[1][3]], colour = red, thickness = 4)]) end proc

proc (t) options operator, arrow; plots:-display([plottools:-line([0, 0, 0], [d[1][1], d[1][2], d[1][3]], colour = red, thickness = 4)]) end proc

(8)

plots:-animate(ff1, [t], t = 0 .. 5, frames = 100)

 

 

Lend1 := [cos(w*t)+.2*sin(w*t), sin(w*t)-.2*cos(w*t), 0.]

[cos(.25*t)+.2*sin(.25*t), sin(.25*t)-.2*cos(.25*t), 0.]

(9)

ff2 := proc (t) options operator, arrow; plots:-display([plottools:-line([0, 0, 0], Lend1, colour = red, thickness = 4)]) end proc

proc (t) options operator, arrow; plots:-display([plottools:-line([0, 0, 0], Lend1, colour = red, thickness = 4)]) end proc

(10)

plots:-animate(ff2, [t], t = 0 .. 5, frames = 100)

 

``

ff3 := proc (t) options operator, arrow; plots:-display([plottools:-line([0, 0, 0], [cos(.35*t)+.2*sin(.35*t), sin(.35*t)+(-1)*.2*cos(.35*t), 0.], colour = red, thickness = 4)]) end proc

proc (t) options operator, arrow; plots:-display([plottools:-line([0, 0, 0], [cos(.35*t)+.2*sin(.35*t), sin(.35*t)-.2*cos(.35*t), 0.], colour = red, thickness = 4)]) end proc

(11)

plots:-animate(ff3, [t], t = 0 .. 5, frames = 100)

 

``


 

Download Anim_How-1.mw

restart

with(plots)

[animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, densityplot, display, dualaxisplot, fieldplot, fieldplot3d, gradplot, gradplot3d, implicitplot, implicitplot3d, inequal, interactive, interactiveparams, intersectplot, listcontplot, listcontplot3d, listdensityplot, listplot, listplot3d, loglogplot, logplot, matrixplot, multiple, odeplot, pareto, plotcompare, pointplot, pointplot3d, polarplot, polygonplot, polygonplot3d, polyhedra_supported, polyhedraplot, rootlocus, semilogplot, setcolors, setoptions, setoptions3d, shadebetween, spacecurve, sparsematrixplot, surfdata, textplot, textplot3d, tubeplot]

(1)

with(plottools)

[annulus, arc, arrow, circle, cone, cuboid, curve, cutin, cutout, cylinder, disk, dodecahedron, ellipse, ellipticArc, exportplot, extrude, getdata, hemisphere, hexahedron, homothety, hyperbola, icosahedron, importplot, line, octahedron, parallelepiped, pieslice, point, polygon, prism, project, rectangle, reflect, rotate, scale, sector, semitorus, sphere, stellate, tetrahedron, torus, transform, translate]

(2)

``

``

``

a1 := proc (t) options operator, arrow; display(line([0, 0, 0], [10*sin(t), 0, 0], colour = red), point([10*sin(t), 0, 0], colour = green, symbolsize = 50, symbol = solidsphere), line([0, 0, 0], [0, 10*sin(t+1.6), 0], colour = orange), point([0, 10*sin(t+1.6), 0], colour = green, symbolsize = 40, symbol = solidsphere), line([0, 0, 0], [0, 0, 10*sin(t+.5)^2], colour = yellow), point([0, 0, 10*sin(t+.5)^2], colour = green, symbolsize = 30, symbol = solidsphere)) end proc

animate(a1, [t], t = 0 .. 2*Pi, frames = 100)

 

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 = 18446744074349586662), Vector[column](%id = 18446744074349586782), Vector[column](%id = 18446744074349586902), Vector[column](%id = 18446744074349587022), Vector[column](%id = 18446744074349587142), Vector[column](%id = 18446744074349587382), Vector[column](%id = 18446744074349587502), Vector[column](%id = 18446744074349587622), Vector[column](%id = 18446744074349587742)]

(3)

Rot := Matrix([[cos(w*t), -sin(w*t), 0], [sin(w*t), cos(w*t), 0], [0, 0, 1]])

Matrix(%id = 18446744074349582806)

(4)

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

Vector[column](%id = 18446744074349577870), Vector[column](%id = 18446744074349577990), Vector[column](%id = 18446744074349578110), Vector[column](%id = 18446744074349578230), Vector[column](%id = 18446744074349578350), Vector[column](%id = 18446744074349578590), Vector[column](%id = 18446744074349578710), Vector[column](%id = 18446744074349578830), Vector[column](%id = 18446744074349578950)

(5)

``

w := .25

.25

(6)

``

``

[d[1][1], d[1][2], d[1][3]]

[cos(.25*t)+.2*sin(.25*t), sin(.25*t)-.2*cos(.25*t), 0.]

(7)

ff1 := proc (t) options operator, arrow; plots:-display([plottools:-line([0, 0, 0], [d[1][1], d[1][2], d[1][3]], colour = red, thickness = 4)]) end proc

proc (t) options operator, arrow; plots:-display([plottools:-line([0, 0, 0], [d[1][1], d[1][2], d[1][3]], colour = red, thickness = 4)]) end proc

(8)

plots:-animate(ff1, [t], t = 0 .. 5, frames = 100)

 

 

Lend1 := [cos(w*t)+.2*sin(w*t), sin(w*t)-.2*cos(w*t), 0.]

[cos(.25*t)+.2*sin(.25*t), sin(.25*t)-.2*cos(.25*t), 0.]

(9)

ff2 := proc (t) options operator, arrow; plots:-display([plottools:-line([0, 0, 0], Lend1, colour = red, thickness = 4)]) end proc

proc (t) options operator, arrow; plots:-display([plottools:-line([0, 0, 0], Lend1, colour = red, thickness = 4)]) end proc

(10)

plots:-animate(ff2, [t], t = 0 .. 5, frames = 100)

 

``

ff3 := proc (t) options operator, arrow; plots:-display([plottools:-line([0, 0, 0], [cos(.35*t)+.2*sin(.35*t), sin(.35*t)+(-1)*.2*cos(.35*t), 0.], colour = red, thickness = 4)]) end proc

proc (t) options operator, arrow; plots:-display([plottools:-line([0, 0, 0], [cos(.35*t)+.2*sin(.35*t), sin(.35*t)-.2*cos(.35*t), 0.], colour = red, thickness = 4)]) end proc

(11)

plots:-animate(ff3, [t], t = 0 .. 5, frames = 100)

 

``


 

Download Anim_How-1.mw

Hi everybody, 

I generate random variables of the form X__E__n, n=1..N where N is assigned to some integer value (the double index is not a crucial point for the issue already appears with a single level of index).
Next I want to express a likelihood based upon these random variables in two different ways : a very symbolic one which uses the function "Product" an a second one that uses "product".

My problem is that I can't obtain the desired expressions.
As "Product" returns me a completely satisfactory expression, "product" (as I use it) refuses to return me the desired expression.

Without doubt this is due to a poor knowledge of the detailed way Maple proceeds to evaluate indices in seq, sum or product.
All explanation will be largely appreciated.

Thanks in advance

 

Download WhatHappensHere.mw




In the following code, why is B returned unevaluated?

restart:
A:= a:  B:= 2:
F:= _a-> eval(`if`(A,B,C), a= _a):
F(true);
                               B
eval(B);
                   ...

Can anyone explain why I get a different answer if I use int instead of Int in the following evaluation:

> evalf(subs(r = 1, Int(Int(Dirac(x1+x2-r)*q, x1 = 0 .. 1), x2 = 0 .. 1)));
1.676209155
> evalf(subs(r = 1, int(int(Dirac(x1+x2-r)*q, x1 = 0 .. 1), x2 = 0 .. 1)));
0.

Can anyone explain to me why the argument of the innerproc, which as y is a local of the outerproc, gets evaluated more than one level?

innerproc := proc(t)
print(t[1]); # or dismantle, or lprint
end proc:

outerproc := proc(x)
local y;
y := x;
print(y[1]); # or dismantle, or lprint
innerproc(y);
end proc:

outerproc(vector(1,['exp(0)']));


acer

Page 1 of 1