Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

In the calculation below, A and B both simplify to 1.  Why doesn't A*B simplify to 1?  Tested on Maple 2017 and 2018.

restart;

A := (1 - cos(s)^2)/sin(s)^2;

(1-cos(s)^2)/sin(s)^2

B := (1 - cos(t)^2)/sin(t)^2;

(1-cos(t)^2)/sin(t)^2

simplify(A);
simplify(B);

1

1

Why doesn't this simplify to 1?

simplify(A*B);

((cos(t)^2-1)*cos(s)^2-cos(t)^2+1)/(sin(s)^2*sin(t)^2)

Can someone please explain in simple terms, why when I do

 r:=foo(r), where "r" is a Record, then the returned  "r" is not what is returned from foo()?  I want to write a proc foo() which takes in a Record variable, update some of its fields, and then return the updated Record to the caller

r:=Record('a','b');
foo:=proc(r)
    r:-b:=5;
    return(r);
end proc;

But now when I call the above as follows

r:-b:=99;
print(r);
r:=foo(r):
print(r);

The last print above just prints "r" and not the Record. It seems to have erased the Record.

 

But it works, if I change the name of the variable to return the result into, as 

r:-b:=99;
print(r);
r0:=foo(r):
print(r0);

When I do the same on say a Matrix, there is no problem

restart;
r:=<<1,1>>:
foo:=proc(r)
    r[1]:=5;
    return(r);
end proc;

And now

r;
r:=foo(r):
print(r);

 

Why it worked with a Matrix but not with Record? Why can't one overwrite the Record on the call return?

What would be the correct way to pass in a Record to a function, and have the function update some of its fields, and then return back the updated copy of the Record without having to make a new variable "r0" as above?

Ball_Maple.mwsBall_Maple.txt

Attached is code in Maple 7 and a text file.There is a for loop in which I want the plots to be output, and the printf command - but I am not getting a plot at all.  Any advice most appreciated.  David

I really like Maple Record. I think it is one of the hidden gems in Maple. Very useful.

But I have basic questions on it. I just started to learn how to use it. It is very similar to Pascal Record.

1)

r:=Record(a,b);
                       r := Record(a, b)
type(r,'record');
                              true
whattype(r);
                             symbol

Why  type(r,'record') says true, but whattype(r) says symbol?

2)
Why Maple displays the record content to the screen automatically only first time, after it is created, but second time, it only echos the name? So one has to use print() each time to display the content of the record.  Not a big deal, but it is little annoying

r:=Record(a,b);
                       r := Record(a, b)
r;
                               r

print(r);
                          Record(a, b)

r:-a:=5;
                             a := 5
r
                               r

print(r);
                        Record(a = 5, b)

 

Compare this to say a set type, where it displays the content each time

r:={1,2,3};
                         r := {1, 2, 3}
r
                           {1, 2, 3}

I tried changing max_record_depth but I must be doing something wrong. It still does not display the content

interface(max_record_depth=10)
                               10
r:=Record(a,b);
                       r := Record(a, b)
r;
                               r

3) Why are these two behave the same way

r:=Record("y");
r:-y:=4;

r:=Record('y');
r:-y:=4;

Giving the name of the field as string worked the same way as second example which is a name.  I thought the first one above will not work as field name should be a name according to help.

Hello,

I'm currently wondering about the "real" difference.

is() or type() can be used both for true/false checks. However when should what be used preferably?

For example I do not see what is better over the other when doing simple checks such as

is(2,'integer')

type(2,'integer')

 

Thanks for clarifying.


I can't workout the syntax to plot a sequence of arrow. See last line of document.

accel := plottools:-arrow(seq([M[j, 1][1], M[j, 1][2]], [M[j, 3][1], M[j, 3][2]], j = 1 .. i), colour = red)  Doesn't work and tried various things.

Would also appreciate an explination for how the lines are plotted. I found this line on Maple Primes. It works but I don't realy understant it.

orb := plot(([seq])([M[j, 1][1], M[j, 1][2]], j = 1 .. i), colour = blue)

Why is seq in square brackets?

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)

M := Matrix(60, 3, {(1, 1) = Vector(2, {(1) = -3, (2) = 5}), (1, 2) = Vector(2, {(1) = -2, (2) = -2}), (1, 3) = Vector(2, {(1) = 0, (2) = 0}), (2, 1) = Vector(2, {(1) = -5, (2) = 3}), (2, 2) = Vector(2, {(1) = -1, (2) = -3}), (2, 3) = Vector(2, {(1) = 1, (2) = -1}), (3, 1) = Vector(2, {(1) = -6, (2) = 0}), (3, 2) = Vector(2, {(1) = 0, (2) = -3}), (3, 3) = Vector(2, {(1) = 1, (2) = 0}), (4, 1) = Vector(2, {(1) = -6, (2) = -3}), (4, 2) = Vector(2, {(1) = 1, (2) = -2}), (4, 3) = Vector(2, {(1) = 1, (2) = 1}), (5, 1) = Vector(2, {(1) = -5, (2) = -5}), (5, 2) = Vector(2, {(1) = 2, (2) = -1}), (5, 3) = Vector(2, {(1) = 1, (2) = 1}), (6, 1) = Vector(2, {(1) = -3, (2) = -6}), (6, 2) = Vector(2, {(1) = 3, (2) = 0}), (6, 3) = Vector(2, {(1) = 1, (2) = 1}), (7, 1) = Vector(2, {(1) = 0, (2) = -6}), (7, 2) = Vector(2, {(1) = 3, (2) = 1}), (7, 3) = Vector(2, {(1) = 0, (2) = 1}), (8, 1) = Vector(2, {(1) = 3, (2) = -5}), (8, 2) = Vector(2, {(1) = 2, (2) = 2}), (8, 3) = Vector(2, {(1) = -1, (2) = 1}), (9, 1) = Vector(2, {(1) = 5, (2) = -3}), (9, 2) = Vector(2, {(1) = 1, (2) = 3}), (9, 3) = Vector(2, {(1) = -1, (2) = 1}), (10, 1) = Vector(2, {(1) = 6, (2) = 0}), (10, 2) = Vector(2, {(1) = 0, (2) = 3}), (10, 3) = Vector(2, {(1) = -1, (2) = 0}), (11, 1) = Vector(2, {(1) = 6, (2) = 3}), (11, 2) = Vector(2, {(1) = -1, (2) = 2}), (11, 3) = Vector(2, {(1) = -1, (2) = -1}), (12, 1) = Vector(2, {(1) = 5, (2) = 5}), (12, 2) = Vector(2, {(1) = -2, (2) = 1}), (12, 3) = Vector(2, {(1) = -1, (2) = -1}), (13, 1) = Vector(2, {(1) = 3, (2) = 6}), (13, 2) = Vector(2, {(1) = -3, (2) = 0}), (13, 3) = Vector(2, {(1) = -1, (2) = -1}), (14, 1) = Vector(2, {(1) = 0, (2) = 6}), (14, 2) = Vector(2, {(1) = -3, (2) = -1}), (14, 3) = Vector(2, {(1) = 0, (2) = -1}), (15, 1) = Vector(2, {(1) = -3, (2) = 5}), (15, 2) = Vector(2, {(1) = -2, (2) = -2}), (15, 3) = Vector(2, {(1) = 1, (2) = -1}), (16, 1) = Vector(2, {(1) = -5, (2) = 3}), (16, 2) = Vector(2, {(1) = -1, (2) = -3}), (16, 3) = Vector(2, {(1) = 1, (2) = -1}), (17, 1) = Vector(2, {(1) = -6, (2) = 0}), (17, 2) = Vector(2, {(1) = 0, (2) = -3}), (17, 3) = Vector(2, {(1) = 1, (2) = 0}), (18, 1) = Vector(2, {(1) = -6, (2) = -3}), (18, 2) = Vector(2, {(1) = 1, (2) = -2}), (18, 3) = Vector(2, {(1) = 1, (2) = 1}), (19, 1) = Vector(2, {(1) = -5, (2) = -5}), (19, 2) = Vector(2, {(1) = 2, (2) = -1}), (19, 3) = Vector(2, {(1) = 1, (2) = 1}), (20, 1) = Vector(2, {(1) = -3, (2) = -6}), (20, 2) = Vector(2, {(1) = 3, (2) = 0}), (20, 3) = Vector(2, {(1) = 1, (2) = 1}), (21, 1) = Vector(2, {(1) = 0, (2) = -6}), (21, 2) = Vector(2, {(1) = 3, (2) = 1}), (21, 3) = Vector(2, {(1) = 0, (2) = 1}), (22, 1) = Vector(2, {(1) = 3, (2) = -5}), (22, 2) = Vector(2, {(1) = 2, (2) = 2}), (22, 3) = Vector(2, {(1) = -1, (2) = 1}), (23, 1) = Vector(2, {(1) = 5, (2) = -3}), (23, 2) = Vector(2, {(1) = 1, (2) = 3}), (23, 3) = Vector(2, {(1) = -1, (2) = 1}), (24, 1) = Vector(2, {(1) = 6, (2) = 0}), (24, 2) = Vector(2, {(1) = 0, (2) = 3}), (24, 3) = Vector(2, {(1) = -1, (2) = 0}), (25, 1) = Vector(2, {(1) = 6, (2) = 3}), (25, 2) = Vector(2, {(1) = -1, (2) = 2}), (25, 3) = Vector(2, {(1) = -1, (2) = -1}), (26, 1) = Vector(2, {(1) = 5, (2) = 5}), (26, 2) = Vector(2, {(1) = -2, (2) = 1}), (26, 3) = Vector(2, {(1) = -1, (2) = -1}), (27, 1) = Vector(2, {(1) = 3, (2) = 6}), (27, 2) = Vector(2, {(1) = -3, (2) = 0}), (27, 3) = Vector(2, {(1) = -1, (2) = -1}), (28, 1) = Vector(2, {(1) = 0, (2) = 6}), (28, 2) = Vector(2, {(1) = -3, (2) = -1}), (28, 3) = Vector(2, {(1) = 0, (2) = -1}), (29, 1) = Vector(2, {(1) = -3, (2) = 5}), (29, 2) = Vector(2, {(1) = -2, (2) = -2}), (29, 3) = Vector(2, {(1) = 1, (2) = -1}), (30, 1) = Vector(2, {(1) = -5, (2) = 3}), (30, 2) = Vector(2, {(1) = -1, (2) = -3}), (30, 3) = Vector(2, {(1) = 1, (2) = -1}), (31, 1) = Vector(2, {(1) = -6, (2) = 0}), (31, 2) = Vector(2, {(1) = 0, (2) = -3}), (31, 3) = Vector(2, {(1) = 1, (2) = 0}), (32, 1) = Vector(2, {(1) = -6, (2) = -3}), (32, 2) = Vector(2, {(1) = 1, (2) = -2}), (32, 3) = Vector(2, {(1) = 1, (2) = 1}), (33, 1) = Vector(2, {(1) = -5, (2) = -5}), (33, 2) = Vector(2, {(1) = 2, (2) = -1}), (33, 3) = Vector(2, {(1) = 1, (2) = 1}), (34, 1) = Vector(2, {(1) = -3, (2) = -6}), (34, 2) = Vector(2, {(1) = 3, (2) = 0}), (34, 3) = Vector(2, {(1) = 1, (2) = 1}), (35, 1) = Vector(2, {(1) = 0, (2) = -6}), (35, 2) = Vector(2, {(1) = 3, (2) = 1}), (35, 3) = Vector(2, {(1) = 0, (2) = 1}), (36, 1) = Vector(2, {(1) = 3, (2) = -5}), (36, 2) = Vector(2, {(1) = 2, (2) = 2}), (36, 3) = Vector(2, {(1) = -1, (2) = 1}), (37, 1) = Vector(2, {(1) = 5, (2) = -3}), (37, 2) = Vector(2, {(1) = 1, (2) = 3}), (37, 3) = Vector(2, {(1) = -1, (2) = 1}), (38, 1) = Vector(2, {(1) = 6, (2) = 0}), (38, 2) = Vector(2, {(1) = 0, (2) = 3}), (38, 3) = Vector(2, {(1) = -1, (2) = 0}), (39, 1) = Vector(2, {(1) = 6, (2) = 3}), (39, 2) = Vector(2, {(1) = -1, (2) = 2}), (39, 3) = Vector(2, {(1) = -1, (2) = -1}), (40, 1) = Vector(2, {(1) = 5, (2) = 5}), (40, 2) = Vector(2, {(1) = -2, (2) = 1}), (40, 3) = Vector(2, {(1) = -1, (2) = -1}), (41, 1) = Vector(2, {(1) = 3, (2) = 6}), (41, 2) = Vector(2, {(1) = -3, (2) = 0}), (41, 3) = Vector(2, {(1) = -1, (2) = -1}), (42, 1) = Vector(2, {(1) = 0, (2) = 6}), (42, 2) = Vector(2, {(1) = -3, (2) = -1}), (42, 3) = Vector(2, {(1) = 0, (2) = -1}), (43, 1) = Vector(2, {(1) = -3, (2) = 5}), (43, 2) = Vector(2, {(1) = -2, (2) = -2}), (43, 3) = Vector(2, {(1) = 1, (2) = -1}), (44, 1) = Vector(2, {(1) = -5, (2) = 3}), (44, 2) = Vector(2, {(1) = -1, (2) = -3}), (44, 3) = Vector(2, {(1) = 1, (2) = -1}), (45, 1) = Vector(2, {(1) = -6, (2) = 0}), (45, 2) = Vector(2, {(1) = 0, (2) = -3}), (45, 3) = Vector(2, {(1) = 1, (2) = 0}), (46, 1) = Vector(2, {(1) = -6, (2) = -3}), (46, 2) = Vector(2, {(1) = 1, (2) = -2}), (46, 3) = Vector(2, {(1) = 1, (2) = 1}), (47, 1) = Vector(2, {(1) = -5, (2) = -5}), (47, 2) = Vector(2, {(1) = 2, (2) = -1}), (47, 3) = Vector(2, {(1) = 1, (2) = 1}), (48, 1) = Vector(2, {(1) = -3, (2) = -6}), (48, 2) = Vector(2, {(1) = 3, (2) = 0}), (48, 3) = Vector(2, {(1) = 1, (2) = 1}), (49, 1) = Vector(2, {(1) = 0, (2) = -6}), (49, 2) = Vector(2, {(1) = 3, (2) = 1}), (49, 3) = Vector(2, {(1) = 0, (2) = 1}), (50, 1) = Vector(2, {(1) = 3, (2) = -5}), (50, 2) = Vector(2, {(1) = 2, (2) = 2}), (50, 3) = Vector(2, {(1) = -1, (2) = 1}), (51, 1) = Vector(2, {(1) = 5, (2) = -3}), (51, 2) = Vector(2, {(1) = 1, (2) = 3}), (51, 3) = Vector(2, {(1) = -1, (2) = 1}), (52, 1) = Vector(2, {(1) = 6, (2) = 0}), (52, 2) = Vector(2, {(1) = 0, (2) = 3}), (52, 3) = Vector(2, {(1) = -1, (2) = 0}), (53, 1) = Vector(2, {(1) = 6, (2) = 3}), (53, 2) = Vector(2, {(1) = -1, (2) = 2}), (53, 3) = Vector(2, {(1) = -1, (2) = -1}), (54, 1) = Vector(2, {(1) = 5, (2) = 5}), (54, 2) = Vector(2, {(1) = -2, (2) = 1}), (54, 3) = Vector(2, {(1) = -1, (2) = -1}), (55, 1) = Vector(2, {(1) = 3, (2) = 6}), (55, 2) = Vector(2, {(1) = -3, (2) = 0}), (55, 3) = Vector(2, {(1) = -1, (2) = -1}), (56, 1) = Vector(2, {(1) = 0, (2) = 6}), (56, 2) = Vector(2, {(1) = -3, (2) = -1}), (56, 3) = Vector(2, {(1) = 0, (2) = -1}), (57, 1) = Vector(2, {(1) = -3, (2) = 5}), (57, 2) = Vector(2, {(1) = -2, (2) = -2}), (57, 3) = Vector(2, {(1) = 1, (2) = -1}), (58, 1) = Vector(2, {(1) = -5, (2) = 3}), (58, 2) = Vector(2, {(1) = -1, (2) = -3}), (58, 3) = Vector(2, {(1) = 1, (2) = -1}), (59, 1) = Vector(2, {(1) = -6, (2) = 0}), (59, 2) = Vector(2, {(1) = 0, (2) = -3}), (59, 3) = Vector(2, {(1) = 1, (2) = 0}), (60, 1) = Vector(2, {(1) = -6, (2) = -3}), (60, 2) = Vector(2, {(1) = 1, (2) = -2}), (60, 3) = Vector(2, {(1) = 1, (2) = 1})})

