Maple 2015 Questions and Posts

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

كيفية حل مشكلة فوات (إنفينتي)

Hello dear!

Hope everyone is fine. I want to solve the system of algebraic equations. The answer of c[i]'s should be in term of q. Please see the attachment and fix the problem for any value of M. I am waiting your positive response. Thanks in advance. 

Help.mw

fgh := proc (x) options operator, arrow; [x, x^2, x^3] end proc;

sol := proc (x) options operator, arrow; min(`~`[Re](select(proc (t) options operator, arrow; is(abs(Im(t)) < 0.1e-19) and is(0 < Re(t)) end proc, fgh(x)))) end proc;

eval('sol(x)', [x = X]);

eval(%, X = 1)

 

Why does this not work?

Is there a way to determine the coordinates of all the vertices of a cuboid using geom3d?

See WC06_Vertices_of_a_Cuboid.mwWC06_Vertices_of_a_Cuboid.mw attached.

The graphic of the cuboid is created with

A:=(cuboid([1,1,2],[3,4,5]), orientation [27,78],lightmodel = light4, shading = none, transparency =.85,scaling = constrained, axesfont = [bold, roman, 18], axes = normal):

And the vertices are self-evident, for example 

B:= pointplot3d({[3,1,5]}, symbol = solidsphere, symbolsize = 18, color = red):

One geom3d ....

