sand15

350 Reputation

10 Badges

5 years, 84 days

MaplePrimes Activity


These are questions asked by sand15

Hi everybody,

I solve an ODE system numerically with the command

Tend := ….. :
sol := dsolve(MySys, numeric, method=rosenbrock, range=0..Tend):    # or rkf45

One of my colleagues wants the solution in array form for using it in a spreadsheet (namely Excel). 
Here is an example of what I do :
 
data := plottools:-getdata( plots:-odeplot(sol, […..], 0..Tend, refine = Q) )
:  # Q rational
result := data[3]:
ExcelTools:-Export (result, …)


To understand the following, you need to know that
the time step varies by several decades (at least 3 or 4). and that  numfun
is typically in the order of 10^5
 
When I ask Maple to construct  data , Maple seems to sample the solution 
sol
according to the local time step dsolve has selected (and probably some other parameters ?)
Because this time step varies in very large proportions, the result is sometimes a concentration of points in regions where the solution is rapidly changing (which is desirable) … with some lacunarity in slow varying regions.

To obviate this, sometimes  poor appearance, I used to force Maple to compute the solution by regularly sampling the range
]0, Tend[  and combining this array with the original one (result
).
But this not satisfactory for I do not avoid lacunarity region (unless I proceed in some ad hoc way)

Here is my question :
Could you give me some elements about  the way odeplot adapts its sampling strategy according to the local time step, the budget N (the Q value I guess) and maybe numfun
?

Thank you in advance

Hello everyone,

 

Is it normal that commands #1 and #2 below do not return the same thing ?

 

L := [`Norman.Mailer`, `Richard.Brautigan`]

#1

map(u -> convert(u, string), L);

["Norman.Mailer", "Richard.Brautigan"]


#2

`convert/string`~(L)

["`Norman.Mailer`", "`Richard.Brautigan`"]


Side question : I am not really familiar with the tilde operator and I often use map instead.
Does it exist a better practice in these matters ?

Thanks in advance

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

First 13 14 15 16 17 18 Page 15 of 18