M := Matrix(60, 3, {(1, 1) = Vector(2, {(1) = -3, (2) = 5}), (1, 2) = Vector(2, {(1) = -2, (2) = -2}), (1, 3) = Vector(2, {(1) = 0, (2) = 0}), (2, 1) = Vector(2, {(1) = -5, (2) = 3}), (2, 2) = Vector(2, {(1) = -1, (2) = -3}), (2, 3) = Vector(2, {(1) = 1, (2) = -1}), (3, 1) = Vector(2, {(1) = -6, (2) = 0}), (3, 2) = Vector(2, {(1) = 0, (2) = -3}), (3, 3) = Vector(2, {(1) = 1, (2) = 0}), (4, 1) = Vector(2, {(1) = -6, (2) = -3}), (4, 2) = Vector(2, {(1) = 1, (2) = -2}), (4, 3) = Vector(2, {(1) = 1, (2) = 1}), (5, 1) = Vector(2, {(1) = -5, (2) = -5}), (5, 2) = Vector(2, {(1) = 2, (2) = -1}), (5, 3) = Vector(2, {(1) = 1, (2) = 1}), (6, 1) = Vector(2, {(1) = -3, (2) = -6}), (6, 2) = Vector(2, {(1) = 3, (2) = 0}), (6, 3) = Vector(2, {(1) = 1, (2) = 1}), (7, 1) = Vector(2, {(1) = 0, (2) = -6}), (7, 2) = Vector(2, {(1) = 3, (2) = 1}), (7, 3) = Vector(2, {(1) = 0, (2) = 1}), (8, 1) = Vector(2, {(1) = 3, (2) = -5}), (8, 2) = Vector(2, {(1) = 2, (2) = 2}), (8, 3) = Vector(2, {(1) = -1, (2) = 1}), (9, 1) = Vector(2, {(1) = 5, (2) = -3}), (9, 2) = Vector(2, {(1) = 1, (2) = 3}), (9, 3) = Vector(2, {(1) = -1, (2) = 1}), (10, 1) = Vector(2, {(1) = 6, (2) = 0}), (10, 2) = Vector(2, {(1) = 0, (2) = 3}), (10, 3) = Vector(2, {(1) = -1, (2) = 0}), (11, 1) = Vector(2, {(1) = 6, (2) = 3}), (11, 2) = Vector(2, {(1) = -1, (2) = 2}), (11, 3) = Vector(2, {(1) = -1, (2) = -1}), (12, 1) = Vector(2, {(1) = 5, (2) = 5}), (12, 2) = Vector(2, {(1) = -2, (2) = 1}), (12, 3) = Vector(2, {(1) = -1, (2) = -1}), (13, 1) = Vector(2, {(1) = 3, (2) = 6}), (13, 2) = Vector(2, {(1) = -3, (2) = 0}), (13, 3) = Vector(2, {(1) = -1, (2) = -1}), (14, 1) = Vector(2, {(1) = 0, (2) = 6}), (14, 2) = Vector(2, {(1) = -3, (2) = -1}), (14, 3) = Vector(2, {(1) = 0, (2) = -1}), (15, 1) = Vector(2, {(1) = -3, (2) = 5}), (15, 2) = Vector(2, {(1) = -2, (2) = -2}), (15, 3) = Vector(2, {(1) = 1, (2) = -1}), (16, 1) = Vector(2, {(1) = -5, (2) = 3}), (16, 2) = Vector(2, {(1) = -1, (2) = -3}), (16, 3) = Vector(2, {(1) = 1, (2) = -1}), (17, 1) = Vector(2, {(1) = -6, (2) = 0}), (17, 2) = Vector(2, {(1) = 0, (2) = -3}), (17, 3) = Vector(2, {(1) = 1, (2) = 0}), (18, 1) = Vector(2, {(1) = -6, (2) = -3}), (18, 2) = Vector(2, {(1) = 1, (2) = -2}), (18, 3) = Vector(2, {(1) = 1, (2) = 1}), (19, 1) = Vector(2, {(1) = -5, (2) = -5}), (19, 2) = Vector(2, {(1) = 2, (2) = -1}), (19, 3) = Vector(2, {(1) = 1, (2) = 1}), (20, 1) = Vector(2, {(1) = -3, (2) = -6}), (20, 2) = Vector(2, {(1) = 3, (2) = 0}), (20, 3) = Vector(2, {(1) = 1, (2) = 1}), (21, 1) = Vector(2, {(1) = 0, (2) = -6}), (21, 2) = Vector(2, {(1) = 3, (2) = 1}), (21, 3) = Vector(2, {(1) = 0, (2) = 1}), (22, 1) = Vector(2, {(1) = 3, (2) = -5}), (22, 2) = Vector(2, {(1) = 2, (2) = 2}), (22, 3) = Vector(2, {(1) = -1, (2) = 1}), (23, 1) = Vector(2, {(1) = 5, (2) = -3}), (23, 2) = Vector(2, {(1) = 1, (2) = 3}), (23, 3) = Vector(2, {(1) = -1, (2) = 1}), (24, 1) = Vector(2, {(1) = 6, (2) = 0}), (24, 2) = Vector(2, {(1) = 0, (2) = 3}), (24, 3) = Vector(2, {(1) = -1, (2) = 0}), (25, 1) = Vector(2, {(1) = 6, (2) = 3}), (25, 2) = Vector(2, {(1) = -1, (2) = 2}), (25, 3) = Vector(2, {(1) = -1, (2) = -1}), (26, 1) = Vector(2, {(1) = 5, (2) = 5}), (26, 2) = Vector(2, {(1) = -2, (2) = 1}), (26, 3) = Vector(2, {(1) = -1, (2) = -1}), (27, 1) = Vector(2, {(1) = 3, (2) = 6}), (27, 2) = Vector(2, {(1) = -3, (2) = 0}), (27, 3) = Vector(2, {(1) = -1, (2) = -1}), (28, 1) = Vector(2, {(1) = 0, (2) = 6}), (28, 2) = Vector(2, {(1) = -3, (2) = -1}), (28, 3) = Vector(2, {(1) = 0, (2) = -1}), (29, 1) = Vector(2, {(1) = -3, (2) = 5}), (29, 2) = Vector(2, {(1) = -2, (2) = -2}), (29, 3) = Vector(2, {(1) = 1, (2) = -1}), (30, 1) = Vector(2, {(1) = -5, (2) = 3}), (30, 2) = Vector(2, {(1) = -1, (2) = -3}), (30, 3) = Vector(2, {(1) = 1, (2) = -1}), (31, 1) = Vector(2, {(1) = -6, (2) = 0}), (31, 2) = Vector(2, {(1) = 0, (2) = -3}), (31, 3) = Vector(2, {(1) = 1, (2) = 0}), (32, 1) = Vector(2, {(1) = -6, (2) = -3}), (32, 2) = Vector(2, {(1) = 1, (2) = -2}), (32, 3) = Vector(2, {(1) = 1, (2) = 1}), (33, 1) = Vector(2, {(1) = -5, (2) = -5}), (33, 2) = Vector(2, {(1) = 2, (2) = -1}), (33, 3) = Vector(2, {(1) = 1, (2) = 1}), (34, 1) = Vector(2, {(1) = -3, (2) = -6}), (34, 2) = Vector(2, {(1) = 3, (2) = 0}), (34, 3) = Vector(2, {(1) = 1, (2) = 1}), (35, 1) = Vector(2, {(1) = 0, (2) = -6}), (35, 2) = Vector(2, {(1) = 3, (2) = 1}), (35, 3) = Vector(2, {(1) = 0, (2) = 1}), (36, 1) = Vector(2, {(1) = 3, (2) = -5}), (36, 2) = Vector(2, {(1) = 2, (2) = 2}), (36, 3) = Vector(2, {(1) = -1, (2) = 1}), (37, 1) = Vector(2, {(1) = 5, (2) = -3}), (37, 2) = Vector(2, {(1) = 1, (2) = 3}), (37, 3) = Vector(2, {(1) = -1, (2) = 1}), (38, 1) = Vector(2, {(1) = 6, (2) = 0}), (38, 2) = Vector(2, {(1) = 0, (2) = 3}), (38, 3) = Vector(2, {(1) = -1, (2) = 0}), (39, 1) = Vector(2, {(1) = 6, (2) = 3}), (39, 2) = Vector(2, {(1) = -1, (2) = 2}), (39, 3) = Vector(2, {(1) = -1, (2) = -1}), (40, 1) = Vector(2, {(1) = 5, (2) = 5}), (40, 2) = Vector(2, {(1) = -2, (2) = 1}), (40, 3) = Vector(2, {(1) = -1, (2) = -1}), (41, 1) = Vector(2, {(1) = 3, (2) = 6}), (41, 2) = Vector(2, {(1) = -3, (2) = 0}), (41, 3) = Vector(2, {(1) = -1, (2) = -1}), (42, 1) = Vector(2, {(1) = 0, (2) = 6}), (42, 2) = Vector(2, {(1) = -3, (2) = -1}), (42, 3) = Vector(2, {(1) = 0, (2) = -1}), (43, 1) = Vector(2, {(1) = -3, (2) = 5}), (43, 2) = Vector(2, {(1) = -2, (2) = -2}), (43, 3) = Vector(2, {(1) = 1, (2) = -1}), (44, 1) = Vector(2, {(1) = -5, (2) = 3}), (44, 2) = Vector(2, {(1) = -1, (2) = -3}), (44, 3) = Vector(2, {(1) = 1, (2) = -1}), (45, 1) = Vector(2, {(1) = -6, (2) = 0}), (45, 2) = Vector(2, {(1) = 0, (2) = -3}), (45, 3) = Vector(2, {(1) = 1, (2) = 0}), (46, 1) = Vector(2, {(1) = -6, (2) = -3}), (46, 2) = Vector(2, {(1) = 1, (2) = -2}), (46, 3) = Vector(2, {(1) = 1, (2) = 1}), (47, 1) = Vector(2, {(1) = -5, (2) = -5}), (47, 2) = Vector(2, {(1) = 2, (2) = -1}), (47, 3) = Vector(2, {(1) = 1, (2) = 1}), (48, 1) = Vector(2, {(1) = -3, (2) = -6}), (48, 2) = Vector(2, {(1) = 3, (2) = 0}), (48, 3) = Vector(2, {(1) = 1, (2) = 1}), (49, 1) = Vector(2, {(1) = 0, (2) = -6}), (49, 2) = Vector(2, {(1) = 3, (2) = 1}), (49, 3) = Vector(2, {(1) = 0, (2) = 1}), (50, 1) = Vector(2, {(1) = 3, (2) = -5}), (50, 2) = Vector(2, {(1) = 2, (2) = 2}), (50, 3) = Vector(2, {(1) = -1, (2) = 1}), (51, 1) = Vector(2, {(1) = 5, (2) = -3}), (51, 2) = Vector(2, {(1) = 1, (2) = 3}), (51, 3) = Vector(2, {(1) = -1, (2) = 1}), (52, 1) = Vector(2, {(1) = 6, (2) = 0}), (52, 2) = Vector(2, {(1) = 0, (2) = 3}), (52, 3) = Vector(2, {(1) = -1, (2) = 0}), (53, 1) = Vector(2, {(1) = 6, (2) = 3}), (53, 2) = Vector(2, {(1) = -1, (2) = 2}), (53, 3) = Vector(2, {(1) = -1, (2) = -1}), (54, 1) = Vector(2, {(1) = 5, (2) = 5}), (54, 2) = Vector(2, {(1) = -2, (2) = 1}), (54, 3) = Vector(2, {(1) = -1, (2) = -1}), (55, 1) = Vector(2, {(1) = 3, (2) = 6}), (55, 2) = Vector(2, {(1) = -3, (2) = 0}), (55, 3) = Vector(2, {(1) = -1, (2) = -1}), (56, 1) = Vector(2, {(1) = 0, (2) = 6}), (56, 2) = Vector(2, {(1) = -3, (2) = -1}), (56, 3) = Vector(2, {(1) = 0, (2) = -1}), (57, 1) = Vector(2, {(1) = -3, (2) = 5}), (57, 2) = Vector(2, {(1) = -2, (2) = -2}), (57, 3) = Vector(2, {(1) = 1, (2) = -1}), (58, 1) = Vector(2, {(1) = -5, (2) = 3}), (58, 2) = Vector(2, {(1) = -1, (2) = -3}), (58, 3) = Vector(2, {(1) = 1, (2) = -1}), (59, 1) = Vector(2, {(1) = -6, (2) = 0}), (59, 2) = Vector(2, {(1) = 0, (2) = -3}), (59, 3) = Vector(2, {(1) = 1, (2) = 0}), (60, 1) = Vector(2, {(1) = -6, (2) = -3}), (60, 2) = Vector(2, {(1) = 1, (2) = -2}), (60, 3) = Vector(2, {(1) = 1, (2) = 1})})

