sand15

787 Reputation

11 Badges

9 years, 180 days

MaplePrimes Activity


These are replies submitted by sand15

@tomleslie  ... and I'm aware of that.
While maybe too radical, your suggestion  remains interesting.

Thanks

@John May  Nice way to proceed.

@tomleslie  Even if not complete I do appreciate your contribution

@acer   Great thanks to you for this very documented answer.

Concerning your last question, the answer is yes.
The worksheet is very small but it launches a whole computational code whose procedures print useful intermediate informations.
Once executed the worksheet mainly contains output results (possiblyredirected to a text file through the writeto command); using "printf"  thus enables a more readable "execution report".

@Markiyan Hirnyk 

In order to be prefectly clear, should I have mention that before using SetEdgeWeight I had used MakeWeighted ?

# G = some unweighted graph
WG := MakeWeighted(G)   # gives weights 1 to all edges in G
# link = some edge in WG
SetEdgeWeight(WG, link, infinity) # does not work

Is this sufficiently accurate for you ?

I thank you again for your first answer, all the rest is a waste of time
 

@Markiyan Hirnyk 

 

As I had already constructed an unweighted graph (not from its adjacency matrix), I found using the procedure  SetEdgeWeight was a simple and fast way go introduce weights.
But it does accept only numeric values as written in the Maple 2015' help pages (I did not try with Maple 2016)

It is unfortunate that MakeWeighted and SetEdgeWeight do not accept the same objects ...

Nevertheless I thank you for your useful solution

@acer 

 

Acer,
sorry to ask you again

I used your proposal but I keep having some troubles.
I think I should have been more precise in my request.

I am concerned by code regression testing.
The target code builds and solves ODE systems and I need to guarantee that successive releases do not degrade results obtained from a reference version.
When doing this with a Fortran or C code, you generally compare numerical results (arrays of floating point numbers).
My idea is to do regression testing on more “primitive” objects ; for instance the procedure dsolve(…, numeric) produces. However this requires the regression testing framework I use (based on Scala) is capable to “read” this primitive object.
So hoped something like

F := dsolve({diff(x(t)=t, t), numeric)
writeto(MyFile)     # some .txt file
showstat(F)


would work, but it does not.

Your proposal :

only writes  proc(rkf_45)  … end proc in the target file

@acer 

Great thanks to you acer for all those fruitful informations.

Thanks to you too @DSkoog 

 

 

@vv  At the very end, every user must be aware that rhe rules used by Maple do not necessarily fit his own culture or the rules used elsewhere, and that he must be very carefull with what maple returns.

Thanks for this interesting exchange

@Markiyan Hirnyk 

The value you obtain equals (2/3)*(1/3), which corresponds to the [def 2] of my previous comment (observation of a success after N=1 failures)

Point 1:
There exist two definitions of the Geometric distribution

  1. [def 1]  "N-1 failures followed by a success"
  2. [def 2]  "N failures followed by a success".

With p (probability of success) equal to 1/3 :

  1. [def 1]  gives (2/3)^4 * (1/3) = 16 / 729
  2. [def 2] gives (2/3)^5 * (1/3) = (32 / 729) * (1/3)

Redardless to the definition, the result "(32 / 729)" seems wrong.
But the result is not 0 neither

Point 2:
As you said, the value of the argument "N" must be an integer : a correct implementation should return an error if the number N of failures is not a POSITIVE INTEGER.
I thing you put your finger on the issue I am often railing against : Maple does not implement discrete distributions in a rigourous way and works on floationg points instead on integers.

@Carl Love 
Hi Carl,

Why did you not suggest to use  Statistics:-Sample(Uniform(-r, r), N) ?
Is it due to a reason of efficiency ?
Maybe RandomTools:-Generate is "lighter" than Statistics:-Sample in terms of memory size ?

Thank you for your answer

@Carl Love 

These double quotes is really a thing I do not master.

Thank you a lot
 

@Carl Love 

Thanks for this very clear position of yours.

My "should I suppress ?" question was motivated by the fact that the pseudo-solution I found looked more to tinkerink than to serious job.
The thing that bothered me in "suppressing"  was that someone (you) had already taken the trouble to make a response : obviously It would have been unsmart to delete the question without refering to you.
Thus my "I propose to suppress myself my question"  was an implicit request for your position.

Your answer is perfectly clear, the question will remain.

Thanks for this interesting exchange

@Carl Love 

Thanks Carl.

Probably I expressed myself poorly : I know that ?dsolve,numeric opens an help page where I can read the name of all the methods, but what  I was asking for was "does it exist a variable of type list (for instance), somewhere in the MAPLE librairies, which conains all these names and that I could retrieuse ?
Otherwise I have to construct this list manually (ok this one is not too long).
But look to the options of the methods (rkf45 has 27 options for example).



In fact I was coming back on Mapleprimes to suppress this question for I have found some tricks to retrieve the desired informations
For instance :  dsolve(..., numeric, method = bob)
returns an error messsage which contains the list of all the known methods : it is then a very simple thing to copy/paste this message in any text file and keep only the list of the names.
Likewise dsolve(..., numeric, method = rkf45, alice=bob) returns an error message which contains the list of all the avaliable options of method rkf45.
After some tens of minutes I had recovered all the informations I was looking for.

Concerning the dsolve[interactive]() pane it was a little bit longer, but the maplet builder assistant helped me a lot.


I propose to suppress myself my question , is it a common practice here ?


Sorry for the inconvenience

First 19 20 21 22 23 24 Page 21 of 24