MaplePrimes Questions

Seems to be when shading=none in fieldplot3d the plot returned is empty.  Is that a bug?

Hi everybody,

I use the Grid[Launch] function  (Windows 7, Maple 2015) to distribute many similar computations over all the processors my machine has.
 

Question 1

My machine is a 4 processors one (not hyperthreaded).
When it was equiped with Windows XP and I was using, let's say 2 proc., the performance manager showed that two processors among 4 were charged up to 95%-100% while the others remained around 0 %.
In this case (my problem is perfecly scalable), the elapsed time was exactly half it was when I used only one proc (and twice as large as the time obtained with 4 proc).


Now I'm working with Windows 7.
This behaviour puzzles me : if I use 2 procs among four and look to the performance manager, all the 4 procs are partially charged. It looks like Window 7 was distributing itself the computations ?
As a result (?), running on 4 proc no longer takes 25% of the elapsed time on 1 proc, but "only" 40%.
Could it be that some inner "dispatching task within processors" Windows 7 could have, might interfere with the distribution of tasks  Grid[Launch] does ?

Does anyone of you already had a same experience ?
If Windows 7 really has some "task managing procces", is it possible to switch it off ?


 

Question 2

Same context as previously.
I run the same code (search of a local maximum of a function where some of its parameters are randomly valued ; the sample of these parameters hase size 10000) over 4 proc.
On order to save intermediate results I wrote a loop within it I send blocks of 500 computations at the same time over the 4 proc.
This loop is executed 5 times (5*500*4 = 10000)

I observe that after each step of the loop the memory used is increased by a rather constant amount. It looks like if a 4 proc computation of 500 optimizations was costing N Mega Bytes, and that the memory was increased by N MB each times the loop is executed.
At the very end the computational time can dramatically slow down because of the amount of the memory used.

More precisely my pseudo code looks like this :
for step 1 to 5 do 
   Grid[Launch](MyCode, numnodes=4, imports=[BlockOf2000data], ...):  
   
# MyCode uses only one quarter of this 2000 data block depending on the processor number it runs on
end do:

Does it exist a way to clean the memory just before the "end do" command in order to avoid it to grow continuously ?


Any contribution will be highly appreciated.

The expression exp(2*t) gives us the number e^(2t). Can we get rid of the parentheses around 2t?
Thank you!

mapleatha

 

Hello,

I hope my question is not to general. I have a polynomial of 8th order

expression:=a8(z) * x^8 + .... + a1(z) * x + a0(z) = 0

on which I am using solve/RootOf

sol:=[solve(expression,x)]

Now when I plot it against z the solution has a jump, why?

When deriving the polynomial I could as well have used another variable instead of x above, say y. These two are related by a function...Then when I write down the 8th order polynomial in y and use RootOf/solve, then no jump occurs.

Is there a way to handle this because left of the jump the solution is not correct while right of it, it is...

Hello,

I wann to send a file  with FTP. I need an example how to do this with URL post.

 

Thanks

I have 3 given square matrices A, B, C. I would like to print

A*B = C,

where A, B, C are replaced by their values, but the multiplication is not executed.
How do I do it?

Thank you!

mapleatha

thank you for helping!! 

Hi, I'm trying to display (print / typeset) a vector of derivatives where an overdot is used instead of d/dt and the dependent variable is hidden.  For a single variable 

Suppress(x(t)):
diff(x(t),t);

Gives the desired result, but

Suppress(x(t)):
Suppress(y(t)):

<diff(x(t),t),diff(y(t),t)>;

doesn't.  I presume the vector/matrix package is doing something to the formatting?  Any help would be appreciated. Thanks.

Dears,  I have a questian about the fieldplot. 

I use the following 

with(plots):

fieldplot([x^2+y^2, 3*sin(x)-y^2], x = -1 .. 1, y = -1 .. 1, arrows = SLIM, color = x) ;

The domain is bounded from x = -1 .. 1, y = -1 .. 1.

Now, I want to use the same order to plot this function over a pentagon definde as 

with(plots):

Q11R := plottools[polygon]([[0, -1], [3/4, -1], [1, 0], [3/4, 1], [0, 1]], style = line, thickness = 3);

plots[display](Q11R, size = [.3, .5]).

I hope that I can find help.

Amr

 

I have a coupled pair of anharmonic oscillators and need to calculate the stability matrix and find the lyaupanov exponent for how the nearby trajectories diverge. In particular, I have the Hamiltonian

H = (p1^2+p2^2 + q1^4+q2^4 + 12*q1^2*q2^2 )/2

and I need to compute the matrix M given by

dM/dt = J*Hess*M

where J := Matrix(4,4,[0,0,1,0,  0,0,0,1,  -1,0,0,0,  0,-1,0,0]), and the Hessian takes the form:

Matrix(4,4, [6*q1_12(t)^2 + 12*Q2_12(t)^2, 2*12*Q1_12(t)*Q2_12(t),0,0,   2*12*Q1_12(t)*Q2_12(t), 6*Q2_12(t)^2 + 12*q1_12(t)^2,0,0,    0,0,1,0,    0,0,0,1])

The solver finds the trajectories of p1,p2,q1,q2 fine, but I don't seem to find a way to incorporate their solutions as inputs to reevaluate the Hessian at each time step. I read through https://www.maplesoft.com/support/help/Maple/view.aspx?path=DEtools%2fmatrixDE and the dsolve since I'm trying to do this numerically.

I thought I could get around this just by resolving the trajectories, but it's spitting out an error that arrays must be initialized with lists.

The actual code is here: AMO_HW4.mw

Sorry, I still need to clean it up a bit. Any help would be appreciated. I need to calculate M(t), then calculate the matrix norm and find the exponent.

 

 

 

 

Hello. I'm trying to calculate some RMS values for a school project. I've double and tripple checked that the forms and units are correctly entered, but it keeps giving me a result that is not convertable to the unit that i know it should output.
 

I've uploaded the file aswell as a picture of the project below:

Analyse.mw

Image: here
File on google drive: here

 

File is updated to include the answer from epostma 1299 , and (almost) works like charm (With exception of the possibility to convert the output unit)

Here is an image of my attempt with the piecewise functionality:

Image: here

 

 

seq(i[1], i[1] = 1 .. 2);
i[1];
                              1, 2
                               2

I thought the note saying "The index variable i is NOT private to the seq invocation" referred only to parallel code.

Several years ago, acer posted a topic on how to overcome the limitation of hardware precision plotting drivers in Maple:

https://www.mapleprimes.com/posts/100884-Precision-And-Plot-Drivers

Currently, I want to plot (1-x)^(10^9) in the range of 0..10^(-15) smoothly.

plot((1-x)^(10^9), x=0..10^(-15)) does not work. Is there an updated option to this in Maple since 2011? 

 

How do I simplify the integral,  where a(u) and b(u) are T-periodic and s,t belongs to the interval [0,T]

I have been using CodeTools::Usage with Maple 17 to compare timings of a couple of matrix inversion routines against each other and against the Maple library routines LinearAlgebra::MatrixInverse and LinearAlgebra::Determinant.

The small section of code that I use to collect the cpu times for each method is:

----------------------------------------

udata := Usage(invTest(x,y,z,delta,mu), output=['cputime', 'bytesused'],
              iterations=nRepeats, quiet);
dat[1]:=udata[1]; dat[2]:=udata[2];

----------------------------------------
nRepeats has been set to 25.

In order to get the timings as accurate as possible, I only open a couple of terminal windows on my laptop so as to run the tests with as low a loaded machine as I can get. (I'm running Ubuntu 14.04 on an 8 core Intel (R) Core i7-3840QM, 2.8GHz CPU with 16Gb of memory.)

A test run consists of a sequence of test matrices each of which is run for an increasing sequence of matrix orders. I either time an implementation on its own or I time both an implementation and the Maple library routines. In the later case for each test matrix and order of matrix, I use Usage to first time the Maple routines and then the times for one of the implementations:

----------------------------------------

if compMaple then
udata := Usage(MatrixInverse(A), output=['cputime', 'bytesused'],
              iterations=nRepeats, quiet);
mdat[1]:=udata[1]; mdat[2]:=udata[2];

udata := Usage(Determinant(A), output=[cputime, bytesused],
              iterations=nRepeats, quiet);
mdat[1]:=mdat[1]+udata[1];
mdat[2]:=mdat[2]+udata[2];
else
  mdat[1..2] := 0:
end if:

udata := Usage(invTest(x,y,z,delta,mu), output=['cputime', 'bytesused'],
              iterations=nRepeats, quiet);
dat[1]:=udata[1]; dat[2]:=udata[2];

----------------------------------------

I have noticed the following:

a) If I time both Maple and an implementation, and the same implementation on its own I can get timings that vary up to a factor of 2 or more,

b) Changes in timings for the same test run and as close to the same environment as I can get (i.e., just the two user terminal windows open) can generate timing differences of up to 50%.

c) Sometimes `chaotic' timings are generated, for example,

    n = 150, t = 3 (secs)
    n = 200, t = 24 (secs)
    n = 250, t = 18 (secs)

which cannot be reflecting the times required to perform the calculations. This type of behaviour always seems to occur when the reported memory bytecount is increasing from ~0.25* 10^9 to over 10^9.

Is there anything I can be doing here to get more consistent timings?

I want to use the timings from these tests in a journal article so it would be good to have the same test run under very similar conditions to return timings within a few percent difference of one another. I certainly get this sort of tolerances (<10%) if I use the Fortran cpu_time intrinsic to time Fortran code.

Any advice would be gratefully received.

First 914 915 916 917 918 919 920 Last Page 916 of 2428