(3)

xmin := 0; xmax := 0; ymin := 0; ymax := 0; for i from 2 while M[i, 1] <> M[1, 1] and i < 25 do xmin := min(M[i, 1][1], xmin); ymin := min(M[i, 1][2], ymin); xmax := max(M[i, 1][1], xmax); ymax := max(M[i, 1][1], ymax) end do; i, xmin, xmax, ymin, ymax

25, -6, 6, -6, 6

(4)

orb := plot(([seq])([M[j, 1][1], M[j, 1][2]], j = 1 .. i), colour = blue); l1 := plot(sqrt(2-sqrt(2))*x/sqrt(2+sqrt(2)), x = xmin .. xmax, colour = green); l2 := plot(-sqrt(2-sqrt(2))*x/sqrt(2+sqrt(2)), x = xmin .. xmax, colour = green); l3 := plot(sqrt(2+sqrt(2))*x/sqrt(2-sqrt(2)), x = xmin .. xmax, y = ymin .. ymax, colour = green); l4 := plot(-sqrt(2+sqrt(2))*x/sqrt(2-sqrt(2)), x = xmin .. xmax, y = ymin .. ymax, colour = green); display(orb, l1, l2, l3, l4, scaling = constrained)

 

accel := plottools:-arrow(seq([M[j, 1][1], M[j, 1][2]], [M[j, 3][1], M[j, 3][2]], j = 1 .. i), colour = red)

Error, invalid input: seq expects its 3rd argument, step, to be of type numeric, but received j = 1 .. 25

 

``


 

Download plot_arrows_sequence.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)

M := Matrix(60, 3, {(1, 1) = Vector(2, {(1) = -3, (2) = 5}), (1, 2) = Vector(2, {(1) = -2, (2) = -2}), (1, 3) = Vector(2, {(1) = 0, (2) = 0}), (2, 1) = Vector(2, {(1) = -5, (2) = 3}), (2, 2) = Vector(2, {(1) = -1, (2) = -3}), (2, 3) = Vector(2, {(1) = 1, (2) = -1}), (3, 1) = Vector(2, {(1) = -6, (2) = 0}), (3, 2) = Vector(2, {(1) = 0, (2) = -3}), (3, 3) = Vector(2, {(1) = 1, (2) = 0}), (4, 1) = Vector(2, {(1) = -6, (2) = -3}), (4, 2) = Vector(2, {(1) = 1, (2) = -2}), (4, 3) = Vector(2, {(1) = 1, (2) = 1}), (5, 1) = Vector(2, {(1) = -5, (2) = -5}), (5, 2) = Vector(2, {(1) = 2, (2) = -1}), (5, 3) = Vector(2, {(1) = 1, (2) = 1}), (6, 1) = Vector(2, {(1) = -3, (2) = -6}), (6, 2) = Vector(2, {(1) = 3, (2) = 0}), (6, 3) = Vector(2, {(1) = 1, (2) = 1}), (7, 1) = Vector(2, {(1) = 0, (2) = -6}), (7, 2) = Vector(2, {(1) = 3, (2) = 1}), (7, 3) = Vector(2, {(1) = 0, (2) = 1}), (8, 1) = Vector(2, {(1) = 3, (2) = -5}), (8, 2) = Vector(2, {(1) = 2, (2) = 2}), (8, 3) = Vector(2, {(1) = -1, (2) = 1}), (9, 1) = Vector(2, {(1) = 5, (2) = -3}), (9, 2) = Vector(2, {(1) = 1, (2) = 3}), (9, 3) = Vector(2, {(1) = -1, (2) = 1}), (10, 1) = Vector(2, {(1) = 6, (2) = 0}), (10, 2) = Vector(2, {(1) = 0, (2) = 3}), (10, 3) = Vector(2, {(1) = -1, (2) = 0}), (11, 1) = Vector(2, {(1) = 6, (2) = 3}), (11, 2) = Vector(2, {(1) = -1, (2) = 2}), (11, 3) = Vector(2, {(1) = -1, (2) = -1}), (12, 1) = Vector(2, {(1) = 5, (2) = 5}), (12, 2) = Vector(2, {(1) = -2, (2) = 1}), (12, 3) = Vector(2, {(1) = -1, (2) = -1}), (13, 1) = Vector(2, {(1) = 3, (2) = 6}), (13, 2) = Vector(2, {(1) = -3, (2) = 0}), (13, 3) = Vector(2, {(1) = -1, (2) = -1}), (14, 1) = Vector(2, {(1) = 0, (2) = 6}), (14, 2) = Vector(2, {(1) = -3, (2) = -1}), (14, 3) = Vector(2, {(1) = 0, (2) = -1}), (15, 1) = Vector(2, {(1) = -3, (2) = 5}), (15, 2) = Vector(2, {(1) = -2, (2) = -2}), (15, 3) = Vector(2, {(1) = 1, (2) = -1}), (16, 1) = Vector(2, {(1) = -5, (2) = 3}), (16, 2) = Vector(2, {(1) = -1, (2) = -3}), (16, 3) = Vector(2, {(1) = 1, (2) = -1}), (17, 1) = Vector(2, {(1) = -6, (2) = 0}), (17, 2) = Vector(2, {(1) = 0, (2) = -3}), (17, 3) = Vector(2, {(1) = 1, (2) = 0}), (18, 1) = Vector(2, {(1) = -6, (2) = -3}), (18, 2) = Vector(2, {(1) = 1, (2) = -2}), (18, 3) = Vector(2, {(1) = 1, (2) = 1}), (19, 1) = Vector(2, {(1) = -5, (2) = -5}), (19, 2) = Vector(2, {(1) = 2, (2) = -1}), (19, 3) = Vector(2, {(1) = 1, (2) = 1}), (20, 1) = Vector(2, {(1) = -3, (2) = -6}), (20, 2) = Vector(2, {(1) = 3, (2) = 0}), (20, 3) = Vector(2, {(1) = 1, (2) = 1}), (21, 1) = Vector(2, {(1) = 0, (2) = -6}), (21, 2) = Vector(2, {(1) = 3, (2) = 1}), (21, 3) = Vector(2, {(1) = 0, (2) = 1}), (22, 1) = Vector(2, {(1) = 3, (2) = -5}), (22, 2) = Vector(2, {(1) = 2, (2) = 2}), (22, 3) = Vector(2, {(1) = -1, (2) = 1}), (23, 1) = Vector(2, {(1) = 5, (2) = -3}), (23, 2) = Vector(2, {(1) = 1, (2) = 3}), (23, 3) = Vector(2, {(1) = -1, (2) = 1}), (24, 1) = Vector(2, {(1) = 6, (2) = 0}), (24, 2) = Vector(2, {(1) = 0, (2) = 3}), (24, 3) = Vector(2, {(1) = -1, (2) = 0}), (25, 1) = Vector(2, {(1) = 6, (2) = 3}), (25, 2) = Vector(2, {(1) = -1, (2) = 2}), (25, 3) = Vector(2, {(1) = -1, (2) = -1}), (26, 1) = Vector(2, {(1) = 5, (2) = 5}), (26, 2) = Vector(2, {(1) = -2, (2) = 1}), (26, 3) = Vector(2, {(1) = -1, (2) = -1}), (27, 1) = Vector(2, {(1) = 3, (2) = 6}), (27, 2) = Vector(2, {(1) = -3, (2) = 0}), (27, 3) = Vector(2, {(1) = -1, (2) = -1}), (28, 1) = Vector(2, {(1) = 0, (2) = 6}), (28, 2) = Vector(2, {(1) = -3, (2) = -1}), (28, 3) = Vector(2, {(1) = 0, (2) = -1}), (29, 1) = Vector(2, {(1) = -3, (2) = 5}), (29, 2) = Vector(2, {(1) = -2, (2) = -2}), (29, 3) = Vector(2, {(1) = 1, (2) = -1}), (30, 1) = Vector(2, {(1) = -5, (2) = 3}), (30, 2) = Vector(2, {(1) = -1, (2) = -3}), (30, 3) = Vector(2, {(1) = 1, (2) = -1}), (31, 1) = Vector(2, {(1) = -6, (2) = 0}), (31, 2) = Vector(2, {(1) = 0, (2) = -3}), (31, 3) = Vector(2, {(1) = 1, (2) = 0}), (32, 1) = Vector(2, {(1) = -6, (2) = -3}), (32, 2) = Vector(2, {(1) = 1, (2) = -2}), (32, 3) = Vector(2, {(1) = 1, (2) = 1}), (33, 1) = Vector(2, {(1) = -5, (2) = -5}), (33, 2) = Vector(2, {(1) = 2, (2) = -1}), (33, 3) = Vector(2, {(1) = 1, (2) = 1}), (34, 1) = Vector(2, {(1) = -3, (2) = -6}), (34, 2) = Vector(2, {(1) = 3, (2) = 0}), (34, 3) = Vector(2, {(1) = 1, (2) = 1}), (35, 1) = Vector(2, {(1) = 0, (2) = -6}), (35, 2) = Vector(2, {(1) = 3, (2) = 1}), (35, 3) = Vector(2, {(1) = 0, (2) = 1}), (36, 1) = Vector(2, {(1) = 3, (2) = -5}), (36, 2) = Vector(2, {(1) = 2, (2) = 2}), (36, 3) = Vector(2, {(1) = -1, (2) = 1}), (37, 1) = Vector(2, {(1) = 5, (2) = -3}), (37, 2) = Vector(2, {(1) = 1, (2) = 3}), (37, 3) = Vector(2, {(1) = -1, (2) = 1}), (38, 1) = Vector(2, {(1) = 6, (2) = 0}), (38, 2) = Vector(2, {(1) = 0, (2) = 3}), (38, 3) = Vector(2, {(1) = -1, (2) = 0}), (39, 1) = Vector(2, {(1) = 6, (2) = 3}), (39, 2) = Vector(2, {(1) = -1, (2) = 2}), (39, 3) = Vector(2, {(1) = -1, (2) = -1}), (40, 1) = Vector(2, {(1) = 5, (2) = 5}), (40, 2) = Vector(2, {(1) = -2, (2) = 1}), (40, 3) = Vector(2, {(1) = -1, (2) = -1}), (41, 1) = Vector(2, {(1) = 3, (2) = 6}), (41, 2) = Vector(2, {(1) = -3, (2) = 0}), (41, 3) = Vector(2, {(1) = -1, (2) = -1}), (42, 1) = Vector(2, {(1) = 0, (2) = 6}), (42, 2) = Vector(2, {(1) = -3, (2) = -1}), (42, 3) = Vector(2, {(1) = 0, (2) = -1}), (43, 1) = Vector(2, {(1) = -3, (2) = 5}), (43, 2) = Vector(2, {(1) = -2, (2) = -2}), (43, 3) = Vector(2, {(1) = 1, (2) = -1}), (44, 1) = Vector(2, {(1) = -5, (2) = 3}), (44, 2) = Vector(2, {(1) = -1, (2) = -3}), (44, 3) = Vector(2, {(1) = 1, (2) = -1}), (45, 1) = Vector(2, {(1) = -6, (2) = 0}), (45, 2) = Vector(2, {(1) = 0, (2) = -3}), (45, 3) = Vector(2, {(1) = 1, (2) = 0}), (46, 1) = Vector(2, {(1) = -6, (2) = -3}), (46, 2) = Vector(2, {(1) = 1, (2) = -2}), (46, 3) = Vector(2, {(1) = 1, (2) = 1}), (47, 1) = Vector(2, {(1) = -5, (2) = -5}), (47, 2) = Vector(2, {(1) = 2, (2) = -1}), (47, 3) = Vector(2, {(1) = 1, (2) = 1}), (48, 1) = Vector(2, {(1) = -3, (2) = -6}), (48, 2) = Vector(2, {(1) = 3, (2) = 0}), (48, 3) = Vector(2, {(1) = 1, (2) = 1}), (49, 1) = Vector(2, {(1) = 0, (2) = -6}), (49, 2) = Vector(2, {(1) = 3, (2) = 1}), (49, 3) = Vector(2, {(1) = 0, (2) = 1}), (50, 1) = Vector(2, {(1) = 3, (2) = -5}), (50, 2) = Vector(2, {(1) = 2, (2) = 2}), (50, 3) = Vector(2, {(1) = -1, (2) = 1}), (51, 1) = Vector(2, {(1) = 5, (2) = -3}), (51, 2) = Vector(2, {(1) = 1, (2) = 3}), (51, 3) = Vector(2, {(1) = -1, (2) = 1}), (52, 1) = Vector(2, {(1) = 6, (2) = 0}), (52, 2) = Vector(2, {(1) = 0, (2) = 3}), (52, 3) = Vector(2, {(1) = -1, (2) = 0}), (53, 1) = Vector(2, {(1) = 6, (2) = 3}), (53, 2) = Vector(2, {(1) = -1, (2) = 2}), (53, 3) = Vector(2, {(1) = -1, (2) = -1}), (54, 1) = Vector(2, {(1) = 5, (2) = 5}), (54, 2) = Vector(2, {(1) = -2, (2) = 1}), (54, 3) = Vector(2, {(1) = -1, (2) = -1}), (55, 1) = Vector(2, {(1) = 3, (2) = 6}), (55, 2) = Vector(2, {(1) = -3, (2) = 0}), (55, 3) = Vector(2, {(1) = -1, (2) = -1}), (56, 1) = Vector(2, {(1) = 0, (2) = 6}), (56, 2) = Vector(2, {(1) = -3, (2) = -1}), (56, 3) = Vector(2, {(1) = 0, (2) = -1}), (57, 1) = Vector(2, {(1) = -3, (2) = 5}), (57, 2) = Vector(2, {(1) = -2, (2) = -2}), (57, 3) = Vector(2, {(1) = 1, (2) = -1}), (58, 1) = Vector(2, {(1) = -5, (2) = 3}), (58, 2) = Vector(2, {(1) = -1, (2) = -3}), (58, 3) = Vector(2, {(1) = 1, (2) = -1}), (59, 1) = Vector(2, {(1) = -6, (2) = 0}), (59, 2) = Vector(2, {(1) = 0, (2) = -3}), (59, 3) = Vector(2, {(1) = 1, (2) = 0}), (60, 1) = Vector(2, {(1) = -6, (2) = -3}), (60, 2) = Vector(2, {(1) = 1, (2) = -2}), (60, 3) = Vector(2, {(1) = 1, (2) = 1})})

