MaplePrimes Questions

Search Questions:

Latest Questions Latest Questions Feed

I'd like to plot the following inequalities:





I have this MATLAB script, but as I work in Maple, I'll need to translate it to Maple. 
I know how to define symbols and functions, but I don't know which Maple commands to use, of if it needs to be done in another way, so the problem is translating from " dZ = [dx; dy; ax; ay; dm];" and down.

Any help would truly be greatly appreciated! Thank you!  

This is the script:

function dZ = meteor_step(~, Z)

  P = 1.2; % initial atmospheric pressure
  H = 1.39E-4; % scale height of atm pressure
  E = 8.11131859E6; % evaporation energy
  D = 1; % drag constant
  G = 9.814; % acceleration due to gravity
  PM = 3.3E3; % density of the meteor
  S = 3.986E14; % standard gravitational parameter of Earth (G*M)
  R = 6.3674447E6; % radius of the Earth (meters)

  x = Z(1);  
  y = Z(2);
  dx = Z(3);
  dy = Z(4);
  m = Z(5);
  atm = P*exp(-y*H);

  v = sqrt(dx^2+dy^2);

  area = pi * ( (3*m)/(4*PM) )^(2/3);

  dist = sqrt(x^2+y^2);
  Gv = -9.8;

  accel = -(D*atm*area)/m*v;
  ax = accel * dx;
  ay = accel * dy + Gv;

  dm = -(atm*v^3*area)/(2*E);
  dZ = [dx; dy; ax; ay; dm];





[t, R] = ode45(@meteor_step, [0 250], [0, 100000, 100, -300, 25]);

x = R(:,1);
y = R(:,2);

dx = R(:,3);
dy = R(:,4);

v = (dx.^2+dy.^2).^(1/2);

m = R(:,5);

plot(t, y);
  title('Meteor Kinematics: Height vs Time');
  xlabel('Time elapsed (s)');
  ylabel('Height (m)');

plot(x, y);
  title('Meteor Kinematics: Horizontal vs Vertical Position');
  xlabel('Horizontal (m)');
  ylabel('Vertical (m)');

plot(t, v);
  title('Meteor Kinematics: Speed vs Time');
  xlabel('Time elapsed (s)');
  ylabel('Absolute speed (m/s)');

plot(t, m);
  title('Meteor Kinematics: Mass vs Time');
  xlabel('Time elapsed (s)');
  ylabel('Mass (kg)');

plot(t, dy);
  title('Vertical Velocity vs Time');
  xlabel('Time elapsed (s)');
  ylabel('Vertical velocity (m/s)');

temp = abs(y - 52900);
[~, index] = min(temp);

I've got a worksheet in which I have invested many hours of CPU execution time and if the computer goes down, or Maple fails for some reason, I'll lose it all.

If this happens I would like to be able to continue the calculation from where I left off.

By saving the worksheet periodically, I can save all the commands, but not the results, so if I have to restart, I'll have to wait many hours before the worksheet catches up to where it left off.

In ancient versions of Maple, you used to be able to save an executed worksheet including results (I sort of remember that you wrote a file with the extension ".M")  but the new help pages say that is now different from what it used to be. Obviously I can "save" individual symbols to a file, but for a complicated worksheet  that gets complicated.

I've read about "maplet" files, but that doesn't seem to fill the bill either.

So, is there any simple way to save a worksheet so you can continue seamlessly from where you left off after a crash, with all the previous results intact?

I have written a program which plays the game of Multicube, a commercially made boardgame. It works OK except that when the game is replayed, the previous game output stays on the screen.  This is rather distracting and I'd like the screen cleared when a new game is run.   I'd like to know how the screen previous ouput can be cleared.   ...or what is the likely cause.

   At the start of my program I have:

interface(echo=0, verboseproc=0, warnlevel=0, prettyprint=1):

#I thought restart; would automatically have cleared any previous output.

The program reads necessary input (eg no of players, ..)  using:



Thanks,  David



Was trying to see if I can get the reduction formulas for int(cos(x)^n,x) in maple. But it seems no assumption used can make Maple give any result for this.  Mathematica gives a result using Hypergeometric2F1 (even with no assumption on n, which I am not sure about now), but was wondering why maple can't do this one:


