Maple 2015 Questions and Posts

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

I recently corresponded with maplesoft on whether the program Groebner:-Basis always produces reduced Groebner bases or not. They say it does. This mw appears to show it producing a non reduced Groebner Basis for a set of polynomials.

More specifically, the coefficient of the lead term of the first polynomial generated is not 1.

I'd like to be shown wrong here, but I am struggling to see what i could be doing wrong.

Hi,

I'm new into Maple and I need some serious help. I'm supposed to read numbers from file (teploty.txt) and according to value assign some text to them and write it in other file (barvy.txt). I think I've done it right (propably not, I learn it for like half a year), but Maple keeps writing "Error, cannot determine if this expression is true or false: value < 20".

Can anybody help me, please?

Thank a lot!

Is there a way to put the 2 following animations together and synchronize them?

Maplesoft Help has an example of how to create the animation.  See last example on
https://de.maplesoft.com/support/help/maple/view.aspx?path=plots%2fanimate

but I couldn't get it to work on my Maple version 2015.

plots[animate](plot, [[cos(t), sin(t), t = 0 .. A]], A = 0 .. 2*Pi, scaling = constrained, frames = 50)

with(plots);
BACK := plot(sin(x), x = 0 .. 2*Pi);
oneFrame := proc (t) options operator, arrow; pointplot([t, sin(t)], color = blue, symbol = circle, symbolsize = 18) end proc;
animate(oneFrame, [t], t = 0 .. 2*Pi, background = BACK);

WC23_Unit_circle_and_sinewave_together.mw

I have this expression which I want to integrate numerically, but it is exponentially slow. I tried methods like _d01ajc but it does not help.

 

restart;

f2 := proc (m) options operator, arrow;

evalf(Int(exp(-(2*m-4)*exp(t)+t*(m+1))*(t-2*exp(t)), t = 0 .. infinity))

end proc;

 

plot([f2], 3 .. 10)

I have an expression involving a sqrt, and i'd like to simplify it, but simplify(expression,sqrt) doesn't seem to fully help.

Eq1 := [(1/2)*(R[b]*kh[a2]+R[m]*kh[a2]-Rh[m]*kh[a2]+sqrt(R[b]^2*kh[a2]^2+2*R[b]*R[m]*kh[a2]^2-2*R[b]*Rh[m]*kh[a2]^2+R[m]^2*kh[a2]^2-2*R[m]*Rh[m]*kh[a2]^2+Rh[m]^2*kh[a2]^2))/kh[a2] = 0, 0 = 0, -(1/2)*(R[b]*kh[a2]+R[m]*kh[a2]-Rh[m]*kh[a2]+sqrt(R[b]^2*kh[a2]^2+2*R[b]*R[m]*kh[a2]^2-2*R[b]*Rh[m]*kh[a2]^2+R[m]^2*kh[a2]^2-2*R[m]*Rh[m]*kh[a2]^2+Rh[m]^2*kh[a2]^2))/kh[a2] = 0]

simplify(Eq1, sqrt)

gives

[(1/2)*(R[b]*kh[a2]+R[m]*kh[a2]-Rh[m]*kh[a2]+sqrt(kh[a2]^2*(R[b]+R[m]-Rh[m])^2))/kh[a2] = 0, 0 = 0, -(1/2)*(R[b]*kh[a2]+R[m]*kh[a2]-Rh[m]*kh[a2]+sqrt(kh[a2]^2*(R[b]+R[m]-Rh[m])^2))/kh[a2] = 0]

which on paper simplifies to:

[R[b]+R[m]-Rh[m]=0,0=0,R[b]+R[m]-Rh[m]=0]

is there a way to get maple to show this?

[In part I am trying to better understand how to manipulate sqrt expressions in maple]


I have a complicated expression which includes RootOf( a quadratic ) but holds for all x what i'd like to do is turn it into a polynomial in x[1], x[2], x[3] so i can start looking at the monomial coefficients.