M := Matrix(60, 3, {(1, 1) = Vector(2, {(1) = -3, (2) = 5}), (1, 2) = Vector(2, {(1) = -2, (2) = -2}), (1, 3) = Vector(2, {(1) = 0, (2) = 0}), (2, 1) = Vector(2, {(1) = -5, (2) = 3}), (2, 2) = Vector(2, {(1) = -1, (2) = -3}), (2, 3) = Vector(2, {(1) = 1, (2) = -1}), (3, 1) = Vector(2, {(1) = -6, (2) = 0}), (3, 2) = Vector(2, {(1) = 0, (2) = -3}), (3, 3) = Vector(2, {(1) = 1, (2) = 0}), (4, 1) = Vector(2, {(1) = -6, (2) = -3}), (4, 2) = Vector(2, {(1) = 1, (2) = -2}), (4, 3) = Vector(2, {(1) = 1, (2) = 1}), (5, 1) = Vector(2, {(1) = -5, (2) = -5}), (5, 2) = Vector(2, {(1) = 2, (2) = -1}), (5, 3) = Vector(2, {(1) = 1, (2) = 1}), (6, 1) = Vector(2, {(1) = -3, (2) = -6}), (6, 2) = Vector(2, {(1) = 3, (2) = 0}), (6, 3) = Vector(2, {(1) = 1, (2) = 1}), (7, 1) = Vector(2, {(1) = 0, (2) = -6}), (7, 2) = Vector(2, {(1) = 3, (2) = 1}), (7, 3) = Vector(2, {(1) = 0, (2) = 1}), (8, 1) = Vector(2, {(1) = 3, (2) = -5}), (8, 2) = Vector(2, {(1) = 2, (2) = 2}), (8, 3) = Vector(2, {(1) = -1, (2) = 1}), (9, 1) = Vector(2, {(1) = 5, (2) = -3}), (9, 2) = Vector(2, {(1) = 1, (2) = 3}), (9, 3) = Vector(2, {(1) = -1, (2) = 1}), (10, 1) = Vector(2, {(1) = 6, (2) = 0}), (10, 2) = Vector(2, {(1) = 0, (2) = 3}), (10, 3) = Vector(2, {(1) = -1, (2) = 0}), (11, 1) = Vector(2, {(1) = 6, (2) = 3}), (11, 2) = Vector(2, {(1) = -1, (2) = 2}), (11, 3) = Vector(2, {(1) = -1, (2) = -1}), (12, 1) = Vector(2, {(1) = 5, (2) = 5}), (12, 2) = Vector(2, {(1) = -2, (2) = 1}), (12, 3) = Vector(2, {(1) = -1, (2) = -1}), (13, 1) = Vector(2, {(1) = 3, (2) = 6}), (13, 2) = Vector(2, {(1) = -3, (2) = 0}), (13, 3) = Vector(2, {(1) = -1, (2) = -1}), (14, 1) = Vector(2, {(1) = 0, (2) = 6}), (14, 2) = Vector(2, {(1) = -3, (2) = -1}), (14, 3) = Vector(2, {(1) = 0, (2) = -1}), (15, 1) = Vector(2, {(1) = -3, (2) = 5}), (15, 2) = Vector(2, {(1) = -2, (2) = -2}), (15, 3) = Vector(2, {(1) = 1, (2) = -1}), (16, 1) = Vector(2, {(1) = -5, (2) = 3}), (16, 2) = Vector(2, {(1) = -1, (2) = -3}), (16, 3) = Vector(2, {(1) = 1, (2) = -1}), (17, 1) = Vector(2, {(1) = -6, (2) = 0}), (17, 2) = Vector(2, {(1) = 0, (2) = -3}), (17, 3) = Vector(2, {(1) = 1, (2) = 0}), (18, 1) = Vector(2, {(1) = -6, (2) = -3}), (18, 2) = Vector(2, {(1) = 1, (2) = -2}), (18, 3) = Vector(2, {(1) = 1, (2) = 1}), (19, 1) = Vector(2, {(1) = -5, (2) = -5}), (19, 2) = Vector(2, {(1) = 2, (2) = -1}), (19, 3) = Vector(2, {(1) = 1, (2) = 1}), (20, 1) = Vector(2, {(1) = -3, (2) = -6}), (20, 2) = Vector(2, {(1) = 3, (2) = 0}), (20, 3) = Vector(2, {(1) = 1, (2) = 1}), (21, 1) = Vector(2, {(1) = 0, (2) = -6}), (21, 2) = Vector(2, {(1) = 3, (2) = 1}), (21, 3) = Vector(2, {(1) = 0, (2) = 1}), (22, 1) = Vector(2, {(1) = 3, (2) = -5}), (22, 2) = Vector(2, {(1) = 2, (2) = 2}), (22, 3) = Vector(2, {(1) = -1, (2) = 1}), (23, 1) = Vector(2, {(1) = 5, (2) = -3}), (23, 2) = Vector(2, {(1) = 1, (2) = 3}), (23, 3) = Vector(2, {(1) = -1, (2) = 1}), (24, 1) = Vector(2, {(1) = 6, (2) = 0}), (24, 2) = Vector(2, {(1) = 0, (2) = 3}), (24, 3) = Vector(2, {(1) = -1, (2) = 0}), (25, 1) = Vector(2, {(1) = 6, (2) = 3}), (25, 2) = Vector(2, {(1) = -1, (2) = 2}), (25, 3) = Vector(2, {(1) = -1, (2) = -1}), (26, 1) = Vector(2, {(1) = 5, (2) = 5}), (26, 2) = Vector(2, {(1) = -2, (2) = 1}), (26, 3) = Vector(2, {(1) = -1, (2) = -1}), (27, 1) = Vector(2, {(1) = 3, (2) = 6}), (27, 2) = Vector(2, {(1) = -3, (2) = 0}), (27, 3) = Vector(2, {(1) = -1, (2) = -1}), (28, 1) = Vector(2, {(1) = 0, (2) = 6}), (28, 2) = Vector(2, {(1) = -3, (2) = -1}), (28, 3) = Vector(2, {(1) = 0, (2) = -1}), (29, 1) = Vector(2, {(1) = -3, (2) = 5}), (29, 2) = Vector(2, {(1) = -2, (2) = -2}), (29, 3) = Vector(2, {(1) = 1, (2) = -1}), (30, 1) = Vector(2, {(1) = -5, (2) = 3}), (30, 2) = Vector(2, {(1) = -1, (2) = -3}), (30, 3) = Vector(2, {(1) = 1, (2) = -1}), (31, 1) = Vector(2, {(1) = -6, (2) = 0}), (31, 2) = Vector(2, {(1) = 0, (2) = -3}), (31, 3) = Vector(2, {(1) = 1, (2) = 0}), (32, 1) = Vector(2, {(1) = -6, (2) = -3}), (32, 2) = Vector(2, {(1) = 1, (2) = -2}), (32, 3) = Vector(2, {(1) = 1, (2) = 1}), (33, 1) = Vector(2, {(1) = -5, (2) = -5}), (33, 2) = Vector(2, {(1) = 2, (2) = -1}), (33, 3) = Vector(2, {(1) = 1, (2) = 1}), (34, 1) = Vector(2, {(1) = -3, (2) = -6}), (34, 2) = Vector(2, {(1) = 3, (2) = 0}), (34, 3) = Vector(2, {(1) = 1, (2) = 1}), (35, 1) = Vector(2, {(1) = 0, (2) = -6}), (35, 2) = Vector(2, {(1) = 3, (2) = 1}), (35, 3) = Vector(2, {(1) = 0, (2) = 1}), (36, 1) = Vector(2, {(1) = 3, (2) = -5}), (36, 2) = Vector(2, {(1) = 2, (2) = 2}), (36, 3) = Vector(2, {(1) = -1, (2) = 1}), (37, 1) = Vector(2, {(1) = 5, (2) = -3}), (37, 2) = Vector(2, {(1) = 1, (2) = 3}), (37, 3) = Vector(2, {(1) = -1, (2) = 1}), (38, 1) = Vector(2, {(1) = 6, (2) = 0}), (38, 2) = Vector(2, {(1) = 0, (2) = 3}), (38, 3) = Vector(2, {(1) = -1, (2) = 0}), (39, 1) = Vector(2, {(1) = 6, (2) = 3}), (39, 2) = Vector(2, {(1) = -1, (2) = 2}), (39, 3) = Vector(2, {(1) = -1, (2) = -1}), (40, 1) = Vector(2, {(1) = 5, (2) = 5}), (40, 2) = Vector(2, {(1) = -2, (2) = 1}), (40, 3) = Vector(2, {(1) = -1, (2) = -1}), (41, 1) = Vector(2, {(1) = 3, (2) = 6}), (41, 2) = Vector(2, {(1) = -3, (2) = 0}), (41, 3) = Vector(2, {(1) = -1, (2) = -1}), (42, 1) = Vector(2, {(1) = 0, (2) = 6}), (42, 2) = Vector(2, {(1) = -3, (2) = -1}), (42, 3) = Vector(2, {(1) = 0, (2) = -1}), (43, 1) = Vector(2, {(1) = -3, (2) = 5}), (43, 2) = Vector(2, {(1) = -2, (2) = -2}), (43, 3) = Vector(2, {(1) = 1, (2) = -1}), (44, 1) = Vector(2, {(1) = -5, (2) = 3}), (44, 2) = Vector(2, {(1) = -1, (2) = -3}), (44, 3) = Vector(2, {(1) = 1, (2) = -1}), (45, 1) = Vector(2, {(1) = -6, (2) = 0}), (45, 2) = Vector(2, {(1) = 0, (2) = -3}), (45, 3) = Vector(2, {(1) = 1, (2) = 0}), (46, 1) = Vector(2, {(1) = -6, (2) = -3}), (46, 2) = Vector(2, {(1) = 1, (2) = -2}), (46, 3) = Vector(2, {(1) = 1, (2) = 1}), (47, 1) = Vector(2, {(1) = -5, (2) = -5}), (47, 2) = Vector(2, {(1) = 2, (2) = -1}), (47, 3) = Vector(2, {(1) = 1, (2) = 1}), (48, 1) = Vector(2, {(1) = -3, (2) = -6}), (48, 2) = Vector(2, {(1) = 3, (2) = 0}), (48, 3) = Vector(2, {(1) = 1, (2) = 1}), (49, 1) = Vector(2, {(1) = 0, (2) = -6}), (49, 2) = Vector(2, {(1) = 3, (2) = 1}), (49, 3) = Vector(2, {(1) = 0, (2) = 1}), (50, 1) = Vector(2, {(1) = 3, (2) = -5}), (50, 2) = Vector(2, {(1) = 2, (2) = 2}), (50, 3) = Vector(2, {(1) = -1, (2) = 1}), (51, 1) = Vector(2, {(1) = 5, (2) = -3}), (51, 2) = Vector(2, {(1) = 1, (2) = 3}), (51, 3) = Vector(2, {(1) = -1, (2) = 1}), (52, 1) = Vector(2, {(1) = 6, (2) = 0}), (52, 2) = Vector(2, {(1) = 0, (2) = 3}), (52, 3) = Vector(2, {(1) = -1, (2) = 0}), (53, 1) = Vector(2, {(1) = 6, (2) = 3}), (53, 2) = Vector(2, {(1) = -1, (2) = 2}), (53, 3) = Vector(2, {(1) = -1, (2) = -1}), (54, 1) = Vector(2, {(1) = 5, (2) = 5}), (54, 2) = Vector(2, {(1) = -2, (2) = 1}), (54, 3) = Vector(2, {(1) = -1, (2) = -1}), (55, 1) = Vector(2, {(1) = 3, (2) = 6}), (55, 2) = Vector(2, {(1) = -3, (2) = 0}), (55, 3) = Vector(2, {(1) = -1, (2) = -1}), (56, 1) = Vector(2, {(1) = 0, (2) = 6}), (56, 2) = Vector(2, {(1) = -3, (2) = -1}), (56, 3) = Vector(2, {(1) = 0, (2) = -1}), (57, 1) = Vector(2, {(1) = -3, (2) = 5}), (57, 2) = Vector(2, {(1) = -2, (2) = -2}), (57, 3) = Vector(2, {(1) = 1, (2) = -1}), (58, 1) = Vector(2, {(1) = -5, (2) = 3}), (58, 2) = Vector(2, {(1) = -1, (2) = -3}), (58, 3) = Vector(2, {(1) = 1, (2) = -1}), (59, 1) = Vector(2, {(1) = -6, (2) = 0}), (59, 2) = Vector(2, {(1) = 0, (2) = -3}), (59, 3) = Vector(2, {(1) = 1, (2) = 0}), (60, 1) = Vector(2, {(1) = -6, (2) = -3}), (60, 2) = Vector(2, {(1) = 1, (2) = -2}), (60, 3) = Vector(2, {(1) = 1, (2) = 1})})

