600 Reputation

11 Badges

8 years, 298 days

MaplePrimes Activity

These are questions asked by sand15

Good morning everybody.

I have tried Explore to draw plots in an interactive way.

The function I want to draw (plot3d) is automatically constructed by a specific code, as well as the names of the parameters it depends on. These are of the form P||1, P||2, ...P||N (N is an integer determined during the construction)

... but I did not succeed !

After some investigations I was able to reduced the problem to the following one

N  := 2:
F  := add(P||k * x^k, k=0..N):
G := [seq(P||k=-1.0 .. 1.0, k=0..N)]:
Explore(plot(F, x=0..1), parameters=G)

The result is the classical imbedded window with a plot of -1-x_x^2 and three sliders below.
But as soon as I push anu of them the plot disappears and connot be recoverd.

But the following sequence seems to work as expected

N  := 2:
F  := add(P__k * x^k, k=0..N):
G := [seq(P__k=-1.0 .. 1.0, k=0..N)]:
Explore(plot(F, x=0..1), parameters=G)

Before changing my code, could you please confirm me that parameter names such that P||k are not correctly accounted for by Explore ?

Auxiliary question : more generally, are there points which I have to count carefully when I use the P||k construction ?

Thanks in advance

Good morning everybody

I know this question has already been widely discussed, for example in

I used the answer Kitonum then gave because I have basically the same kind of problem.
As an illustration, here is a sketch of my coding :

N := 3:
for k from 1 to N do
   MyPlot||k := PLOT(CURVES(....)):
end do:
plots:-display(seq(MyPlot||k, k=1..N));

The only difference is that I use PLOT instead of plot ... so I have thought that using LEGEND instead of legend would give me the desired result.
But I don't understand how to use LEGEND and how to place the legend in the correct location.

I will appreciate any answer,
Thanks in advance

Hi all,

I start working with the Grid package.
To familiarize myself with it I ran the "primeChecker" example, which of course has worked perfectly well.

Next I did this (a priori harmless) simple modifications :

  1. within the primeChecker procedure :
    replace  myVal := userData[thisNode+1] :
    by         myVal := userData[thisNode+1, 1] :
  2. before launching the procedure with Grid[Launch] :
    replace  userData := [ .... ] :  #which is a list
    by         userData := [ .... ] :  # the same thing
                 userData := convert(userData, matrix): 

I get the following error message :
error, (in unknown) Matrix index out of range

What does it mean and how can I fix this ?

Thanks in advance

Hi guys,

I have written a program in Maple 2016 (Windows 7) made of two parts :

  1. An initialization step where a formal system of algebraic equations (some non linear) is built
    Let S(U, P) this system, where U denotes a set of unknowns and P a set of parameters (see step 2 below)
  2. An iterative step where this system is solved with respect to U for different values of parameters P
    This loop has to be executed N times for values P1, ..., Pn, ... of P

I observe that the size of the memory (bottom right of the Maple window) inflates as the value of n increases.

I was able to isolate in the loop corresponding to step 2, the procedure MyProc I wrote which is responsible of this memory inflation.
Now I would like to manage this inflation (typically the memory size grows up to 3 GiB for n about one thousand) because of its very negative effects on the computational time (probably Maple does spend a lot of time in swapping operations).

Suspecting the remember process to be the source of this problem, I tried simple tricks such as

  • systematically write   > quantity := 'quantity';   for fome intermediate quantities
  • use forget  : for example MyProc contains a call to fsolve and,  after "local" declarations, I inserted  the command  forget(fsolve)   
  • in the the loop over n,  I even inserted the command forget(Myproc).

None of these tricks was to some extent efficient to contain the memory inflation.

I suppose it is a very common situation that people who use to develop code are familiar with. So maybe some of you could provide my some advices or move me towards "strategies" or "methodologies" to prevent this situation ?
My purpose here is not to ask you to solve my problem, but rather to ask youy to give me hints to be able to manage such kind of situations by myself.

Maybe this question is unorthodox and doesn't have its place here ?
It that case please let me know.

Thanks In Advance

PS : it would be very difficult for me to provide you the code : if it is a necessary condition for you to help me, just forget it, I will understand

I have a simple minded question :
How can I give an answer a Vote Up or select it as the Best Answer to a question ?

First 17 18 19 20 Page 19 of 20