k[a1]*((x[1]+x[3])*k[d1]+C[T]*k[m])*(R[b]-x[1]-2*x[2])/((R[b]+R[m]-x[1]-2*x[2]-x[3])*k[a1]+k[m])-k[d1]*x[1]-k[a2]*x[1]*(R[b]-x[1]-2*x[2])+2*k[d2]*x[2] = (-R[b]*k[a2]+2*k[a2]*x[1]+2*k[a2]*x[2])*(k[a1]*kh[m]*((x[1]+x[3])*k[d1]+C[T]*k[m])*(R[b]+R[m]-Rh[m]-x[1]-2*x[2])/(k[m]*((R[b]+R[m]-x[1]-2*x[2]-x[3])*k[a1]*kh[m]/k[m]+kh[m]))-k[d1]*x[1]-kh[a2]*x[1]*(R[b]+R[m]-Rh[m]-x[1]-2*x[2])+2*kh[d2]*x[2])/(2*kh[a2]*RootOf(kh[a2]*_Z^2+(-R[b]*kh[a2]-R[m]*kh[a2]+Rh[m]*kh[a2]+2*kh[a2]*x[2])*_Z-2*k[a2]*x[1]*x[2]-k[a2]*x[1]^2+k[a2]*x[1]*R[b]+2*kh[d2]*x[2]-2*k[d2]*x[2])-R[b]*kh[a2]-R[m]*kh[a2]+Rh[m]*kh[a2]+2*kh[a2]*x[2])+(-2*kh[a2]*RootOf(kh[a2]*_Z^2+(-R[b]*kh[a2]-R[m]*kh[a2]+Rh[m]*kh[a2]+2*kh[a2]*x[2])*_Z-2*k[a2]*x[1]*x[2]-k[a2]*x[1]^2+k[a2]*x[1]*R[b]+2*kh[d2]*x[2]-2*k[d2]*x[2])+2*k[a2]*x[1]+2*k[d2]-2*kh[d2])*(kh[a2]*x[1]*(R[b]+R[m]-Rh[m]-x[1]-2*x[2])-2*kh[d2]*x[2])/(2*kh[a2]*RootOf(kh[a2]*_Z^2+(-R[b]*kh[a2]-R[m]*kh[a2]+Rh[m]*kh[a2]+2*kh[a2]*x[2])*_Z-2*k[a2]*x[1]*x[2]-k[a2]*x[1]^2+k[a2]*x[1]*R[b]+2*kh[d2]*x[2]-2*k[d2]*x[2])-R[b]*kh[a2]-R[m]*kh[a2]+Rh[m]*kh[a2]+2*kh[a2]*x[2])

If this were something like q(x)=p1(x)/sqrt(p2(x)) where p1 and p2 are polynomials and q is a quotient- this would be as simple as making sqrt(p2(x)) the subject and squaring both sides, and then movinbg everything onto one and multiplying out denominators. However RootOf is something I'm not used to manipulating.

Is there anyway of converting this expression to a polynomial using maple commands?

I am working on a problem that involves finding a map lambda(x) which maple stores using RootOf:

LambdaMap := [lambda[1] = RootOf(kh[a2]*_Z^2+(-R[b]*kh[a2]-R[m]*kh[a2]+Rh[m]*kh[a2]+2*kh[a2]*x[2])*_Z-2*k[a2]*x[1]*x[2]-k[a2]*x[1]^2+k[a2]*x[1]*R[b]+2*kh[d2]*x[2]-2*k[d2]*x[2]), lambda[2] = x[2], lambda[3] = x[1]+x[3]-RootOf(kh[a2]*_Z^2+(-R[b]*kh[a2]-R[m]*kh[a2]+Rh[m]*kh[a2]+2*kh[a2]*x[2])*_Z-2*k[a2]*x[1]*x[2]-k[a2]*x[1]^2+k[a2]*x[1]*R[b]+2*kh[d2]*x[2]-2*k[d2]*x[2])]

