Maple 17 Questions and Posts

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

We produce only one rotation of the cube by the angle Pi/2, and then repeat it at the following points, changing the colors of the faces in turn. And so the illusion is created that the cube is rolling along a straight line without slipping.
(Just a picture without any sense.)


I am trying to plot 2 equations divided in 3 intervals (, tr..te, te..tfin1), but when i try to solve the first equation it appears:

"Warning, cannot evaluate the solution further left of .66099564e18, probably a singularity"

Is it possible avoid this point?

About the second equation, when i try to solve between "te and tr" the program says that the argument is invalid.

Can someone help me?

Here is the program:


Digits := 20;

M := 0.122e20*0.152e25;
kappa := evalf(sqrt(8*Pi/M^2));
rrhoCC := 0.769e-41*(0.1e-28*0.561e24)*0.152e25^4;

rrhoM0 := 0.1e51;
rrhoR0 := 0;
rrhoM := proc (t) options operator, arrow; rrhoM0/a(t)^3 end proc;
rrhoR := proc (t) options operator, arrow; rrhoR0/a(t)^4 end proc;
pM := proc (t) options operator, arrow; 0 end proc;
eq1 := diff(a(t), t) = a(t)*kappa*sqrt(rrhoM(t)+rrhoCC)/sqrt(3);
eq2 := 2*(diff(a(t), t, t)) = -(1/3)*kappa^2*(rrhoM(t)+3*pM(t)-2*rrhoCC)*a(t);
tini := 0.1e19;
sys1 := {eq1, a(tini) = 1.0};
sys2 := {eq2, a(tini) = 1.0, (D(a))(tini) = 0.284e-17};
tfin1 := 0;
te := 10^(-32);
tr := 10^12;
singularities(eq1, a(t));
singularities(eq2, a(t));
p1a := dsolve(sys1, type = numeric, abserr = 10^(-15), relerr = 10^(-15), range = tini .. tr);
p1b := dsolve(sys1, type = numeric, abserr = 10^(-10), relerr = 10^(-10), range = tr .. te);
p1c := dsolve(sys1, type = numeric, abserr = 10^(-10), relerr = 10^(-10), range = te .. tfin1);
fig1a := odeplot(p1a, [t, a(t)]);
fig1b := odeplot(p1b, [t, a(t)]);
fig1c := odeplot(p1c, [t, a(t)], color = red);
display(fig1a, fig1b, fig1c);
p2a := dsolve(sys2, type = numeric, abserr = 1.*10^(-12), relerr = 1.*10^(-12), range = tfin1 .. te);
p2b := dsolve(sys2, type = numeric, abserr = 1.*10^(-12), relerr = 1.*10^(-12), te .. tr);
p2c := dsolve(sys2, type = numeric, abserr = 1.*10^(-12), relerr = 1.*10^(-12), range = tr .. tini);
fig2a := odeplot(p2a, [t, a(t)], color = green);
fig2b := odeplot(p2b, [t, a(t)], color = green);
fig2c := odeplot(p2c, [t, a(t)], color = green);
display(fig2a, fig2b, fig2c);




It post can be called a continuation of the theme “Determination of the angles of the manipulator with the help of its mathematical model. Inverse  problem”.
Consider  the use of manipulators as multi-axis CNC machines.
Three-link manipulator with 5 degrees of freedom. In these examples  one of the restrictions on the movement of the manipulator links is that the position of the last link coincides with the normal to the surface along the entire trajectory of the working point movement.
That is, we, as it were, mathematically transform a system with many degrees of freedom to an analog of a lever mechanism with one degree of freedom, so that we can do the necessary work in a convenient to us way.
It seems that this approach is fully applicable directly to multi-axis CNC machines.

(In the texts of the programs, the normalization is carried out with respect to the coordinates of the last point, in order that the lengths of the integration interval coincide with the path length.)

I am trying to use Monte Carlo integration example given at:

After coding the procedure, the statement approxint(x^2, x = 1 .. 3)

gives error: Error, (in approxint) invalid input: `if` expects 3 arguments, but received 1

But I have used in exactly the same way as given in the page. What is the problem


Realted to this post I am trying to solve the following inequalities in the variable "t"




Cosenos := proc (m, x) local C, x1, x2, y, x0, i, j, j0, k, K0, Kaux, K1, L, R, S, t1, t2, t, r1, r2, d; C := NULL; K0 := NULL; Kaux := NULL; K1 := NULL; L := NULL; R := NULL; S := NULL; d := nops(x); for k to d-1 do if evalf(x[k]) = 1 then j0 := m else j0 := 1+floor(x[k]*m) end if; K0 := K0, [(j0-1)/m, j0/m] end do; K0 := [K0]; S := K0[1][1] <= t, t <= K0[1][2]; for k from 2 to d-1 do S := S, K0[k][1] <= 1/2-(1/2)*cos(Pi*m^(k-1)*t), 1/2-(1/2)*cos(Pi*m^(k-1)*t) <= K0[k][2] end do; K1 := solve({S}, t) end proc


However, this run very very slow....For instance, for Cosenos(50, [.3225, .25877, .325, 1])


we interrupt the opertion after more than 10 minutes...I am doing something wrong?

Many thanks for your comments and suggestions. 




I've asked Maple to solve an equation, and the result is difficult to read because it is separating single variables into multiple multiplicative instances of that variable raised to different powers. Is there a way to tell Maple to combine all instances of a variable into one instance raised to the appropriate power?

I've already tried simplify.

For example:

pceq := (2/3)*Pi*G*rho^2*R^2:
pnonreleq := (1/5)*(3*Pi^2)^(2/3)*hbar^2*n^(5/3)/m:
rhocomposition := rho = m/((4/3)*Pi*R^3), n = Z*rho/(A*m_p):
obj := subs(rhocomposition, rhocomposition, pceq = pnonreleq):
req := R = simplify(solve(obj, R)[1]);

The above code produces 

In the first place, I can't see why Maple would show what should be (Z/A)^(5/3) as z^3 / (A * [A*Z^2]^(2/3)), but I'd like to somehow tell it to not break up the variables like this.

Is this possible? Thanks for the help.

I want to use Burr distribution and hence I am creating custom probability distribution. The pdf of Burr is not piecewise. It gives error.


burrpdf := alpha*k*((x-gamma)/beta)^(alpha-1)/beta(1+((x-gamma)/beta)^alpha)^(k+1)

burr_distribution := Statistics[Distribution](PDF = (alpha > 0, beta > 0, gamma > 0, k > 0), burrpdf)


Error, (in Statistics:-Distribution) invalid input: too many and/or wrong type of arguments passed to NewDistribution;

I am unable to compute integral, it displays the function itself.

burrpdf := alpha*k*((x-gamma)/beta)^(alpha-1)/beta(1+((x-gamma)/beta)^alpha)^(k+1)


mean_burr_temp := simplify(x*burrpdf)


int(mean_burr_temp, x = gamma .. t)


Looking the Maple's help, I see that the command "isolve"  tries to solve an equations   over the integers. Then, given m>1 and t in the interval [0,1], How can used this command to find an integer j>=1 such that (j-1)/m<=t<j/m. That is, fin j such that t belongs to the interval [(j-1)/m,j/m].


Thanks in advance for your comments and help.

Let G be a permutation group like S3. I have a loop in which x runs over the elements of this group.

When I ask the cycle type of x or the number of orbits of x, Maple gives an incorrect result in some cases. This is because when x=(12), for example, Maple considers x to be an element of the permutation group S2 instead of S3, i.e. it fails to understand that (12) should really be (12)(3) in this case.

Is there a way I can instruct Maple to consider the permutation (12) as a member of S3 instead of S2? 

I am posting the code as requested. Something like this:


for x in Elements(S3) do print(x, numelems(Orbits(PermutationGroup(x)))) end do;

(I don't know how to format this, sorry)

This code is simply asking how many orbits exist in the action of each element of S3. The result will be 1 for x=(12), however, because Maple will assume that (12) is acting on the set {1,2}, even though I am considering (12) as an element of S3. I want it to consider (12)=(12)(3) and let it act on the set {1,2,3}, thereby producing 2 orbits, not 1.

How to draw the following function containing an imaginary number


u := proc (x, t) options operator, arrow; 1/2+I*sqrt(2)/(exp(x-t)+2*exp(-x+t))+(1/2)*(exp(x-t)-2*exp(-x+t))/(exp(x-t)+2*exp(-x+t)) end proc

proc (x, t) options operator, arrow; 1/2+I*sqrt(2)/(exp(x-t)+2*exp(-x+t))+(1/2)*(exp(x-t)-2*exp(-x+t))/(exp(x-t)+2*exp(-x+t)) end proc



















Download plot33.mwDownload

On the example of a manipulator with three degrees of freedom.
A mathematical model is created that takes into account degrees of freedom of the manipulator and the trajectory of the movement from the initial point to the final one (in the figure, the ends of the red curve). In the text of the program, these are the equations fi, i = 1..5.
Obviously, the straight line could be the simplest trajectory, but we will consider a slightly different variant. The solution of the system of equations is the coordinates of the points of the manipulator (x1, x2, x3) and (x4, x5, x6) in all trajectory. After that, knowing the lengths of the links and the coordinates of the points at each moment of time, any angles of the manipulator are calculated. The same selected trajectory is reproduced from these angles. The possible angles are displayed by black color.
All the work on creating a mathematical model and calculating the angles can be done without the manipulator itself, is sufficient to have only the instruction with technical characteristics.
To display some angles, the procedure created by vv is used.

Hello everybody.

Maybe I'm so lucky but I found again the problem connected with "Kernel connection lost"; error (see one of my previous post regarding this ). But now I used Intel-based processor.

Here the simple code of my program:

R0 := exp((2*Pi*I)*n^2*z);
R1 := sum(R0, n = -infinity .. infinity);
R1 := abs(R1)^2;
R2 := exp((2*Pi*I)*(n+1/2)^2*z);
R2 := evalf(sum(R2, n = -infinity .. infinity));
R2 := abs(R2)^2;
R := evalf(sqrt(Im(d))*(R1+R2));
plot(R, k = 1 .. 10);

After this I got message from Windows 7 (64 bit) that mserver.exe has stopped and then above mentioned error with Kernel connection lost. Anybody knows what is the problem?

P.S. Maple 17 (64 bit).


Consider the problem min{|a+2*i| : i integer}, where a is a number of the form 2k*t for a fixed integer k>1 and t in [0,1]. A simple checking shows that i must belongs to the interval [-(1+a)/2,(1-a)/2] and as the legth of this interval is 1, there is two integers in this interval.

How can I compute this integer i with Maple? The commad "ceil" not seem very suitable. Some idea?
Many thanks in advance for your comments.

Say I want to use multiples commands on an expression



Now similar I could use


but how do I do it with sth like eval which needs extra arguments

(simplify@expand@eval(x->y, x=y+1))(f)


First 11 12 13 14 15 16 17 Last Page 13 of 58