geom3d[point](P,1,1,2): geom3d[point(Q,3,4,5): geom3d[distance](P,Q); 

gives the lengths of the diagonal of the box.  Is there a way to get geom3d to list the coordinates of the 8 vertices of a cubeoid?

Does anyone know if there exist a script in JAWS for MapleSoft?

I have a polynomial of 4th order and I wanted to use allvalues on the RootOf expression. It then says:
 

Error, (in evala/Normal/preproc) reducible RootOf detected.  Substitutions are {RootOf(4678560000000000000000000000000000000000+(16573041*CO^2+70122975000000000000*CO-623180900000000000000000000000000)*_Z^4+(-19887649200*CO^2-82987335000000000000000*CO+745755960000000000000000000000000000)*_Z^3+(5966294760000*CO^2+23851989000000000000000000*CO-221858784000000000000000000000000000000)*_Z^2+(417684600000000000000000000*CO-757598400000000000000000000000000000000)*_Z) = 600, RootOf(4678560000000000000000000000000000000000+(16573041*CO^2+70122975000000000000*CO-623180900000000000000000000000000)*_Z^4+(-19887649200*CO^2-82987335000000000000000*CO+...
Error, (in allvalues) numeric exception: division by zero

So apparently the expression is reducible but how do I do that?

I am trying to numerically solve y'=f(x,y) with y(0)=y0, where f is a solution to a PDE. In this case, f is a numeric approximation itself. I attempted to add this equation to the system of equations when finding f, but pdsolve will not accept an equation of this form. Then, in attempting to use f in dsolve, I get an error, stating that the input system must be an ODE system, found {y(x),f(x,y(x))}. 

 

Is there any way to use dsolve or pdsolve to generate y(x)? Or will I have to stick with using more classical methods like RK4?

 I have in my Maple documents many good quality plots resulting from simulations. I need to export (or paste) them to templates of transactions in Word without loosing quality, and beeing flexible to some degree to fit the dimension.

Until now when I paste such plots the quality is lost and especially on descripltion on axes (vertical).

What I have to do? Do I need to go throuhg pdf format ? 

Hi everybody,

I use the Grid[Launch] function  (Windows 7, Maple 2015) to distribute many similar computations over all the processors my machine has.
 

Question 1

My machine is a 4 processors one (not hyperthreaded).
When it was equiped with Windows XP and I was using, let's say 2 proc., the performance manager showed that two processors among 4 were charged up to 95%-100% while the others remained around 0 %.
In this case (my problem is perfecly scalable), the elapsed time was exactly half it was when I used only one proc (and twice as large as the time obtained with 4 proc).


Now I'm working with Windows 7.
This behaviour puzzles me : if I use 2 procs among four and look to the performance manager, all the 4 procs are partially charged. It looks like Window 7 was distributing itself the computations ?
As a result (?), running on 4 proc no longer takes 25% of the elapsed time on 1 proc, but "only" 40%.
Could it be that some inner "dispatching task within processors" Windows 7 could have, might interfere with the distribution of tasks  Grid[Launch] does ?

Does anyone of you already had a same experience ?
If Windows 7 really has some "task managing procces", is it possible to switch it off ?


 

Question 2

Same context as previously.
I run the same code (search of a local maximum of a function where some of its parameters are randomly valued ; the sample of these parameters hase size 10000) over 4 proc.
On order to save intermediate results I wrote a loop within it I send blocks of 500 computations at the same time over the 4 proc.
This loop is executed 5 times (5*500*4 = 10000)

I observe that after each step of the loop the memory used is increased by a rather constant amount. It looks like if a 4 proc computation of 500 optimizations was costing N Mega Bytes, and that the memory was increased by N MB each times the loop is executed.
At the very end the computational time can dramatically slow down because of the amount of the memory used.

More precisely my pseudo code looks like this :
for step 1 to 5 do 
   Grid[Launch](MyCode, numnodes=4, imports=[BlockOf2000data], ...):  
   
# MyCode uses only one quarter of this 2000 data block depending on the processor number it runs on
end do:

Does it exist a way to clean the memory just before the "end do" command in order to avoid it to grow continuously ?


Any contribution will be highly appreciated.

Often after using collect(expression,x) the prefactors of x are within a bracket but typically contain factors in each term of the bracket that are equal and not pulled out of the bracket. Is there a way to ask maple to automatically factor out these after collecting?

I hope it is clear what I mean...

Hello everyone,

First I want to thank you for paying attention to my post.

I'm trying to determine the maximum of the following function:

Maple Code:

(1/4)*(-1/4+alpha*(-1+b)*e^2+((1-b)*alpha+(1/4)*b)*e)^2/((-1+e)^2*(b*e-1)*alpha*e*(-1+b))(1/4)*(-1/4+alpha*(-1+b)*e^2+((1-b)*alpha+(1/4)*b)*e)^2/((-1+e)^2*(b*e-1)*alpha*e*(-1+b))

e is my variable and I want to study it in [0,1[. I have a several parameters restriction like b in [0,1[ and alpha>1.

When I value this function for specific values (b=0.1, alpha=4 for instance) I get the equation and its associated graphic representation:

Maple Code:

-0.6944444445e-1*(-1/4-3.6*e^2+3.625000000*e)^2/((-1+e)^2*(.1*e-1)*e)

 

 

I'm only interested in the domain where e is betweeen 0 and 1. I clearly on the graph see that there is a maximum and when 1) I compute roots of the expression I get 2) following solutions:

1)

2) 

    0.9324708634, 0.07447358108, 0.6965691592, 1.345632810, 

      -0.07419084270.

Here: 0.6965691592 corresponds to the maximum I'm looking for.

So now when I try to get a generalization of this function according to my parameters and when I compute the first derivative with respect to e

1)

 

2) 

3)...

the last is very big so I do not write it here.

To sum-up: I see that the solution I'm looking for exists but when it comes to use parameters I cannot define correct roots.

Hello dear!

Hope you all are fine. I am trying to sloution the system of nonlinear system of ODEs (see attached file) but my solutions not converging please see and fix the problem. I am waiting your quick response.

Graph.mw

Is there a possiblity to print exponents in the axis labeling?

Say I have large numbers in 10^6. Then I want to write

labels=["x","y [10^6]"]

However I only found the e-notation within

sprintf("%0.0e", 10^6)

for example, which is not really what I want though.

https://gist.github.com/hoyeunglee/b0c6b61fafd1bee988fcafef3cfe6025
https://gist.github.com/hoyeunglee/a1e0ca335be8bbc8fde301c6aded66f8

test1 = o(a(x,y),z)

test1.args[0]

python sympy can not get function name o and a

restart;
with(Groebner):

DoExist := proc(tau, n)
if rtable_num_elems(tau) >= n then
	return tau[n];
else
	return 0;
end if;
end proc;

IsZero := proc(a, b)
if a=0 then 
	return 0;
else 
	return a/b;
end if
end proc;

g1 := x^2-w*y;
g2 := x*y - w*z;
g3 := y^2 - x*z;
gro := Basis([g1,g2,g3],plex(x,y,z,w));

X1 := `*`(LeadingTerm(g1, tdeg(x, y, z, w)));
X2 := `*`(LeadingTerm(g2, tdeg(x, y, z, w)));
X3 := `*`(LeadingTerm(g3, tdeg(x, y, z, w)));
X12 := lcm(X1,X2);
X13 := lcm(X1,X3);
X23 := lcm(X2,X3);
S12 := SPolynomial(g1, g2, lexdeg([x, y, z, w]));
S23 := SPolynomial(g2, g3, lexdeg([x, y, z, w]));
S13 := SPolynomial(g1, g3, lexdeg([x, y, z, w]));
e1 := Vector([1,0,0]);
e2 := Vector([0,1,0]);
e3 := Vector([0,0,1]);
eq1:= S12 = h121*g1 + h122*g2 + h123*g3;
eq1 := S12 - expand(h121*g1 + h122*g2 + h123*g3):
NormalForm(eq1, Basis([g1, g2, g3], tdeg(x, y, z, w, h121, h122, h123)), tdeg(x, y, z, w, h121, h122, h123), 'Q');
h121 := 0;
h122 := 0;
h123 := 0;
s12 := IsZero(X12,X1)*e1-IsZero(X12,X2)*e2-Vector([DoExist(<Q>,3), DoExist(<Q>,2), DoExist(<Q>,1)]);

eq1 := S13-expand(h131*g1+h132*g2+h133*g3):
NormalForm(eq1, Basis([g1, g2, g3], tdeg(x, y, z, w, h131, h132, h133)), tdeg(x, y, z, w, h131, h132, h133), 'Q');
h131 := 0;
h132 := 0;
h133 := 0;
s13 := IsZero(X13,X1)*e1-IsZero(X13,X3)*e3-Vector([DoExist(<Q>,3), DoExist(<Q>,2), DoExist(<Q>,1)]);

eq1:= S23 - expand(h231*g1 + h232*g2 + h233*g3);
NormalForm(eq1, Basis([g1, g2, g3], tdeg(x, y, z, w, h231, h232, h233)), tdeg(x, y, z, w, h231, h232, h233), 'Q');
h231 := 0;
h232 := 0;
h233 := 0;
s23 := IsZero(X23,X2)*e2-IsZero(X23,X3)*e3-Vector([DoExist(<Q>,3), DoExist(<Q>,2), DoExist(<Q>,1)]);

with(LinearAlgebra):
#F = Syz*GrobnerBasis
F := simplify(MatrixMatrixMultiply(Matrix([[s12[1],s13[1],s23[1]],[s12[2],s13[2],s23[2]],[s12[3],s13[3],s23[3]]]), Matrix([[gro[1]],[gro[2]],[gro[3]]])));
F[1][1] - g1 = 0; 
F[2][1] - g2 = 0;
F[3][1] - g3 = 0;
F := simplify(MatrixMatrixMultiply(Matrix([[s12[1],0,s23[1]],[s12[2],0,s23[2]],[s12[3],0,s23[3]]]), Matrix([[gro[1]],[gro[2]],[gro[3]]])));
F[1][1] - g1 = 0; 
F[2][1] - g2 = 0;
F[3][1] - g3 = 0;

#F = GrobnerBasis*Syz
F := simplify(MatrixMatrixMultiply(Matrix([[gro[1],gro[2],gro[3]]]), Matrix([[s12[1],s13[1],s23[1]],[s12[2],s13[2],s23[2]],[s12[3],s13[3],s23[3]]])));
F[1][1] - g1 = 0; 
F[1][2] - g2 = 0;
F[1][3] - g3 = 0;
F := simplify(MatrixMatrixMultiply(Matrix([[gro[1],gro[2],gro[3]]]), Matrix([[s12[1],0,s23[1]],[s12[2],0,s23[2]],[s12[3],0,s23[3]]])));
F[1][1] - g1 = 0; 
F[1][2] - g2 = 0;
F[1][3] - g3 = 0;

#F = GrobnerBasis*Syz
F := simplify(MatrixMatrixMultiply(Matrix([[gro[1],gro[2],gro[3]]]), Matrix([[s12[1],s12[1],s12[1]],[s13[2],s13[2],s13[2]],[s23[3],s23[3],s23[3]]])));
F[1][1] - g1 = 0; 
F[1][2] - g2 = 0;
F[1][3] - g3 = 0;
F := simplify(MatrixMatrixMultiply(Matrix([[gro[1],gro[2],gro[3]]]), Matrix([[s12[1],0,s12[1]],[s13[2],0,s13[2]],[s23[3],0,s23[3]]])));
F[1][1] - g1 = 0; 
F[1][2] - g2 = 0;
F[1][3] - g3 = 0;

syz result is s12, s23

but after verify, F is not equal to GrobnerBasis*Syz

4 5 6 7 8 9 10 Last Page 6 of 52