Maple 2018 Questions and Posts

These are Posts and Questions associated with the product, Maple 2018

When I input the the following command line in Maple 2018.1

 > Int(1/(1+sqrt(x)),x=0..1)=int(1/(1+sqrt(x)),x=0..1);

the output is 

>Int(1/(1+sqrt(x)), x = 0 .. 1) = MeijerG([[0, 0, 1/2], []], [[1/2, 0], [-1]], 1)/Pi

which is not the desired result!  How can I get the desired result like this

>2-ln(2)

Thanks a lot.

 

in this ODE, with initial conditions, I am trying to verify my solution, but I can't figure how Maple obtained the final answer.  I can obtain same solution, but before using the initial conditions to find the constant of integrations. The problem comes in solving for the constant of integration from initial conditions. I do not know how Maple did it, becuause when I do the normal steps, I get division by zero.

restart;
ode:=diff(y(x),x)=x*ln(y(x)):
ic:=y(1)=1:
sol:=dsolve({ode,ic},y(x));

gives "sol := y(x) = 1"

Now I solve without IC, then try to find _C1 by hand

sol:=dsolve(ode,y(x));

       sol := y(x) = exp(RootOf(x^2+2*Ei(1, -_Z)+2*_C1))

Now used remove_RootOf

sol2:=DEtools:-remove_RootOf(sol);

            sol2 := x^2+2*Ei(1, -ln(y(x)))+2*_C1 = 0

Now I followed the steps I learned at school, which is to plugin y=1 and x=1 in the solution to get an equation to solve for _C1

eq := subs({y(x)=1,x=1},sol2);

            eq := 1+2*Ei(1, -ln(1))+2*_C1 = 0

But Ei(1, -ln(1)) is a division by zero. So can't solve for _C1

solve(eq,_C1);
       Error, (in Ei) numeric exception: division by zero

So how would you solve for _C1 in the above? Or how did the smart Maple do it?

I tried using limits, but that did not help.  I tried using allvalues instead of remove_RootOf, and that did not get rid of RootOf.  Next I tried not to remove RootOf and keep it there to see what happens

sol:=dsolve(ode,y(x));
eq := subs({y(x)=1,x=1},sol);
             eq := 1 = exp(RootOf(1+2*Ei(1, -_Z)+2*_C1))

c1:=solve(eq,_C1, AllSolutions);
              c1 := -1/2-Ei(1, -(2*I)*Pi*_Z1)

subs(_C1=c1,sol);
             y(x) = exp(RootOf(x^2+2*Ei(1, -_Z)-1-2*Ei(1, -(2*I)*Pi*_Z1)))

simplify(%);
            x^2+2*Ei(1, -ln(y(x)))-1-2*Ei(1, -(2*I)*Pi*_Z1) = 0

DEtools:-remove_RootOf(%);
           x^2+2*Ei(1, -ln(y(x)))-1-2*Ei(1, -(2*I)*Pi*_Z1) = 0

solve(%,y(x));
          exp(RootOf(x^2+2*Ei(1, -_Z)-1-2*Ei(1, -(2*I)*Pi*_Z1)))

So I can't figure how Maple obtained y(x)=1. Maple must have used different method to solve for _C1.

What would be the Maple commands to use to obtain y(x)=1, starting from

            sol:=dsolve(ode,y(x));

and given that y(1)=1 ?

 

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?

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

 

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


 

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*(Int(sin(n*Pi*x/L)*g(x), x = 0 .. L))*sin(a*Pi*t*n/L)*a-Pi*(Int(sin(n*Pi*x/L)*(-2*f(x)*a^2+L*x-x^2), x = 0 .. L))*cos(a*Pi*t*n/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) = ((867*Pi^2+9)*cos(42*Pi*x)*exp(-1764*Pi^2*t)+cos(17*Pi*x)*(exp(3*t)-exp(-289*Pi^2*t)))/(289*Pi^2+3)

(32)

 

And the two solutions are equal:

simplify(combine((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) = ((867*Pi^2+9)*cos(42*x*Pi)*exp(-1764*Pi^2*t)+cos(17*x*Pi)*(exp(3*t)-exp(-289*Pi^2*t)))/(289*Pi^2+3)), trig))

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(-Pi^2*n^2*k*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(-Pi^2*n^2*k*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(x, t), t) = diff(f(x, t), x, x)
iv__9 := f(0, t) = 0, f(1, t) = 1, f(x, 0) = piecewise(x = 0, 0, 1)

pdsolve([pde__9, iv__9])

f(x, t) = Sum(2*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

Hello Friends

I have a critical problem that I wish to solve it with maple

suppose we have a list like following: y_obs=(2,4,8,7,9,52,35,478,52) and corresponding variance σy=(.2,.3,.5,.87,.1.2,.22,.78,.99,1.5)
we know y as the function of x described such as y_theoric=x+p and minimizing X is

X=Sigma [(y_theoric-y_obs)^2]/σy which includes the sum of nine numbers...

the question is:

How we can find p from likelihood function and plot general behavior of y versus of x through two above series?

for example this solution used in article under the names Hubble parameter data constraints on dark energy by Yun Chen and Bhatra Ratra (Physics Letters B)

Thank you

 

I mean 

restart;
 plots:-implicitplot(sqrt(b)*sqrt(1-4*p/b)-2*arctan(sqrt((9*p/b-22201/10000)/(9/4-9*p/b))) = 0, b = 0 .. 5,
 p = 0 .. 5, gridrefine = 2, rational);

I find the above result unsatisfactory.

Hello,

     I have a very large expression I'm tring to average (by doing limit(1/L*int(<expr>,t=-L..L),L=infinty) ). However, given that this expression is so large (sum of 11k terms), I'm was looking for ways to speed up the calculation and use less RAM.

     I found that applying the lim@int seperately to each term of the sum helps. Also, since my integrand has various functions of other variables (eg. f(x), g(y), etc), Maple seems to go faster if I freeze those functions using frontend.

     However, the problem I'm running into is that, as I'm running through my for-loop to apply lim@int to each term, Maple starts running slower and slower, as well as taking more and more RAM. Additionally, it doesn't go to completion because it runs out of stack space.

     Is there an optimization trick to avoid this problem? I've tried garbage collecting after each iteration; that helps the RAM problem (at a cost of speed), but it still slows down over time.

      I've attached my code: MWE.maple. Fair warning: on a non-server computer, it is liable to run very slow.

Is it possible to convert E1(x) to Ei(x) explicitly?

In particular I have this expression which is real, but imaginary numbers appear due to the definition of Ei1 for negative arguments.

(-exp(j*z)*Ei(1, j*z)+I*Pi*exp(-j*z)+exp(-j*z)*Ei(1, -j*z))/(2*j)

 

j>0,z>0

 

Thank you

First 51 52 53 54 55 56 57 Last Page 53 of 61