mmcdara

7229 Reputation

18 Badges

8 years, 253 days

MaplePrimes Activity


These are questions asked by mmcdara

Hi,

I am a little bit surprised by the result of the operation evalf[8](f(y)) in the piece of code that follows.
I was expected the answer to be 2.4494897, not 2.4494898.

Happily the sequence
res := f(y) ; evalf[8](res)
returns the expected result 2.4494897

I suspect the difference comes from some precedence of the operators (f and evalf) but I can't figure out what really happens

Could you enlight me please ?

Thanks in advance

 

restart:

interface(version);

`Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895`

(1)

Digits;

10

(2)

f := x -> sqrt(2.0)*x;

proc (x) options operator, arrow; sqrt(2.0)*x end proc

(3)

y := sqrt(3.0):

f(y);

2.449489743

(4)

evalf[9](f(y));  # right

2.44948974

(5)

evalf[8](f(y));  # ????

2.4494898

(6)

res := f(y);
evalf[8](res);  # right

2.449489743

 

2.4494897

(7)

 

 

 

Hello everybody, 

I use Maple to obtain the solution of a reccurrence equation :
r := rsolve({u(n)=n*(u(n-1)+1), u(0)=0}, u)

Now I want to define a function s(n) wich returns the integer value of the nth term u(n).
In the attached file three different attempts to compute the numerical value of s(2) (you can replace "2" by any other positive integer) are given.

  • S := unapply(r, n);
     
  • S := unapply(convert(r, sum), n);
     
  • S := unapply(simplify(convert(r, sum)), n);


But none of them returns an integer and I'm always forced to apply some operation to "transform" the output into the desired integer.
Could you please help me to understand why it is so ?

Thanks in advance

2018.mw

 

Hi everibody 

I work with Maple 2015 under OS-X El Capitan.

Using more than one matrix vector product (either M.V  or MatrixVectorMultiply(M,V)  ; M is a n by p matrix and V a column vector of size p) within the same block of commands generates an error.

Do other people have the same problem ?
Thanks for your feedback.

SomethingGoesWrong.mw


PS : I know I can do this   X . <<1, 1, -1> | <-1, 2, 0>> but this doesn't explain the error I get

 

Hi everybody,

I want to solve numerically an ode and I get this error (undocumented on the maplesoft web site https://www.maplesoft.com/support/help/errors/....)

Error, (in sol) maximum number of event iterations reached (100) at t=2.6610663

I understand where this error can come from but the help pages don't say anything to fix this.
There is some stuff about round-off that could help but I don't understand how to use it.

I would be grateful if you provide me some help.
Thanks in advance


Download ErrorWithDsolve.mw

 

 

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.

First 42 43 44 45 46 Page 44 of 46