(3)

xmin := 0; xmax := 0; ymin := 0; ymax := 0; for i from 2 while M[i, 1] <> M[1, 1] and i < 25 do xmin := min(M[i, 1][1], xmin); ymin := min(M[i, 1][2], ymin); xmax := max(M[i, 1][1], xmax); ymax := max(M[i, 1][1], ymax) end do; i, xmin, xmax, ymin, ymax

25, -6, 6, -6, 6

(4)

orb := plot(([seq])([M[j, 1][1], M[j, 1][2]], j = 1 .. i), colour = blue); l1 := plot(sqrt(2-sqrt(2))*x/sqrt(2+sqrt(2)), x = xmin .. xmax, colour = green); l2 := plot(-sqrt(2-sqrt(2))*x/sqrt(2+sqrt(2)), x = xmin .. xmax, colour = green); l3 := plot(sqrt(2+sqrt(2))*x/sqrt(2-sqrt(2)), x = xmin .. xmax, y = ymin .. ymax, colour = green); l4 := plot(-sqrt(2+sqrt(2))*x/sqrt(2-sqrt(2)), x = xmin .. xmax, y = ymin .. ymax, colour = green); display(orb, l1, l2, l3, l4, scaling = constrained)

 

accel := plottools:-arrow(seq([M[j, 1][1], M[j, 1][2]], [M[j, 3][1], M[j, 3][2]], j = 1 .. i), colour = red)

Error, invalid input: seq expects its 3rd argument, step, to be of type numeric, but received j = 1 .. 25

 

``


 

Download plot_arrows_sequence.mw

 

I want to learn about why sometimes different algebraic expressions are ordered differently, and what would be the best way to instruct maple to chose a different "rule" for which a set of arithmetic functions are ordered, while still maintaining the axiom of uniqueness. 

 

I figured this would be accomplished on a case by case basis, and it may involve just using lists instead,defining a procedure to produce the desired ordering for any given set of functions, and using the "remove" command to replace the set "difference" operator and the Join command for the lists in place of the union operator. Then of course using the "Remove Duplicates" option from ListTools to impose the axiom of unique elements. 

 

Is this the best way to go about this, or is there a much simpler way, that includes an abstract algebra package that I'm unaware of thus far?

Dear sir, I hereby request you to suggest an appropriate method to plot phase portrait sketches for the above cited subject

in 2D and 3D for the problem  

 

 

With thanks and regards.

 

Mr M ANAND

Associate Profesoor in Mathematics.

This question is related to an answer I gave here:
So, please look at a simple worksheet containing only a few lines; the resuts are in the # comments.

restart;
evalf(frac(Pi^20));

#                              23.
restart;
printlevel:=40:
evalf(frac(Pi^20));

  ###  prinlevel stuff
#                              0.


And now the questions.
1. Why the first evalf(frac(Pi^20))  does not  call  `evalf/frac`?
     (the second does, trace(`evalf/frac`)  shows this  if inserted).
     Note that  `evalf/frac`(Pi^20)    returns  0.
2. Why evalf(frac(Pi^20))    depends on printlevel?
    Note that  if  printlevel is changed to 20 (say)  the result is again 23.
3. Why if we set interface(typesetting=standard)  in a fresh session
     the results are both 23?

 

I can't get a While do loop to work as expected.

For i from 2 while M[i,1]<>M[1,1] and i<25 do..   It doesn't catch row 15 where M[15,1] =M[1,1] but it does stop at i = 24 ok.
 

restart

``

M := Matrix(60, 3, {(1, 1) = Vector(2, {(1) = -3, (2) = 5}), (1, 2) = Vector(2, {(1) = -2, (2) = -2}), (1, 3) = Vector(2, {(1) = 0, (2) = 0}), (2, 1) = Vector(2, {(1) = -5, (2) = 3}), (2, 2) = Vector(2, {(1) = -1, (2) = -3}), (2, 3) = Vector(2, {(1) = 1, (2) = -1}), (3, 1) = Vector(2, {(1) = -6, (2) = 0}), (3, 2) = Vector(2, {(1) = 0, (2) = -3}), (3, 3) = Vector(2, {(1) = 1, (2) = 0}), (4, 1) = Vector(2, {(1) = -6, (2) = -3}), (4, 2) = Vector(2, {(1) = 1, (2) = -2}), (4, 3) = Vector(2, {(1) = 1, (2) = 1}), (5, 1) = Vector(2, {(1) = -5, (2) = -5}), (5, 2) = Vector(2, {(1) = 2, (2) = -1}), (5, 3) = Vector(2, {(1) = 1, (2) = 1}), (6, 1) = Vector(2, {(1) = -3, (2) = -6}), (6, 2) = Vector(2, {(1) = 3, (2) = 0}), (6, 3) = Vector(2, {(1) = 1, (2) = 1}), (7, 1) = Vector(2, {(1) = 0, (2) = -6}), (7, 2) = Vector(2, {(1) = 3, (2) = 1}), (7, 3) = Vector(2, {(1) = 0, (2) = 1}), (8, 1) = Vector(2, {(1) = 3, (2) = -5}), (8, 2) = Vector(2, {(1) = 2, (2) = 2}), (8, 3) = Vector(2, {(1) = -1, (2) = 1}), (9, 1) = Vector(2, {(1) = 5, (2) = -3}), (9, 2) = Vector(2, {(1) = 1, (2) = 3}), (9, 3) = Vector(2, {(1) = -1, (2) = 1}), (10, 1) = Vector(2, {(1) = 6, (2) = 0}), (10, 2) = Vector(2, {(1) = 0, (2) = 3}), (10, 3) = Vector(2, {(1) = -1, (2) = 0}), (11, 1) = Vector(2, {(1) = 6, (2) = 3}), (11, 2) = Vector(2, {(1) = -1, (2) = 2}), (11, 3) = Vector(2, {(1) = -1, (2) = -1}), (12, 1) = Vector(2, {(1) = 5, (2) = 5}), (12, 2) = Vector(2, {(1) = -2, (2) = 1}), (12, 3) = Vector(2, {(1) = -1, (2) = -1}), (13, 1) = Vector(2, {(1) = 3, (2) = 6}), (13, 2) = Vector(2, {(1) = -3, (2) = 0}), (13, 3) = Vector(2, {(1) = -1, (2) = -1}), (14, 1) = Vector(2, {(1) = 0, (2) = 6}), (14, 2) = Vector(2, {(1) = -3, (2) = -1}), (14, 3) = Vector(2, {(1) = 0, (2) = -1}), (15, 1) = Vector(2, {(1) = -3, (2) = 5}), (15, 2) = Vector(2, {(1) = -2, (2) = -2}), (15, 3) = Vector(2, {(1) = 1, (2) = -1}), (16, 1) = Vector(2, {(1) = -5, (2) = 3}), (16, 2) = Vector(2, {(1) = -1, (2) = -3}), (16, 3) = Vector(2, {(1) = 1, (2) = -1}), (17, 1) = Vector(2, {(1) = -6, (2) = 0}), (17, 2) = Vector(2, {(1) = 0, (2) = -3}), (17, 3) = Vector(2, {(1) = 1, (2) = 0}), (18, 1) = Vector(2, {(1) = -6, (2) = -3}), (18, 2) = Vector(2, {(1) = 1, (2) = -2}), (18, 3) = Vector(2, {(1) = 1, (2) = 1}), (19, 1) = Vector(2, {(1) = -5, (2) = -5}), (19, 2) = Vector(2, {(1) = 2, (2) = -1}), (19, 3) = Vector(2, {(1) = 1, (2) = 1}), (20, 1) = Vector(2, {(1) = -3, (2) = -6}), (20, 2) = Vector(2, {(1) = 3, (2) = 0}), (20, 3) = Vector(2, {(1) = 1, (2) = 1}), (21, 1) = Vector(2, {(1) = 0, (2) = -6}), (21, 2) = Vector(2, {(1) = 3, (2) = 1}), (21, 3) = Vector(2, {(1) = 0, (2) = 1}), (22, 1) = Vector(2, {(1) = 3, (2) = -5}), (22, 2) = Vector(2, {(1) = 2, (2) = 2}), (22, 3) = Vector(2, {(1) = -1, (2) = 1}), (23, 1) = Vector(2, {(1) = 5, (2) = -3}), (23, 2) = Vector(2, {(1) = 1, (2) = 3}), (23, 3) = Vector(2, {(1) = -1, (2) = 1}), (24, 1) = Vector(2, {(1) = 6, (2) = 0}), (24, 2) = Vector(2, {(1) = 0, (2) = 3}), (24, 3) = Vector(2, {(1) = -1, (2) = 0}), (25, 1) = Vector(2, {(1) = 6, (2) = 3}), (25, 2) = Vector(2, {(1) = -1, (2) = 2}), (25, 3) = Vector(2, {(1) = -1, (2) = -1}), (26, 1) = Vector(2, {(1) = 5, (2) = 5}), (26, 2) = Vector(2, {(1) = -2, (2) = 1}), (26, 3) = Vector(2, {(1) = -1, (2) = -1}), (27, 1) = Vector(2, {(1) = 3, (2) = 6}), (27, 2) = Vector(2, {(1) = -3, (2) = 0}), (27, 3) = Vector(2, {(1) = -1, (2) = -1}), (28, 1) = Vector(2, {(1) = 0, (2) = 6}), (28, 2) = Vector(2, {(1) = -3, (2) = -1}), (28, 3) = Vector(2, {(1) = 0, (2) = -1}), (29, 1) = Vector(2, {(1) = -3, (2) = 5}), (29, 2) = Vector(2, {(1) = -2, (2) = -2}), (29, 3) = Vector(2, {(1) = 1, (2) = -1}), (30, 1) = Vector(2, {(1) = -5, (2) = 3}), (30, 2) = Vector(2, {(1) = -1, (2) = -3}), (30, 3) = Vector(2, {(1) = 1, (2) = -1}), (31, 1) = Vector(2, {(1) = -6, (2) = 0}), (31, 2) = Vector(2, {(1) = 0, (2) = -3}), (31, 3) = Vector(2, {(1) = 1, (2) = 0}), (32, 1) = Vector(2, {(1) = -6, (2) = -3}), (32, 2) = Vector(2, {(1) = 1, (2) = -2}), (32, 3) = Vector(2, {(1) = 1, (2) = 1}), (33, 1) = Vector(2, {(1) = -5, (2) = -5}), (33, 2) = Vector(2, {(1) = 2, (2) = -1}), (33, 3) = Vector(2, {(1) = 1, (2) = 1}), (34, 1) = Vector(2, {(1) = -3, (2) = -6}), (34, 2) = Vector(2, {(1) = 3, (2) = 0}), (34, 3) = Vector(2, {(1) = 1, (2) = 1}), (35, 1) = Vector(2, {(1) = 0, (2) = -6}), (35, 2) = Vector(2, {(1) = 3, (2) = 1}), (35, 3) = Vector(2, {(1) = 0, (2) = 1}), (36, 1) = Vector(2, {(1) = 3, (2) = -5}), (36, 2) = Vector(2, {(1) = 2, (2) = 2}), (36, 3) = Vector(2, {(1) = -1, (2) = 1}), (37, 1) = Vector(2, {(1) = 5, (2) = -3}), (37, 2) = Vector(2, {(1) = 1, (2) = 3}), (37, 3) = Vector(2, {(1) = -1, (2) = 1}), (38, 1) = Vector(2, {(1) = 6, (2) = 0}), (38, 2) = Vector(2, {(1) = 0, (2) = 3}), (38, 3) = Vector(2, {(1) = -1, (2) = 0}), (39, 1) = Vector(2, {(1) = 6, (2) = 3}), (39, 2) = Vector(2, {(1) = -1, (2) = 2}), (39, 3) = Vector(2, {(1) = -1, (2) = -1}), (40, 1) = Vector(2, {(1) = 5, (2) = 5}), (40, 2) = Vector(2, {(1) = -2, (2) = 1}), (40, 3) = Vector(2, {(1) = -1, (2) = -1}), (41, 1) = Vector(2, {(1) = 3, (2) = 6}), (41, 2) = Vector(2, {(1) = -3, (2) = 0}), (41, 3) = Vector(2, {(1) = -1, (2) = -1}), (42, 1) = Vector(2, {(1) = 0, (2) = 6}), (42, 2) = Vector(2, {(1) = -3, (2) = -1}), (42, 3) = Vector(2, {(1) = 0, (2) = -1}), (43, 1) = Vector(2, {(1) = -3, (2) = 5}), (43, 2) = Vector(2, {(1) = -2, (2) = -2}), (43, 3) = Vector(2, {(1) = 1, (2) = -1}), (44, 1) = Vector(2, {(1) = -5, (2) = 3}), (44, 2) = Vector(2, {(1) = -1, (2) = -3}), (44, 3) = Vector(2, {(1) = 1, (2) = -1}), (45, 1) = Vector(2, {(1) = -6, (2) = 0}), (45, 2) = Vector(2, {(1) = 0, (2) = -3}), (45, 3) = Vector(2, {(1) = 1, (2) = 0}), (46, 1) = Vector(2, {(1) = -6, (2) = -3}), (46, 2) = Vector(2, {(1) = 1, (2) = -2}), (46, 3) = Vector(2, {(1) = 1, (2) = 1}), (47, 1) = Vector(2, {(1) = -5, (2) = -5}), (47, 2) = Vector(2, {(1) = 2, (2) = -1}), (47, 3) = Vector(2, {(1) = 1, (2) = 1}), (48, 1) = Vector(2, {(1) = -3, (2) = -6}), (48, 2) = Vector(2, {(1) = 3, (2) = 0}), (48, 3) = Vector(2, {(1) = 1, (2) = 1}), (49, 1) = Vector(2, {(1) = 0, (2) = -6}), (49, 2) = Vector(2, {(1) = 3, (2) = 1}), (49, 3) = Vector(2, {(1) = 0, (2) = 1}), (50, 1) = Vector(2, {(1) = 3, (2) = -5}), (50, 2) = Vector(2, {(1) = 2, (2) = 2}), (50, 3) = Vector(2, {(1) = -1, (2) = 1}), (51, 1) = Vector(2, {(1) = 5, (2) = -3}), (51, 2) = Vector(2, {(1) = 1, (2) = 3}), (51, 3) = Vector(2, {(1) = -1, (2) = 1}), (52, 1) = Vector(2, {(1) = 6, (2) = 0}), (52, 2) = Vector(2, {(1) = 0, (2) = 3}), (52, 3) = Vector(2, {(1) = -1, (2) = 0}), (53, 1) = Vector(2, {(1) = 6, (2) = 3}), (53, 2) = Vector(2, {(1) = -1, (2) = 2}), (53, 3) = Vector(2, {(1) = -1, (2) = -1}), (54, 1) = Vector(2, {(1) = 5, (2) = 5}), (54, 2) = Vector(2, {(1) = -2, (2) = 1}), (54, 3) = Vector(2, {(1) = -1, (2) = -1}), (55, 1) = Vector(2, {(1) = 3, (2) = 6}), (55, 2) = Vector(2, {(1) = -3, (2) = 0}), (55, 3) = Vector(2, {(1) = -1, (2) = -1}), (56, 1) = Vector(2, {(1) = 0, (2) = 6}), (56, 2) = Vector(2, {(1) = -3, (2) = -1}), (56, 3) = Vector(2, {(1) = 0, (2) = -1}), (57, 1) = Vector(2, {(1) = -3, (2) = 5}), (57, 2) = Vector(2, {(1) = -2, (2) = -2}), (57, 3) = Vector(2, {(1) = 1, (2) = -1}), (58, 1) = Vector(2, {(1) = -5, (2) = 3}), (58, 2) = Vector(2, {(1) = -1, (2) = -3}), (58, 3) = Vector(2, {(1) = 1, (2) = -1}), (59, 1) = Vector(2, {(1) = -6, (2) = 0}), (59, 2) = Vector(2, {(1) = 0, (2) = -3}), (59, 3) = Vector(2, {(1) = 1, (2) = 0}), (60, 1) = Vector(2, {(1) = -6, (2) = -3}), (60, 2) = Vector(2, {(1) = 1, (2) = -2}), (60, 3) = Vector(2, {(1) = 1, (2) = 1})})