int( (cos(x))^n,x) assuming n::integer;

int( (cos(x))^n,x) assuming n::posint;

In Mathematica, I get:

I am newbie in Maple, so may be I am missing some command or doing something wrong.

ps. I was trying to obtain

But this is lost case now. I just need to find out first why int(cos(x)^n,x) does not evaluate to anything in Maple.

fyi, the Hypergeometric result for $\int cos^n(x) \,dx$ can be seen in this reference (half way down the page):

ps. can't one enter Latex in this forum like at stack exchange?




I am trying to solve the boundary value problem (1-x^2)*y'' - 2*x*y' +12*y = 0 with y(-1) = -1 and y(1) = 1.  I have not used Maple much, but from some web surfing, it seems like the following inputs should work:

de := (1-x^2)*(diff(y(x), `$`(x, 2)))-2*x*(diff(y(x), x))+12*y(x) = 0

Y := dsolve(de, y(-1) = -1, y(1) = 1)

However, when I input these lines, I get the error: Error(in dsolve), found wrong extra argument(s): y(-1) = -1, y(1) = 1

Does this mean that Maple can't solve this problem?  Is my syntax wrong?  I would appreciate any help.





What are the stopping criteria for fsolve?
I cannot find anything in the help page and there seems to be no way of adding an optional argument to fsolve about errors.

I was initially surprised by the results of the first two fsolve commands below:

fsolve(x->1,0.4); #OK, returns unevaluated
fsolve([1,1],{x,y}); #OK, returns NULL

I assume that in the first two examples the criterion used is that at some point in the process the iterates [x(n+1),y(n+1)] and [x(n),y(n)] are close enough together and the difference between results from the two is small enough (clearly 0).

I have the following situation:


Bend is a proc, that returns a Record with info based on its parameters. I would like to get access to the name I assign to (i.e. HB) in the proc. Any chance?

Mac Dude

PS: I can of course kludge things by adding an argument to the proc Bend. But I'd like to avoid that.

Good day,


I am working under paper which contains comparison of different tensor software packages focusing on the algebraic manipulations with tensors (namely Maple Physics, Mathematica xAct, Cadabra and Redberry). When doing comparison we’ve found that Maple Physics `Simplify` function sometimes fails to perform even trivial simplifications and almost does not work on harder examples. For example, one can easily see that all expressions below are zero while Maple Physics is unable to simplify them:


with(Physics):with(Library):Setup(spacetimeindices = lowercaselatin):



#Does not give zero:



#Does not give zero:



#Does not give zero:



#Does not give zero:



#Does not give zero:



#Does not give zero:



#Does not give zero:



#Does not give zero:



I’ve attached a single Maple file with about 250 such examples (Maple18_failSimple.txt) and a file (Maple18_allSimple.txt) with 1000 simple examples I used: some of them work correctly, while some fails. All these examples perfectly work in other systems (Mathematica xAct, Cadabra and Redberry).


We use Maple18 with latests Physics package version (December 12), but we also tried latest Maple17 and other versions of Physics: none of them work. In all these examples all tensors have no symmetries, but we observe even worse results in case when tensors have symmetries (nearly all tests fail).


What is important is that when we try to test a little bit more complicated examples, which can be simplified by other packages within milliseconds, Maple Physics not able to perform basic simplification in nearly all cases. I have attached a file (Maple18_failMedium.txt with failed examples and Maple18_allMedium.txt with all examples we used) with more complicated but still simple examples (one can check each example by hand): Physics not able to simplify more than 50% of examples. Finally, I’ve attached harder examples which perfectly work in all three other systems, but none of them work in Maple Physics (Maple18_allHarder.txt).  


So, my question is why `Simplify` is not able to perform such basic simplification of tensorial expressions? May be I miss something and I need to use another special command?


If we are using `Simplify` in a right way, Maple Physics can not be considered as a package for tensorial algebra (in the opposite to what is declared on the Maple website) until these basic simplification functionality will work.



For generating input expressions we’ve written a little program that allows to generate random typical tensorial expressions arising in real computations (like calculation of Feynman diagrams etc.) and to run different system on such expressions in order to simplify them. Specifically we generate an expression (nested sums/products of tensors), then rewrite it in equivalent form (by renaming dummies, shuffling summands and multipliers and expand) and then subtract the result from initial expression. Obviously, simplification of such a prepared source must give zero.  








