mmcdara

7601 Reputation

22 Badges

8 years, 324 days

MaplePrimes Activity


These are replies submitted by mmcdara

@acer 
(from sand15's home-alias)

The example given in the help pages, even with a legend on the first plot, works perfectly at home

Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895
(imac)

 

@Preben Alsholm 

Unfortunately  I'll be unavaliable for two days to study your reply.
I'll will contact you again as soon as possible.

Thanks for the help

@vv 

 

Do you mean: why do I do this

ff:=x->2*x+3;
M := module()
  option package;
  export f;
  f:=eval(:-ff);
end module:

instead of this  

M := module()
  option package;
  export f;
  f:=eval(:-ff);
end module:
ff:=x->2*x+3:

?

The answer is: just because I found this method somewhere here, years ago.

However I'll be unavaliable for two days to investigate this point further.
I'll will contact you again as soon as possible to clarify this.

Thanks for the help

@vv 
(different lognames but the same person, now out from my office)

I have tested your coding and I understand the different results it gives.
But it seems (maybe I did not examine the results with enough attention) that 

ff:=x->2*x+3;
M := module()
  option package;
  export f;
  f:=eval(:-ff);
end module:
#ff:=x->2*x+3:

returns the same things  ...

More of this, if the definitions of ff and M are done in a specific worksheet ending with the creation on an archive M.mla, and if M is used in a separate worksheet through the command with(M) (libname having been instanciated correctly), which is my case, should I have to expect 

#ff:=x->2*x+3;
M := module()
  option package;
  export f;
  f:=eval(:-ff);
end module:
ff:=x->2*x+3:

and 

ff:=x->2*x+3;
M := module()
  option package;
  export f;
  f:=eval(:-ff);
end module:
#ff:=x->2*x+3:


to behave differently ?

Thanks four your involvement
 

@Preben Alsholm 

(different lognames but the same person, now out from my office)

 

I proceed exactly as I understand you do.

More precisely : 

 

1/ I open an interactive Maple session (Maple 2015, Windows 7)

 

2/  I open the file MyModule.mw in worksheet W1 

     and the file Test.mw in a separate worksheet W2

     W1 is aimed to develop the package MyModule

     The code in W2 contains  the call to the procedure MyProc included in  MyModule

 

3/ W2 begins this way : 

     restart:

     MyLib := ….                           # the directory which contains  MyModule.mla 

     libname := MyLib, libname;    # should I have write lib name := libname, MyLib,  ?

     with(MyModule):

 

4/ W1 begins with a « restart » command and is organized this way :

     * the codes corresponding to the N procedures MyModule contains (each of them in a separate block)

     * a new block where the module MyModule is defined

     * a last block where the archive MyModule.mla  is created in the directory Mylib (the same name used in W2)

     

5/ Once MyModule.mla has been generated I return to W2.

 

    5.0/ I execute W1 up to the command MyProc(…), where MyProc is one of the N procedures MyModule contains.

           I’m not happy with the result it returns, so:

 

     5.1/ I go back to W1

     5.2/ I modify MyProc

     5.3/ I execute (!!!) the whole W1 worksheet 

            If MyLib already contains MyModule.mla, which is generally the case, this archive is destroyed 

            before a new might be created

            I verified in a third worksheet that MyModule.mla contains the modified procedure MyProc

 

     5.4/ I go back to W2.

            I insert a new block just after the one which contains the call to MyProc.

            This block contains 

                  unwith(MyModule);

                  package();             # to insure that MyModule has been « unwithed » … which is the case (***, see below)

                  with(MyModule);

 

            The command showstat(MyProc) keeps displaying the unmodified MyProc loaded by the first with(MyModule) 

             (point 3/ above).

            It all goes as if unwith(MyModule) + with(MyModule) was ineffective.

 

            *** More surprisingly, if I  execute the command MyProc(…) after unwith(MyModule) , I do not obtain the output 

                 MyProc(…) which would signify that  MyProc is unknown, but the same result I obtained at point 5.0 !?!?

 

 

PS : it is of course not a blocking situation for I can always execute the W2 worksheet from its first « restart » command to the MyProc(…).

        It’ is more something which is troubling me...

@Mariusz Iwaniuk 

Thank you, 

best regards

@Mariusz Iwaniuk 

 

S := (a,d) -> sum((a+d*k)^(r), k=1..infinity):
S(a, d) - S(f0, f1)

Nevertheless I'm surprised by the opposite signs of d*n in

Zeta(0, -r, (d*n+a+d)/d)

between Mathematica and I : probably some mistake on my side ???

Best regards

 

@John SREH 

English not being my native language I didn't truly understand the meaning of "you're smart as bait" (translators seem to suggest it could even be insulting).

Whatever !
Adapt this to your specific needs

LX   := 1:
LY   := 1:
NX   := 20:
NY   := 20:

p    := pds:-plot3d(x=0..LX,y=0..LY, grid=[NX, NY]):
data := plottools:-getdata(p)[3];

Xgrid := Vector[column](NX*NY, [evalf(seq(seq(0..LX, LX/(NX-1)), k=1..NY))] );
Ygrid := Vector[column](NX*NY, [evalf(seq(seq(k, m=1..NY), k=1..NX))] ); 

DATA := < Xgrid | Ygrid | convert(data, Vector[column]) >


Next use writedata, ExportMatrix, save, or whatever you want to write the matrix DATA in some file

 

@Kitonum 

You inderstood the question as "find the solution of an ODE over some range [h, R0], given 2 Dirichlet boundary conditions".
Maybe it is what the OP asked for, but it's written 

So you can also interpret the question this way : find a function which "passes" by the points (h, U1) and (R0, U2), such that
in r=h and r=R0.
Some kind of "spline interpolation" problem. But an ill posed one because there exist an infinity of solutions while the class the function belongs has not been fixed.

For instance: assume h < R0 and c is such that h < c < R0
Then the function u(r) = U1 if r < c and U2 if r > 0 is a solution of the problem.


The original question is not at all clear.

PS : 
In your "ODE interpretation", the formal solution of 
is u(r) = A*log(r)+B where A and B are suitable constants (isotropic Laplace's equation in polar coordinates, no need to Maple to find the solution).
A and B are found by solving the system  A*log(h)+B=U1, A*log(R0)+B=U2.
If U1=U2 then A=0 and u(r)  is a constant function of value U1
If U1=U2=0 then u(r) is the nul function
 

Do you mean you're interested in the Sobol method for generating low discrepancy sequences ?

If it's the case there is no such algorithm in "public" Maple.
I'have coded something like that but for the Faure's Method (as you probably know there are several low discrepancy sequences algorithms and Sobol's is just one of them).

Let me know if you're interested in it.
Just a point : could this wait until Monday for I'm in weekend now ?

@Preben Alsholm 
 

It works perfectly well.
One more ime, thank you so much

@vv 

That's a good reason, I sould have asked the question to Fzen him/her-self

@tomleslie 

There is something that is not explicitely stated (unless yoy pay a lot of atention to the help pages and read between the lines).
I have read more carefully these help pages and I agree with your reply.



By the way : Why did I asked a question about  Grid[Server] ?
Briefly :
I have to read 100 files containing each a 20000x50 matrix of floats.
Using readdata on a single proc does the gob in about 10 minutes.

If I use the 8 'nodes' ( 4 cores, 2 threads/core) on my machine the reading task is done in about 2 minutes. But I need to transfer the read matrices (Grid[Get]) to the main node 0, which takes somewhat more than 1 minute.

Having these 100 matrix on the current node I can do some computations (typically drawing Boxplots and Histograms).
Unfortunately I receive a "connection to server lost" message, whereas the same job (reading task and drawings) run on a single processor works perfectly well (the issue is reproducible).

I suspect that some background child processes still run after each processor have return control to the main processor (if you use Windows it's easy to verify, through the task monitor, that the jobs run on processors 1 to 7 are not killed when they are finished) 
I thought that using Grid[Server] could provide me a better control of the situation

 

Thans for your help

 

 

@vv 
Strange that you call L the transposition of the lower triangular matrix in order to verify that L^* . L =A .

Why not simply write
L:=LinearAlgebra:-LUDecomposition(A, method='Cholesky')

A - L . L^*; # check  

 

 

@tomleslie 

Threads (package) is to be used as MPI for instance.
For instance you have a highly time consuming operation (lets say computing the solution of the huge linear system a finite element method can lead to) and you want to use a parallel algorithm to do it : Threads enables you to run parts (= threads) of this algorithm on different nodes (the distinction Maple does between bode ans processors or cores is not clear for me) and synchronize these threads to form the complete operation.

Grid (package) is to be used to run the same operation (with different inputs) on many processors/nodes
The best example is provided in the Maple help pages (Grid:-Launch) where prime factorization of several numbers are done in parallel.

The Grid Computing Toolbox (using here again the name "Grid" is not astute and a source of confusion), as you say, is necessary to run jobs in parallel on a cluster.
It extends to a much larger number of processors what  the Grid package does locally.
Contrary to the later, the Grid Computing Toolbox requires as many licenses as machines on the cluster.

As I write this I understand that my original question was unprecise.
Instead of writing "I use Grid Ppackage to do intensive computations" I should have write "I use Grid package to run similar computations on the different processors of my laptop"
Here I am exactly (for as far as I understand) in the scope of the package Grid (?).

 


 

First 143 144 145 146 147 148 149 Page 145 of 151