M := Matrix(60, 3, {(1, 1) = Vector(2, {(1) = -3, (2) = 5}), (1, 2) = Vector(2, {(1) = -2, (2) = -2}), (1, 3) = Vector(2, {(1) = 0, (2) = 0}), (2, 1) = Vector(2, {(1) = -5, (2) = 3}), (2, 2) = Vector(2, {(1) = -1, (2) = -3}), (2, 3) = Vector(2, {(1) = 1, (2) = -1}), (3, 1) = Vector(2, {(1) = -6, (2) = 0}), (3, 2) = Vector(2, {(1) = 0, (2) = -3}), (3, 3) = Vector(2, {(1) = 1, (2) = 0}), (4, 1) = Vector(2, {(1) = -6, (2) = -3}), (4, 2) = Vector(2, {(1) = 1, (2) = -2}), (4, 3) = Vector(2, {(1) = 1, (2) = 1}), (5, 1) = Vector(2, {(1) = -5, (2) = -5}), (5, 2) = Vector(2, {(1) = 2, (2) = -1}), (5, 3) = Vector(2, {(1) = 1, (2) = 1}), (6, 1) = Vector(2, {(1) = -3, (2) = -6}), (6, 2) = Vector(2, {(1) = 3, (2) = 0}), (6, 3) = Vector(2, {(1) = 1, (2) = 1}), (7, 1) = Vector(2, {(1) = 0, (2) = -6}), (7, 2) = Vector(2, {(1) = 3, (2) = 1}), (7, 3) = Vector(2, {(1) = 0, (2) = 1}), (8, 1) = Vector(2, {(1) = 3, (2) = -5}), (8, 2) = Vector(2, {(1) = 2, (2) = 2}), (8, 3) = Vector(2, {(1) = -1, (2) = 1}), (9, 1) = Vector(2, {(1) = 5, (2) = -3}), (9, 2) = Vector(2, {(1) = 1, (2) = 3}), (9, 3) = Vector(2, {(1) = -1, (2) = 1}), (10, 1) = Vector(2, {(1) = 6, (2) = 0}), (10, 2) = Vector(2, {(1) = 0, (2) = 3}), (10, 3) = Vector(2, {(1) = -1, (2) = 0}), (11, 1) = Vector(2, {(1) = 6, (2) = 3}), (11, 2) = Vector(2, {(1) = -1, (2) = 2}), (11, 3) = Vector(2, {(1) = -1, (2) = -1}), (12, 1) = Vector(2, {(1) = 5, (2) = 5}), (12, 2) = Vector(2, {(1) = -2, (2) = 1}), (12, 3) = Vector(2, {(1) = -1, (2) = -1}), (13, 1) = Vector(2, {(1) = 3, (2) = 6}), (13, 2) = Vector(2, {(1) = -3, (2) = 0}), (13, 3) = Vector(2, {(1) = -1, (2) = -1}), (14, 1) = Vector(2, {(1) = 0, (2) = 6}), (14, 2) = Vector(2, {(1) = -3, (2) = -1}), (14, 3) = Vector(2, {(1) = 0, (2) = -1}), (15, 1) = Vector(2, {(1) = -3, (2) = 5}), (15, 2) = Vector(2, {(1) = -2, (2) = -2}), (15, 3) = Vector(2, {(1) = 1, (2) = -1}), (16, 1) = Vector(2, {(1) = -5, (2) = 3}), (16, 2) = Vector(2, {(1) = -1, (2) = -3}), (16, 3) = Vector(2, {(1) = 1, (2) = -1}), (17, 1) = Vector(2, {(1) = -6, (2) = 0}), (17, 2) = Vector(2, {(1) = 0, (2) = -3}), (17, 3) = Vector(2, {(1) = 1, (2) = 0}), (18, 1) = Vector(2, {(1) = -6, (2) = -3}), (18, 2) = Vector(2, {(1) = 1, (2) = -2}), (18, 3) = Vector(2, {(1) = 1, (2) = 1}), (19, 1) = Vector(2, {(1) = -5, (2) = -5}), (19, 2) = Vector(2, {(1) = 2, (2) = -1}), (19, 3) = Vector(2, {(1) = 1, (2) = 1}), (20, 1) = Vector(2, {(1) = -3, (2) = -6}), (20, 2) = Vector(2, {(1) = 3, (2) = 0}), (20, 3) = Vector(2, {(1) = 1, (2) = 1}), (21, 1) = Vector(2, {(1) = 0, (2) = -6}), (21, 2) = Vector(2, {(1) = 3, (2) = 1}), (21, 3) = Vector(2, {(1) = 0, (2) = 1}), (22, 1) = Vector(2, {(1) = 3, (2) = -5}), (22, 2) = Vector(2, {(1) = 2, (2) = 2}), (22, 3) = Vector(2, {(1) = -1, (2) = 1}), (23, 1) = Vector(2, {(1) = 5, (2) = -3}), (23, 2) = Vector(2, {(1) = 1, (2) = 3}), (23, 3) = Vector(2, {(1) = -1, (2) = 1}), (24, 1) = Vector(2, {(1) = 6, (2) = 0}), (24, 2) = Vector(2, {(1) = 0, (2) = 3}), (24, 3) = Vector(2, {(1) = -1, (2) = 0}), (25, 1) = Vector(2, {(1) = 6, (2) = 3}), (25, 2) = Vector(2, {(1) = -1, (2) = 2}), (25, 3) = Vector(2, {(1) = -1, (2) = -1}), (26, 1) = Vector(2, {(1) = 5, (2) = 5}), (26, 2) = Vector(2, {(1) = -2, (2) = 1}), (26, 3) = Vector(2, {(1) = -1, (2) = -1}), (27, 1) = Vector(2, {(1) = 3, (2) = 6}), (27, 2) = Vector(2, {(1) = -3, (2) = 0}), (27, 3) = Vector(2, {(1) = -1, (2) = -1}), (28, 1) = Vector(2, {(1) = 0, (2) = 6}), (28, 2) = Vector(2, {(1) = -3, (2) = -1}), (28, 3) = Vector(2, {(1) = 0, (2) = -1}), (29, 1) = Vector(2, {(1) = -3, (2) = 5}), (29, 2) = Vector(2, {(1) = -2, (2) = -2}), (29, 3) = Vector(2, {(1) = 1, (2) = -1}), (30, 1) = Vector(2, {(1) = -5, (2) = 3}), (30, 2) = Vector(2, {(1) = -1, (2) = -3}), (30, 3) = Vector(2, {(1) = 1, (2) = -1}), (31, 1) = Vector(2, {(1) = -6, (2) = 0}), (31, 2) = Vector(2, {(1) = 0, (2) = -3}), (31, 3) = Vector(2, {(1) = 1, (2) = 0}), (32, 1) = Vector(2, {(1) = -6, (2) = -3}), (32, 2) = Vector(2, {(1) = 1, (2) = -2}), (32, 3) = Vector(2, {(1) = 1, (2) = 1}), (33, 1) = Vector(2, {(1) = -5, (2) = -5}), (33, 2) = Vector(2, {(1) = 2, (2) = -1}), (33, 3) = Vector(2, {(1) = 1, (2) = 1}), (34, 1) = Vector(2, {(1) = -3, (2) = -6}), (34, 2) = Vector(2, {(1) = 3, (2) = 0}), (34, 3) = Vector(2, {(1) = 1, (2) = 1}), (35, 1) = Vector(2, {(1) = 0, (2) = -6}), (35, 2) = Vector(2, {(1) = 3, (2) = 1}), (35, 3) = Vector(2, {(1) = 0, (2) = 1}), (36, 1) = Vector(2, {(1) = 3, (2) = -5}), (36, 2) = Vector(2, {(1) = 2, (2) = 2}), (36, 3) = Vector(2, {(1) = -1, (2) = 1}), (37, 1) = Vector(2, {(1) = 5, (2) = -3}), (37, 2) = Vector(2, {(1) = 1, (2) = 3}), (37, 3) = Vector(2, {(1) = -1, (2) = 1}), (38, 1) = Vector(2, {(1) = 6, (2) = 0}), (38, 2) = Vector(2, {(1) = 0, (2) = 3}), (38, 3) = Vector(2, {(1) = -1, (2) = 0}), (39, 1) = Vector(2, {(1) = 6, (2) = 3}), (39, 2) = Vector(2, {(1) = -1, (2) = 2}), (39, 3) = Vector(2, {(1) = -1, (2) = -1}), (40, 1) = Vector(2, {(1) = 5, (2) = 5}), (40, 2) = Vector(2, {(1) = -2, (2) = 1}), (40, 3) = Vector(2, {(1) = -1, (2) = -1}), (41, 1) = Vector(2, {(1) = 3, (2) = 6}), (41, 2) = Vector(2, {(1) = -3, (2) = 0}), (41, 3) = Vector(2, {(1) = -1, (2) = -1}), (42, 1) = Vector(2, {(1) = 0, (2) = 6}), (42, 2) = Vector(2, {(1) = -3, (2) = -1}), (42, 3) = Vector(2, {(1) = 0, (2) = -1}), (43, 1) = Vector(2, {(1) = -3, (2) = 5}), (43, 2) = Vector(2, {(1) = -2, (2) = -2}), (43, 3) = Vector(2, {(1) = 1, (2) = -1}), (44, 1) = Vector(2, {(1) = -5, (2) = 3}), (44, 2) = Vector(2, {(1) = -1, (2) = -3}), (44, 3) = Vector(2, {(1) = 1, (2) = -1}), (45, 1) = Vector(2, {(1) = -6, (2) = 0}), (45, 2) = Vector(2, {(1) = 0, (2) = -3}), (45, 3) = Vector(2, {(1) = 1, (2) = 0}), (46, 1) = Vector(2, {(1) = -6, (2) = -3}), (46, 2) = Vector(2, {(1) = 1, (2) = -2}), (46, 3) = Vector(2, {(1) = 1, (2) = 1}), (47, 1) = Vector(2, {(1) = -5, (2) = -5}), (47, 2) = Vector(2, {(1) = 2, (2) = -1}), (47, 3) = Vector(2, {(1) = 1, (2) = 1}), (48, 1) = Vector(2, {(1) = -3, (2) = -6}), (48, 2) = Vector(2, {(1) = 3, (2) = 0}), (48, 3) = Vector(2, {(1) = 1, (2) = 1}), (49, 1) = Vector(2, {(1) = 0, (2) = -6}), (49, 2) = Vector(2, {(1) = 3, (2) = 1}), (49, 3) = Vector(2, {(1) = 0, (2) = 1}), (50, 1) = Vector(2, {(1) = 3, (2) = -5}), (50, 2) = Vector(2, {(1) = 2, (2) = 2}), (50, 3) = Vector(2, {(1) = -1, (2) = 1}), (51, 1) = Vector(2, {(1) = 5, (2) = -3}), (51, 2) = Vector(2, {(1) = 1, (2) = 3}), (51, 3) = Vector(2, {(1) = -1, (2) = 1}), (52, 1) = Vector(2, {(1) = 6, (2) = 0}), (52, 2) = Vector(2, {(1) = 0, (2) = 3}), (52, 3) = Vector(2, {(1) = -1, (2) = 0}), (53, 1) = Vector(2, {(1) = 6, (2) = 3}), (53, 2) = Vector(2, {(1) = -1, (2) = 2}), (53, 3) = Vector(2, {(1) = -1, (2) = -1}), (54, 1) = Vector(2, {(1) = 5, (2) = 5}), (54, 2) = Vector(2, {(1) = -2, (2) = 1}), (54, 3) = Vector(2, {(1) = -1, (2) = -1}), (55, 1) = Vector(2, {(1) = 3, (2) = 6}), (55, 2) = Vector(2, {(1) = -3, (2) = 0}), (55, 3) = Vector(2, {(1) = -1, (2) = -1}), (56, 1) = Vector(2, {(1) = 0, (2) = 6}), (56, 2) = Vector(2, {(1) = -3, (2) = -1}), (56, 3) = Vector(2, {(1) = 0, (2) = -1}), (57, 1) = Vector(2, {(1) = -3, (2) = 5}), (57, 2) = Vector(2, {(1) = -2, (2) = -2}), (57, 3) = Vector(2, {(1) = 1, (2) = -1}), (58, 1) = Vector(2, {(1) = -5, (2) = 3}), (58, 2) = Vector(2, {(1) = -1, (2) = -3}), (58, 3) = Vector(2, {(1) = 1, (2) = -1}), (59, 1) = Vector(2, {(1) = -6, (2) = 0}), (59, 2) = Vector(2, {(1) = 0, (2) = -3}), (59, 3) = Vector(2, {(1) = 1, (2) = 0}), (60, 1) = Vector(2, {(1) = -6, (2) = -3}), (60, 2) = Vector(2, {(1) = 1, (2) = -2}), (60, 3) = Vector(2, {(1) = 1, (2) = 1})})

