MaplePrimes Questions

Search Questions:

Latest Questions Latest Questions Feed

1.  a procedure quadsumstats whose input is an integer n. This procedure should return a list of length 

n whose kth  entry is the number of solutions to
x^2 + y^2 = k 
1 <= k and k <= n

I am sort of confused as to how to construct that list of length n and how to obtain integer solutions to the equation in maple.


a procedure firstCount(k) that finds the first integer
representations as
"x^2+y^2= n." What does it mean for an integer to have k representations?





I am trying to use maple to plot a poincare section for the following Hamiltonain:

H:=(1/8)*(p1^2+16*p2^2-4*p1*p2*cos(q1-q2))/(3+sin(q1-q2)^2) - cos(q2)-8cos(q1)

I've been using Maples built in command as follows:

poincare(H, t=-5000..5000, ics, stepsize = 0.1, iterations = 1, scene = [q2,p2]);

for a given set of initial conditions ics. My problem is however I need to restrict the plotting value to p1>0, as otherwise i seem to get two overlapping maps as seen below:

How exactly can i do this?

This is a question I have also submitted to the technical support, I am worried that it is a bit too technical for them, however:)

I am debugging a C program which links against the OpenMaple API library (under Linux and with Maple 17 and 18). I am using valgrind memcheck, because I am experiencing strange behavior which could be due to writes beyond allocated blocks of memory.  

The first thing which jumps to my eye, are many errors of the types

Use of uninitialised value of size (4/8/16)

Invalid read of size (4/8/16)

Conditional jump or move depends on uninitialised value(s)

The same errors are also printed when I use the examples that ship with Maple. For instance, I compile "simple.c" with

gcc  -Wl,--no-as-needed -lmaple -lmaplec -lrt -L /usr/lib -L $MAPLEDIR/bin.X86_64_LINUX -I $MAPLEDIR/extern/include -o simple simple.c

and run valgrind as

valgrind --tool=memcheck --error-limit=no --log-file=memcheck.log ./simple


Some, but not all, of the errors occur in __intel_sse2_strcpy or __intel_sse2_strlen. Furthermore, according to valgrind there are definite memory leaks. which appear in the library. 

Practically this makes it hard for me to identify my potential own errors. I am a bit surprised to see so many warnings because I tend to fix my own programs until memcheck does not print these anymore (before I give it away at least). The question is: Can I consider these errors as safe to ignore? How would I distinguish real errors which may appear in my application?


To get the phase portrait, I did this











Error, (in DEtools/DEplot/WhichPlot) More than two dependent variables - please indicate the desired scene.

I want phase portrait projected on x − y plane.

Any comments?



How can I write a code to calculate the Rieman Sum for  y=x^1/2 [0..4] using 

left hand rule and 100 subdivision.

Thank you 

Hi guys, 

       After my calculations, I got the Lagrange function having three gereralized co-ordinates namely u,v and w. Hence, according to theory it should give three equations of motion. 

      I have trouble finding equations of motion from following Lagrange function(L = T -U), Can anyone guide me with this?

      Moreover, kinetic energy and strain energy equations are in the form of double integral!! 




i need help!!

write a procedure for the taylor series sin (x) and plot it in the range (-2pi to 2 pi)

use 20 term iterations in the taylor series approximation.

Thank you very much for your help.... 

I'd like to plot the differences between terms in a sequence of vectors. Each difference term should start at the end of the last difference term, so that if I was to plot the actual term, the vector would meet at the end of the difference term. The sequence is limited in length and stored as a list.


Suppose I have  [<1,1>,<2,2>,<3,3>]. The difference terms would thus be [<1,1>,<1,1>,<1,1>]. The first difference term would be plotted be plotted from <0,0>, the second starting at <1,1>, the third at <2,2>.

I can compute the difference terms, but I am not sure how to make the plot I desire. Is arrow(...) the answer, somehow?

Hello all,

Suppose I have a vector valued function f (dimensions of vectors is 2). I can use fieldplot to show me the function's behaviour over some window.

I'd like to do the same thing, but I want to compact the space down to the unit circle. Basically, given a vector <x,y>, I'd like to "fieldplot" f(<x,y>) but with each arrow f(<x,y>) appearing at <x,y>/(1 + Norm(<x,y>,2)) instead of <x,y>.

Is this possible?

Hi! I'm trying to use MapleSim 7 to simulate some very simple physical situations, however after great many hours spent at this, I'm still unable to convince MapleSim to load and run even the simplest Modelica models, like:

model Main
  Modelica.Mechanics.MultiBody.Parts.Body o(r_CM = zeros(3));
  inner .Modelica.Mechanics.MultiBody.World world;
  o.frame_b.f = {0,-9.8,0};
end Main;

It will report that o and world are "unknowns" and apparently does not recongize Modelica.Mechanics.MultiBody.Parts.Body nor Modelica.Mechanics.MultiBody.World. Do I need to do some extra steps to import extra libraries or enable some non-default components?  I went through various YouTube and other tutorials and didn't find a mention of anything.

When I look at some examples, often they refer to things like Maplesoft.Multibody.World - but these are proprietary Maple packages, and I need my code to use standard Modelica. Does this mean that MapleSim cannot run generic Modelica code like this?

I also tried running e.g. and some other examples, with absolutely no success either. I'm quite confused because MapleSim has a lot of advertising about Modelica support... :-(

Hello. I am engaged in independent study of tensor calculus (in the annex to the theory of elasticity) and package Maple. Currently engaged in the action of a solution of the normal point force on elastic half-space (Boussinesq problem, for example, see The point is this: you need to create a vector displacement field U, differentiate and create a strain tensor, and then using Hooke's law to obtain the stress tensor. Actually only started to understand and immediately raised the question. Creating vector displacement field using the VectorField package VectorCalculus or any team or package DifferentialGeometry Physic? How then create a tensor with components equal to the partial derivatives of the displacement vector? My attempts Thanks for your help.

I need to write a procedure that does the following :

Write a procedure quadsum whose input is an integer n and whose output is a list of pairs of solutions [x,y] to the above formula.

Your procedure should implement the following algorithm.

1 Initialization
"mylist = []."

Start at
x = 0
y = 0.

2 Phase A
Increment both
"x^2+y^2 >=n."

Phase B
Repeat the following until

If you are above the circle
x^2 + y^2 = n
then go down in unit steps until you are on or below the circle.

If you are on the circle, add the point to the list
"mylist. "

If you are on or below the circle
x^2 + y^2 = n
then go one step to the right. My procedure is as follows: but it runs into an infinite loop(most probably because of the while loop defined inside the while loop). What am I doing incorrectly?

I have atta


Has there been any progress with new commands for Maple 13 that allow one to auto-resize the plotting grid?

I am generating fractals with Maple 13 and resizing the plot output grid manually is not an option because it distorts it. Neither is the option to resize it once and recalculate, because the final grid contains many points.

Any pre-processing or massaging code prior to executing the main code is very welcome (if it can be done).

Many thanks,


Hello together,

After doing some Maple work i got this Equation of Motion:

I'm not sure how I am able to solve this differential equation.

I am able to do it by Seperation of the variables by hand, but Maple should be able too?

Thanks for the help, everything is appreciated!

When I plot someting in Maple17, it appears in a small square window that's horizontally centered.  I want to be able to create plots that appear larger.  There's plently of space on the screen for plots to be much larger.

Yes, I know I can grab the corner of a plot and drag it to make it bigger.  That's not what I want (that takes time, and it's tricky to maintain the aspect ratio).  I want the plot to appear large when I execute the plotting command.

I've searched for answers both on Google and mapleprimes, and come up empty.


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