Edit: Here are some trivial examples that the latest fixed version (version 41.1 Dec/15) still fails to resolve correctly (besides Maple18_allHarder.txt that are still not working in the fixed version):


with(Physics): with(Library): Setup(spacetimeindices = lowercaselatin):


Define(B[a,b], antisymmetric={{a,b}}):

Define(H[a,b,c,d], antisymmetric={{a,b,c,d}}):


#Does not give zero

Simplify(A[c]*B[d,~e]*B[~d,f]*H[e,~f,b,a], tryhard);


Without symmetries:


with(Physics):with(Library):Setup(spacetimeindices = lowercaselatin):



#Does not give zero




Another important issue is that with the current fixed version, the time used by `Simplify` became unacceptably large. As in the notebook that ecterrab provided, Maple Physics takes about 20 minutes on 100 medium examples (Download, while other packages spend just few seconds.


We are looking forward for the future updates that will solve these issues.





I'm trying to solve the following differential equation numerically with dsolve:

but dsolve gives me this error:

> res := dsolve(DGL, numeric, parameters = [y0, A, B, C, E]);
Error, (in DEtools/convertsys) unable to convert to an explicit first-order system

I think the problem is that I use the wrong solver. Does Maple provide a solver which is capable of solving this kind of equations (nonlinear ODE)?


Thanks in advance!



I got a message "there are problems during the loading process. Worksheet may be incomplete"

I know that looking at the file in a text editor can help, but I dont know how to recognise the problems.

It doesnt look as a problem of strange characters either...


Its a pretty long worksheet, with many important work. Any help would be higlhy appreciatd. Thanks

Here is the worksheet





one of the most confusing thing for me with learning Maple, is pi vs. Pi. I keep mixing them up since do not remember half the time which one to use.

What is the point of having both? Mathematica only has Pi. If one wants numerical value for it, simply do N[Pi] which is similar to Maple evalf(Pi).

I just spend 5 minutes trying to figure why int((sin(x))^3*sin(k*x),x=-pi..pi); was giving me


While in Mathematica it gives

Then I noticed the Pi vs. pi, and now Maple gives same output.

Why pi was even introduced? was this done early on, or added in later versions? Why not keep Pi a symbolic and with evalf it gives numerical value as with Mathematica? Also, would one use pi?  It if just symbol (evalf(pi)) does nothing, then what is its use? if I can see a good use for pi vs. Pi, may be I'll understand the logic behind this duel system.





For my thesis I would like to illustrate the inclination of the solar system objects in a plane. Imagine the Solar system as a circular plane which is the average of the motions of all objects orbiting the Sun. Each individual planet/object is inclined towards this averaged plane - some more, some less. E.g. this image. Behind Neptune there lies the so-called Kuiper belt with many thousands of dwarf planets (Pluto is one of them and there are over 1000 objects known out there already). Now imagine that the big heavy Jupiter and other big planets perturb those small objects out there: so they are also inclined towards the average plane, see this image. Their inclination depends on their radial distance to the Sun (measured usually in Astronomical Units...1 unit is the distance Sun-Earth...we are talking about 40 to 50 units here). For one, I want to visualise this: imagine a circular plane and each orbit out there has another angle to the average plane. This is the first. But now: imagine the circle with it's 360°. Each object reaches it's highest point on its orbit around the Sun on another angle on this 360° circle. Neptune e.b. at 170°, Pluto at 250° etc. You get the picture. So not only are the objects in the Kuiper belt inclined differently, but their maximum orbit positions are also scattered across an imaginary 360° circle. I want to show this with a 3d-plane like this image but not with two peaks for one orbit. Is there a way to do/plot/visualise this in Maple? I am just interested in a visualisation of the principle without any empirical data behind this.


hello , to solve a differential euqations , maple gave me this error. please help me.

I use maple worksheet to organize a derivation, etc.

But most of the paragraphs and subparagraphs should normally be closed.


But after executing the file (using !!!) every paragraph is opened.   

We need better ability to control the opening/closing of paragraphs.


How do I close ALL paragraphs.


Also, how do I close all TOP level paragraphs (but not subparagraphs).


Thanks, Chee


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