(1)

M[1, 1]; for i from 2 while M[i, 1] <> M[1, 1] and i < 25 do print(i, M[i, 1]) end do

24, Vector[column](%id = 18446745366646139710)

(2)

``


 

Download Test_While_do_loop.mw

I'm currently wondering about the cut I'm looking for in the following worksheet.

I evaluate it in 2 ways but get different answers. Any idea what the problem here is?

Thanks


 

restart; dIs := sqrt(Pi/(I*s))*exp(I*s*t-I*s*omega0^2); Is1 := `assuming`([simplify(int(dIs, s))], [s > 0]); dIs := `assuming`([int(exp(-I*(omega^2+omega0^2-t)*s), omega = -infinity .. infinity)], [s > 0]); Is2 := int(%, s); plot3d(Im(eval(Is1, [t = x+I*y, s = 1, omega0 = 1])), x = -3 .. 3, y = -3 .. 3)

(-I*Pi/s)^(1/2)*exp(I*s*t-I*s*omega0^2)

 

(1/2-(1/2)*I)*Pi*2^(1/2)*erf(s^(1/2)*(I*(omega0^2-t))^(1/2))/(I*(omega0^2-t))^(1/2)

 

exp(I*s*t-I*s*omega0^2)*Pi^(1/2)/(I*s)^(1/2)

 

-I*Pi*erf((omega0^2-t)^(1/2)*(I*s)^(1/2))/(omega0^2-t)^(1/2)

 

 

``


 

Download CutErrorFunction.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, spacecurve, 

  sparsematrixplot, surfdata, textplot, textplot3d, tubeplot]


fixedparameter1 := [n = .3, W[e] = .3, M = .2, gamma = 1, delta = -1, N[r] = .8, Pr = .72, Nb = .5, Nt = .5, Bi = 2, Pr = .72, Le = 5];
[n = 0.3, W[e] = 0.3, M = 0.2, gamma = 1, delta = -1, N[r] = 0.8, 

  Pr = 0.72, Nb = 0.5, Nt = 0.5, Bi = 2, Pr = 0.72, Le = 5]


eq1 := (1-n)*(diff(f(eta), eta, eta, eta))+f(eta)*(diff(f(eta), eta, eta))-M*(diff(f(eta), eta))+n*W[e]*(diff(f(eta), eta, eta, eta))*(diff(f(eta), eta, eta)) = 0;
        /  d   /  d   /  d         \\\
(1 - n) |----- |----- |----- f(eta)|||
        \ deta \ deta \ deta       ///

            /  d   /  d         \\     /  d         \
   + f(eta) |----- |----- f(eta)|| - M |----- f(eta)|
            \ deta \ deta       //     \ deta       /

            /  d   /  d   /  d         \\\ /  d   /  d         \\   
   + n W[e] |----- |----- |----- f(eta)||| |----- |----- f(eta)|| = 
            \ deta \ deta \ deta       /// \ deta \ deta       //   

  0
deq1; eval(eq1, fixedparameter1);
    /  d   /  d   /  d         \\\
0.7 |----- |----- |----- f(eta)|||
    \ deta \ deta \ deta       ///

            /  d   /  d         \\       /  d         \
   + f(eta) |----- |----- f(eta)|| - 0.2 |----- f(eta)|
            \ deta \ deta       //       \ deta       /

          /  d   /  d   /  d         \\\ /  d   /  d         \\   
   + 0.09 |----- |----- |----- f(eta)||| |----- |----- f(eta)|| = 
          \ deta \ deta \ deta       /// \ deta \ deta       //   

  0
eq2 := (1+(4/3)*N[r])*(diff(theta(eta), eta, eta))+Pr*f(eta)*(diff(theta(eta), eta))+Nb*(diff(phi(eta), eta))*(diff(theta(eta), eta))+Nt*(diff(theta(eta), eta))*(diff(theta(eta), eta)) = 0;
          /    4     \ /  d   /  d             \\
          |1 + - N[r]| |----- |----- theta(eta)||
          \    3     / \ deta \ deta           //

                         /  d             \
             + Pr f(eta) |----- theta(eta)|
                         \ deta           /

                  /  d           \ /  d             \
             + Nb |----- phi(eta)| |----- theta(eta)|
                  \ deta         / \ deta           /

                                    2    
                  /  d             \     
             + Nt |----- theta(eta)|  = 0
                  \ deta           /     
deq2; eval(eq2, fixedparameter1);
                      /  d   /  d             \\
          2.066666667 |----- |----- theta(eta)||
                      \ deta \ deta           //

                           /  d             \
             + 0.72 f(eta) |----- theta(eta)|
                           \ deta           /

                   /  d           \ /  d             \
             + 0.5 |----- phi(eta)| |----- theta(eta)|
                   \ deta         / \ deta           /

                                     2    
                   /  d             \     
             + 0.5 |----- theta(eta)|  = 0
                   \ deta           /     
eq3 := diff(phi(eta), eta, eta)+Pr*Le*f(eta)*(diff(phi(eta), eta))+Nt*(diff(theta(eta), eta, eta))/Nb = 0;
    /  d   /  d           \\                /  d           \
    |----- |----- phi(eta)|| + Pr Le f(eta) |----- phi(eta)|
    \ deta \ deta         //                \ deta         /

            /  d   /  d             \\    
         Nt |----- |----- theta(eta)||    
            \ deta \ deta           //    
       + ----------------------------- = 0
                      Nb                  
deq3 := eval(eq3, fixedparameter1);
    /  d   /  d           \\               /  d           \
    |----- |----- phi(eta)|| + 3.60 f(eta) |----- phi(eta)|
    \ deta \ deta         //               \ deta         /

                     /  d   /  d             \\    
       + 1.000000000 |----- |----- theta(eta)|| = 0
                     \ deta \ deta           //    
bcs1 := f(0) = 0, D(f)(0) = 1+gamma*(D@D)(F)(0)+delta*(D@D@D)(f)(0), D(f)(8) = 0;
 f(0) = 0, 

   D(f)(0) = 1 + gamma @@(D, 2)(F)(0) + delta @@(D, 3)(f)(0), 

   D(f)(8) = 0
bc1 := eval(bcs1, fixedparameter1);
   f(0) = 0, D(f)(0) = 1 + @@(D, 2)(F)(0) - @@(D, 3)(f)(0), 

     D(f)(8) = 0
bcs2 := D(theta)(0) = Bi*(theta(0)-1), theta(8) = 0;
         D(theta)(0) = Bi (theta(0) - 1), theta(8) = 0
bc2 := eval(bcs2, fixedparameter1);
           D(theta)(0) = 2 theta(0) - 2, theta(8) = 0
bcs3 := Nb*D(phi)(0)+Nt*D(theta)(0) = 0, Nb*D(phi)(0)+Nt*D(theta)(0) = 0, phi(8) = 0;
        Nb D(phi)(0) + Nt D(theta)(0) = 0, 

          Nb D(phi)(0) + Nt D(theta)(0) = 0, phi(8) = 0
bc3 := eval(bcs3, fixedparameter1);
       0.5 D(phi)(0) + 0.5 D(theta)(0) = 0, 

         0.5 D(phi)(0) + 0.5 D(theta)(0) = 0, phi(8) = 0
R := dsolve({bc1, bc2, bc3, deq1, deq2, deq3}, [f(eta), theta(eta), phi(eta)], numeric, output = listprocedure);
Error, (in dsolve/numeric/process_input) system must be entered as a set/list of expressions/equations


 

Hello! I am trying to make an if statement that is IF a bound is not equal to NULL, it does things, and if it IS equal to NULL, the bounds are set to zero. When a bound is null, they say 

bound1:=()

My first if statement will not work, please help!

 

bound1:=solve(tau(x)=(Intv||j)[1],x,useassumptions) assuming (Intv||i)[1]<=x<=(Intv||i)[2] ;  

bound2:=solve(tau(x)=(Intv||j)[2],x,useassumptions) assuming (Intv||i)[1]<=x<=(Intv||i)[2];

if bound1<>NULL;bound2<>NULL;  then

if bound1<=bound2   then  

lower:=bound1;  upper:=bound2  

else lower:=bound2;   upper:=bound1 end if;

else lower:=0; upper:=0 end if;

Let be given tetrahedron ABCD, where AB = BC = AC = a, AD = d, AD = e, CD = f. I know that, If the measure of angle of AB and CD equal to Pi/3, then we have d^2 - e^2 - a*f = 0. I tried:
ListTools[Categorize];
L := []; 
for a to 30 do for d to 30 do
for e to 30 do for f to 30 do
if abs(d-e) < a and a < d+e and abs(a-e) < d and d < a+e and abs(d-a) < e and e < d+a and abs(d-f) < a and a < d+f and abs(a-f) < d and d < a+f and abs(d-a) < f and f < d+a and abs(e-f) < a and a < e+f and abs(a-f) < e and e < a+f and abs(a-e) < a and a < a+e and -a*f+d^2-e^2 = 0 and igcd(a, d, e, f) = 1 and nops({a, d, e, f}) = 4
then L := [op(L), [a, d, e, f]] end if end do end do end do end do; 
nops(L); 
L;


Another way to find the length of edges of a tetrahedron knowing that the mesure angle of two opposite?


 

