sand15

765 Reputation

11 Badges

10 years, 217 days

MaplePrimes Activity


These are replies submitted by sand15

@vv  I have just done those few elementary tests : all if them return the correct "true" answer

restart;

assume(r, positive):

assume(s, positive):           

is(r^2+s^2, positive);                                  

is(r^2+s^2 > 0);                   

restart:                               

is(r^2+s^2 > 0) assuming r > 0, s > 0;                   

is(r^2+s^2 > 0) assuming positive                      

@vv ...  unfortunately disappointing answer (Maple handles only relatively simple conditions when dealing with several variables)

Point [1]
Strangely I did not obtained a FAIL answer by using
is( r^2 - r*s + s^2> 0) assuming r >0, s>0;

or
assume(r>0): #or assume(r, positive)
assume(s>0): #or assume(s, positive)
is( r^2 - r*s + s^2> 0) ;


but always "false"

Note : even writing r^2 - r*s + s^2  in the following form   1/2*(r - s)^2 + (1/2)*(r^2  + s^2 ) has the same result (which suggests checking r^2+s^2 will also fail (?)).


Point [2]
I guess you refer to my auxiliary message  ?
            is(I, 'complex')                          # obviously true
            is(I, 'positive')                          # returns false
I know the set of real numbers is contained in the set of real numbers and, as a rule Maple operates over the latter , but how can Maple decide if a pure imaginary number is positive ? Or some complex number ?

Finally I did know the way you use assuming in the commang
is( r^2 - r*s + s^2> 0) assuming positive;
What are the inderterminates "assuming positive" refers to ?

Thanks again for the time spent

assume(r, 'positive')
is(r, 'complex')                 # returns  true, just as coulditbe does too
                                        # Is this suggest that being 'positive' is consistent with being complex ?

Now let's try this
is(I, 'complex')                          # obviously true
is(I, 'positive')                           # returns false

then an object of complex type is not positive (at first hand I would have thought Maple will return FAIL ???)
 

@Markiyan Hirnyk I will remember that

@Kitonum ... I should have find this by myself !

Nevertheless thank vou for reminding me my dumbness :-)

@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)

First 18 19 20 21 22 23 24 Page 20 of 24