sand15

797 Reputation

11 Badges

10 years, 13 days

MaplePrimes Activity


These are questions asked by sand15

Hi everybody,

 

I would like to understand why the instruction

seq(X__k, k=1..2)

returns

Xk, Xk

and not X1, X2 ?

Is it possible to force the evaluation of X__k each time k changes in the "seq" loop ?

 

Thank you for your explanations

Hi everybody,

This is a notional example.
I create a variable MyColor of type string, which contains some correct specification of a known color.
Two examples are
    MyColor := "CSS Red";            
    MyColor := "Resene LaRioja":

In the ColorTools package there exist a few couples of (a priori) reciprocal functions, for instance NameToRGB24 and RGB24ToName.
So I can expect that composing one of this function with its reciprocal is a neutral operation.

But, if I apply first  NameToRGB24 to a well formed MyColor color and next thits reciprocal RGB24ToName , I do not recover MyColor ... or at least not all the time


Example 1 : 
with(ColorTools):
MyColor := "CSS Red";    
RGB24ToName ( NameToRGB24 (MyColor) ); 
     "Red"

Let us observe the loss of the palette name ...


Example 2 : 
MyColor := "Resene LaRioja";    
NameToRGB24 (MyColor) ); 
      [179, 193, 16]
RGB24ToName ( % ); 
     error, (in ColorTools) unknown RGB color [179, 193, 16]


It seems that RGB24ToName ( NameToRGB24 (MyColor) ); works correctly only if MyColor refers to a color from palette CSS. This seems consisttent with the loss of the palette name in example 1 and the presence of the word RGB (and not RGB24) in this error message.
More generally, for colors from other palettes than CSS the same kind of error is returned (I did not do intensive testing ...)

Is this an error,
   or some limitation I missed,
      or an improper use of RGB24ToName ?

I look forward to your response

 

 

 

Hi everybody,

 

For at least one function (I haven’t done extensive testing), the package Logic behaves differently in Maple 2015.0 and maple 2016.0

 
Maple 2015.0 :
Logic:-Tautology(true);
      true

Maple 2016.0
Logic:-Tautology(true);
      Error, (in sprint) integer expected for integer format   ????     (??? are mine)

For information :
1)  Logic:-Contradiction(true) retruns false for both 2015.0 and 2016.0
2) OS : Windows 7

 

Is there some modification of the “Logic” package that  I have  missed ?

 

Thanks in advance

 Hi everybody,

Until recently I was using Maple 2015.0 on this PC :

Windows XP
2 dual core proc Intel(R) Xeon(R) CPU E3-1225 V2 ; 3.19 GHz
64 bytes,
16 Go RAM

For two days now I am using Maple 2015.0 on this one

Windows 7
4 dual core proc Intel(R) Xeon(R) CPU 5-2637 V3 ; 3.50 GHz
64 bytes,
64 Go RAM


Comparisons of the running times for exactly the same code, consisting in 10000 independent Monte Carlo  simulations distributed over all the nodes (resp 4 and 8) give :

Windows XP :  504 sec  (with a variation of the order of  +/- 3s for different replicates)

Windows 7   :  343 sec  (with a variation of the order of  +/- 3s for different replicates)


The expected running time should be 504 * (3.2/3.5) * (4/8) = 230 s
(or 504 * (4/8) = 252 s if you neglect the acceleration due to the clock rate)
The realized running time (343 s) is thus at least  40% larger than the expected one.


Does anybody has already observed this kind of performance loss during XP -> 7 migration ?
Are there some comparisons of cpu times between Windows XP and 7 ?


Thank you all for sharing your own experience.



postscript : a NOTIONALexample of how the computations are distributed is given below

NbOfRuns := 10000:

# Data is a Matix(NbOfRuns, NbOfCols, …) constructed elsewhere

NbOfNodes := Grid:-NumNodes():
NbOfRunsPerNode := NbOfRuns / NbOfNodes:
for k from 0 to NbOfNodes do
   FirstData := 1 + k * NbOfRunsPerNode:
   LastData := (k+1) * NbOfRunsPerNode:
   Grid:-Run(k+1, MyCode, [Data[FirstData..LastData, ..], …])
end do:

Hi everybody, 
 
 My goal is to generate the Matlab code of some Maple function f(x, a, b, …).

The command
  CodeGeneration[Matlab](f, output=string) 
first produces the warning

Warning, the following variable name replacements  were made : a -> cg, b -> cg1, …

plus the desired code

freturn :=f(x, cg, cg1, …)
….
end

As you see here the names a, b, … are no longer arguments of f.

I  have searched in the help pages for CodeGeneration (but with no success at all),  a way to force the translation to conserve the original variable names (a, b, …).

First question : Did I missed the information ?
                            (in which case sorry for the inconvenience)
 
Second question
: If not, does it exist a way to “catch” the warning and thus keep the replacement rules CodeGeneration does ?

Thanks in advance

First 17 18 19 20 21 22 Page 19 of 22