For Maple 2018.1, there are improvements in pdsolve's ability to solve PDE with boundary and initial conditions. This is work done together with E.S. Cheb-Terrab. The improvements include an extended ability to solve problems involving non-homogeneous PDE and/or non-homogeneous boundary and initial conditions, as well as improved simplification of solutions and better handling of functions such as piecewise in the arguments and in the processing of solutions. This is also an ongoing project, with updates being distributed regularly within the Physics Updates.

Solving more problems involving non-homogeneous PDE and/or non-homogeneous boundary and initial conditions

 

 

Example 1: Pinchover and Rubinstein's exercise 6.17: we have a non-homogenous PDE and boundary and initial conditions that are also non-homogeneous:

pde__1 := diff(u(x, t), t)-(diff(u(x, t), x, x)) = 1+x*cos(t)
iv__1 := (D[1](u))(0, t) = sin(t), (D[1](u))(1, t) = sin(t), u(x, 0) = 1+cos(2*Pi*x)

pdsolve([pde__1, iv__1])

u(x, t) = 1+cos(2*Pi*x)*exp(-4*Pi^2*t)+t+x*sin(t)

(1)

How we solve the problem, step by step:

   

 

Example 2: the PDE is homogeneous but the boundary conditions are not. We solve the problem through the same process, which means we end up solving a nonhomogeneous pde with homogeneous BC as an intermediate step:

pde__2 := diff(u(x, t), t) = 13*(diff(u(x, t), x, x))
iv__2 := (D[1](u))(0, t) = 0, (D[1](u))(1, t) = 1, u(x, 0) = (1/2)*x^2+x

pdsolve([pde__2, iv__2])

u(x, t) = 1/2+Sum(2*(-1+(-1)^n)*cos(n*Pi*x)*exp(-13*Pi^2*n^2*t)/(Pi^2*n^2), n = 1 .. infinity)+13*t+(1/2)*x^2

(12)

How we solve the problem, step by step:

   

 

Example 3: a wave PDE with a source that does not depend on time:

pde__3 := (diff(u(x, t), x, x))*a^2+1 = diff(u(x, t), t, t)
iv__3 := u(0, t) = 0, u(L, t) = 0, u(x, 0) = f(x), (D[2](u))(x, 0) = g(x)

`assuming`([pdsolve([pde__3, iv__3])], [L > 0])

u(x, t) = (1/2)*(2*(Sum(sin(n*Pi*x/L)*(2*L*sin(a*Pi*t*n/L)*(Int(sin(n*Pi*x/L)*g(x), x = 0 .. L))*a-Pi*cos(a*Pi*t*n/L)*(Int(sin(n*Pi*x/L)*(-2*f(x)*a^2+L*x-x^2), x = 0 .. L))*n)/(Pi*n*a^2*L), n = 1 .. infinity))*a^2+L*x-x^2)/a^2

(23)

How we solve the problem, step by step:

   

 

Example 4: Pinchover and Rubinstein's exercise 6.23 - we have a non-homogenous PDE and initial condition:

pde__4 := diff(u(x, t), t)-(diff(u(x, t), x, x)) = g(x, t)
iv__4 := (D[1](u))(0, t) = 0, (D[1](u))(1, t) = 0, u(x, 0) = f(x)

pdsolve([pde__4, iv__4], u(x, t))

u(x, t) = Int(f(tau1), tau1 = 0 .. 1)+Sum(2*(Int(f(tau1)*cos(n*Pi*tau1), tau1 = 0 .. 1))*cos(n*Pi*x)*exp(-Pi^2*n^2*t), n = 1 .. infinity)+Int(Int(g(x, tau1), x = 0 .. 1)+Sum(2*(Int(g(x, tau1)*cos(n1*Pi*x), x = 0 .. 1))*cos(n1*Pi*x)*exp(-Pi^2*n1^2*(t-tau1)), n1 = 1 .. infinity), tau1 = 0 .. t)

(30)

If we now make the functions f and g into specific mappings, we can compare pdsolve's solutions to the general and specific problems:

f := proc (x) options operator, arrow; 3*cos(42*x*Pi) end proc
g := proc (x, t) options operator, arrow; exp(3*t)*cos(17*x*Pi) end proc

 

Here is what pdsolve's solution to the general problem looks like when taking into account the new values of f(x) and g(x,t):

value(simplify(evalindets(u(x, t) = Int(f(tau1), tau1 = 0 .. 1)+Sum(2*(Int(f(tau1)*cos(n*Pi*tau1), tau1 = 0 .. 1))*cos(n*Pi*x)*exp(-Pi^2*n^2*t), n = 1 .. infinity)+Int(Int(g(x, tau1), x = 0 .. 1)+Sum(2*(Int(g(x, tau1)*cos(n1*Pi*x), x = 0 .. 1))*cos(n1*Pi*x)*exp(-Pi^2*n1^2*(t-tau1)), n1 = 1 .. infinity), tau1 = 0 .. t), specfunc(Int), proc (u) options operator, arrow; `PDEtools/int`(op(u), AllSolutions) end proc)))

u(x, t) = 3*cos(42*Pi*x)*exp(-1764*Pi^2*t)+cos(Pi*x)*(65536*cos(Pi*x)^16-278528*cos(Pi*x)^14+487424*cos(Pi*x)^12-452608*cos(Pi*x)^10+239360*cos(Pi*x)^8-71808*cos(Pi*x)^6+11424*cos(Pi*x)^4-816*cos(Pi*x)^2+17)*(exp(289*Pi^2*t+3*t)-1)*exp(-289*Pi^2*t)/(289*Pi^2+3)

(31)

 

Here is pdsolve's solution to the specific problem:

pdsolve([pde__4, iv__4], u(x, t))

u(x, t) = ((-65536*cos(Pi*x)^17+278528*cos(Pi*x)^15-487424*cos(Pi*x)^13+452608*cos(Pi*x)^11-239360*cos(Pi*x)^9+71808*cos(Pi*x)^7-11424*cos(Pi*x)^5+816*cos(Pi*x)^3-17*cos(Pi*x))*exp(-289*Pi^2*t)+(867*Pi^2+9)*cos(42*Pi*x)*exp(-1764*Pi^2*t)+65536*exp(3*t)*(cos(Pi*x)^16-(17/4)*cos(Pi*x)^14+(119/16)*cos(Pi*x)^12-(221/32)*cos(Pi*x)^10+(935/256)*cos(Pi*x)^8-(561/512)*cos(Pi*x)^6+(357/2048)*cos(Pi*x)^4-(51/4096)*cos(Pi*x)^2+17/65536)*cos(Pi*x))/(289*Pi^2+3)

(32)

 

And the two solutions are equal:

simplify((u(x, t) = 3*cos(42*x*Pi)*exp(-1764*Pi^2*t)+cos(x*Pi)*(65536*cos(x*Pi)^16-278528*cos(x*Pi)^14+487424*cos(x*Pi)^12-452608*cos(x*Pi)^10+239360*cos(x*Pi)^8-71808*cos(x*Pi)^6+11424*cos(x*Pi)^4-816*cos(x*Pi)^2+17)*(exp(289*Pi^2*t+3*t)-1)*exp(-289*Pi^2*t)/(289*Pi^2+3))-(u(x, t) = ((-65536*cos(x*Pi)^17+278528*cos(x*Pi)^15-487424*cos(x*Pi)^13+452608*cos(x*Pi)^11-239360*cos(x*Pi)^9+71808*cos(x*Pi)^7-11424*cos(x*Pi)^5+816*cos(x*Pi)^3-17*cos(x*Pi))*exp(-289*Pi^2*t)+(867*Pi^2+9)*cos(42*x*Pi)*exp(-1764*Pi^2*t)+65536*exp(3*t)*(cos(x*Pi)^16-(17/4)*cos(x*Pi)^14+(119/16)*cos(x*Pi)^12-(221/32)*cos(x*Pi)^10+(935/256)*cos(x*Pi)^8-(561/512)*cos(x*Pi)^6+(357/2048)*cos(x*Pi)^4-(51/4096)*cos(x*Pi)^2+17/65536)*cos(x*Pi))/(289*Pi^2+3)))

0 = 0

(33)

f := 'f'; g := 'g'

 

Improved simplification in integrals, piecewise functions, and sums in the solutions returned by pdsolve

 

 

Example 1: exercise 6.21 from Pinchover and Rubinstein is a non-homogeneous heat problem. Its solution used to include unevaluated integrals and sums, but is now returned in a significantly simpler format.

pde__5 := diff(u(x, t), t)-(diff(u(x, t), x, x)) = t*cos(2001*x)
iv__5 := (D[1](u))(0, t) = 0, (D[1](u))(Pi, t) = 0, u(x, 0) = Pi*cos(2*x)

pdsolve([pde__5, iv__5])

u(x, t) = (1/16032024008001)*(4004001*t+exp(-4004001*t)-1)*cos(2001*x)+Pi*cos(2*x)*exp(-4*t)

(34)

pdetest(%, [pde__5, iv__5])

[0, 0, 0, 0]

(35)

 

Example 2: example 6.46 from Pinchover and Rubinstein is a non-homogeneous heat equation with non-homogeneous boundary and initial conditions. Its solution used to involve two separate sums with unevaluated integrals, but is now returned with only one sum and unevaluated integral.

pde__6 := diff(u(x, t), t)-(diff(u(x, t), x, x)) = exp(-t)*sin(3*x)
iv__6 := u(0, t) = 0, u(Pi, t) = 1, u(x, 0) = phi(x)

pdsolve([pde__6, iv__6], u(x, t))

u(x, t) = (1/8)*(8*(Sum(2*(Int(-(-phi(x)*Pi+x)*sin(n*x), x = 0 .. Pi))*sin(n*x)*exp(-n^2*t)/Pi^2, n = 1 .. infinity))*Pi-Pi*(exp(-9*t)-exp(-t))*sin(3*x)+8*x)/Pi

(36)

pdetest(%, [pde__6, iv__6])

[0, 0, 0, (-phi(x)*Pi^2+Pi*x+2*(Sum((Int(-(-phi(x)*Pi+x)*sin(n*x), x = 0 .. Pi))*sin(n*x), n = 1 .. infinity)))/Pi^2]

(37)

 

More accuracy when returning series solutions that have exceptions for certain values of the summation index or a parameter

 

 

Example 1: the answer to this problem was previously given with n = 0 .. infinity instead of n = 1 .. infinity as it should be:

pde__7 := diff(v(x, t), t, t)-(diff(v(x, t), x, x))

iv__7 := v(0, t) = 0, v(x, 0) = -(exp(2)*x-exp(x+1)-x+exp(1-x))/(exp(2)-1), (D[2](v))(x, 0) = 1+(exp(2)*x-exp(x+1)-x+exp(1-x))/(exp(2)-1), v(1, t) = 0

pdsolve([pde__7, iv__7])

v(x, t) = Sum(-2*sin(n*Pi*x)*((Pi^2*(-1)^n*n^2-Pi^2*n^2+2*(-1)^n-1)*sin(Pi*t*n)-(-1)^n*cos(Pi*t*n)*Pi*n)/(Pi^2*n^2*(Pi^2*n^2+1)), n = 1 .. infinity)

(38)

 

Example 2: the answer to exercise 6.25 from Pinchover and Rubinstein is now given in a much simpler format, with the special limit case for w = 0 calculated separately:

pde__8 := diff(u(x, t), t) = k*(diff(u(x, t), x, x))+cos(w*t)
iv__8 := (D[1](u))(L, t) = 0, (D[1](u))(0, t) = 0, u(x, 0) = x

`assuming`([pdsolve([pde__8, iv__8], u(x, t))], [L > 0])

u(x, t) = piecewise(w = 0, (1/2)*L+Sum(2*L*(-1+(-1)^n)*cos(n*Pi*x/L)*exp(-k*Pi^2*n^2*t/L^2)/(n^2*Pi^2), n = 1 .. infinity)+t, (1/2)*(L*w+2*(Sum(2*L*(-1+(-1)^n)*cos(n*Pi*x/L)*exp(-k*Pi^2*n^2*t/L^2)/(n^2*Pi^2), n = 1 .. infinity))*w+2*sin(w*t))/w)

(39)

 

Improved handling of piecewise, eval/diff in the given problem

 

 

Example 1: this problem, which contains a piecewise function in the initial condition, can now be solved:

pde__9 := diff(f(t, x), t) = diff(f(t, x), x, x)
iv__9 := f(t, 0) = 0, f(t, 1) = 1, f(0, x) = piecewise(x = 0, 1, 0)

pdsolve([pde__9, iv__9])

f(t, x) = Sum(2*(-1)^n*sin(n*Pi*x)*exp(-Pi^2*n^2*t)/(n*Pi), n = 1 .. infinity)+x

(40)

 

Example 2: this problem, which contains a derivative written using eval/diff, can now be solved:

pde__10 := -(diff(u(x, t), t, t))-(diff(u(x, t), x, x))+u(x, t) = 2*exp(-t)*(x-(1/2)*x^2+(1/2)*t-1)

iv__10 := u(x, 0) = x^2-2*x, u(x, 1) = u(x, 1/2)+((1/2)*x^2-x)*exp(-1)-((3/4)*x^2-(3/2)*x)*exp(-1/2), u(0, t) = 0, eval(diff(u(x, t), x), {x = 1}) = 0

pdsolve([pde__10, iv__10], u(x, t))

u(x, t) = -(1/2)*exp(-t)*x*(x-2)*(t-2)

(41)

 

References:

 

Pinchover, Y. and Rubinstein, J.. An Introduction to Partial Differential Equations. Cambridge UP, 2005.


 

Download What_is_New_after_Maple_2018.mw

Katherina von Bülow

1 2 3 4 5 6 7 Last Page 1 of 1424