(as an aside, after a few years of using maple and reading the help page I find RootOf confusing, and I think this is the root of this question, I'd love to get some recomended reading on it in the answers)

I want to use the restriction lambda(0,0,0)=(0,0,0) to find relationships between the parameters (kh,k,Rh,R etc)

I tried:

`~`[`=`](`~`[rhs](subs([x[1] = 0, x[2] = 0, x[3] = 0], LambdaMap)), [0, 0, 0]);
solve(%);

which returned:
[RootOf(kh[a2]*_Z^2+(-R[b]*kh[a2]-R[m]*kh[a2]+Rh[m]*kh[a2])*_Z) = 0, 0 = 0, -RootOf(kh[a2]*_Z^2+(-R[b]*kh[a2]-R[m]*kh[a2]+Rh[m]*kh[a2])*_Z) = 0]
{R[b] = R[b], R[m] = R[m], Rh[m] = Rh[m]}

which seems wrong (both the first and third equations are quadratics sharing roots, the first root is _Z=0, and the second is _Z=-R[b]-R[m]+Rh[m]- i'm not sure how either result in this solve)

Is this the right way to do this? i.e. do solve and subs, work intuitively with RootOf expressions.

I am doing some calculus on lambda next - is there anything i should be mindful of when calculating its Jacobean or using diff?

I have this sum which should be equal to argument(GAMMA(I*x)) with x>0.

restart;

`assuming`([x*ln(n)-(1/2)*Pi-(sum(arctan(x/k), k = 1 .. n))], [x > 1]);

aG := `assuming`([limit(%, n = infinity)], [x > 1]);

`~`[evalf](eval([aG, argument(GAMMA(I*x))], x = 1))

 

However this limit evaluation is somehow broken in as it always gives some order symbol O(1) etc..

What is happening here?

Hi

I have a Vector of polynomials in x[1] and x[2]; and I want to use coeffs to get the coefficients of bothe elements of the Vector; using the command:

Eq2Coeffs := `~`[coeffs](%, [x[1], x[2]])

bizarely the result i get is something in terms of x[1] and x[2].

Here is the worksheet this problem emerged in, the specific command is 3.8.

Help page says "minus~" is an element-wise operators in Maple
Why this command doesn't return [{1}, {3}] but generates an error ?
[{1, 2}, {2, 3}] minus~ {2};
Error, dimension bounds must be the same for all container objects in an elementwise operation

OK, you can answer I could use  map(u -> u minus {2}, [{1, 2}, {2, 3}]), but it wouldn't explain the reason of the (my?) error.

Thanks in advance

 

 

 

I have two matrices, one of the dimension of solution space that i have been using solve to navigate
this matrix will look something like:

M := matrix([[3, 2, 1], [2, 1, 1],[2, 1, 1]])

and I have another matix of the times that it takes solve to find these regions:

N := matrix([[.2, .4, .8], [.3, .6, .5], [.8, 2.3, 2.6]])

I'd like to find the sets {N[ij]:M[ij]=m for some integer m}; that is I'd like to get all the elements of N on entries of M with the same number so i can start thinking about them statistiaclly.

i.e. for 3 i'd like the list [.2]

      for 2                      [.4 .3 .8]

and so on.
 

I've made a worksheet (updated)in which I'm timing a program (GTS2) because it sometimes takes a long time to run, and I am not interested in timing the cases where it takes an exceptionally long time to run I've created a timer function that runs GTS2 through timelimit.

timelimit(20, GTS2(H, F, Na, Nd))

this should run the function for 20 seconds, and then stop it if it overruns, before returning that the whole function ( GTS2timer2  ) has taken 20 seconds.

On line 3.3 GTStimer2 is run with two sets of inputs which give a runtime >40s. My guess is that the 20+ extra seconds that the operation takes are spent running solve which is called in GTS, and I expect i can solve the problem by putting solve in the timelimit function directly (if i'm wrong about this please tell my why).

My question is why timelimit isn't able to stop GTS after 20 seconds.

EDIT:

Playing around with the worksheet the morning after I made it the case that was running for 40+s is now giving the error

Error, (in factor/diophant) time expired

My guess is that as it is stopping the solve in GTS2  needs a try/catch of its own. Any idea how to make that work? 

I was making a maple worksheet (out of functions from another), when i noticed that  execution groups and new execution groups that i was making were not showing an output.  I'm wondering why this happens, and how it can be fixed.

in more detail there are 4  [> groups of commands, the first two give the correct output when i hit enter, however, if enter is pressed on any group of commands after the second the command wont return the any output.

I believe this is a formatting issue that comes from the way i cut/paste and edited the previous worksheet down to this, but i'd like to understand so i can avoid it happening again.

3d_plot_of_Lie_derivatives_against_Dimensions_of_solutions_timer.mw

Ahh, this is a teathing problem, I had been using writeto so i could store measurements of RAM; this changes the nature of the question.

How do you implement writeto so only some things are sent there? (in the case of this worksheet the output of GTS2usage
 

Dear users!

Hope everyone fine here. I want to compare the coefficients of like power of exponential function in attachemed file. Please see and fix my problem.

Help.mw

WC51 III
Maple 2015

With straight line selected in following plot, I right-click on plot and select Line → Line Width...  In Set line width dialog I toggle line width to 1 and click OK.

I have the changes I want, but if I choose Restart → Execute Worksheet all my changes are lost.  It is often easier to use the Plot Options Toolbar instead of hunting for Maple syntax to make changes in a plot graphic.  I'm wondering if there is a way to "lock" my plot edits so that they won't disappear as I continue working on a Maple worksheet?

restart;
with(plots);
eq1 := -y^3+x^2+x*y-7; eq2 := y = (8/9)*x-2/3;
implicitplot({eq1, eq2}, x = 0 .. 4, y = 0 .. 3, axis = [gridlines = [6, color = "MidnightBlue"]], size = [1/2, 1], axesfont = ["Roman", bold, 10], thickness = 3);





 

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