sand15

797 Reputation

11 Badges

10 years, 8 days

MaplePrimes Activity


These are questions asked by sand15

Hi everyone

I would like to unassign all  'user' variables but some of them.
More precisely, if 

  • MyVars := anames('user')
  • and KeepThese := {...} is some subset (manually constructed) of MyVars

I was thinking to something like
for k in MyVars minus KeepThese  do
   k := 'k'   # or k := unassign('k')
end do;

... which (obviously) does not work as desired because 'k' refers to the variable of name k and not to the variable k represents.

How is it possible to fix this ?

Great thanks in advance

Hello everybody,

I develop a simulator of dynamical systems governed by ODE systems.
Thanks to intensive upstream testing I have already identified some "methods" that work well on some classes of systems and poorly for some others (here "method" is intented in the sense of dsolve(..., numeric, method=...)), but it is rather difficult to know in advance if method A will perform well or not, or if method B could be better ...
This is very classical.

On the other side, people this simulator is designed for, do not want to use directly MAPLE to  choose a method among all those it proposes,nor to adjust the many parameters some methods can have

The idea I have in mind is to facilitate their choice by developing a specific Maplet. This Maplet could take as a model the pane dsolve[interactive]() opens when you select the numerical solving strategy.
As far as possible I would like to customize this pane for it be closer to our own needs (specific options sholud be proposed as well as personal help pages)

So my questions:

1/  Is the corresponding code avaliable (I failed to find it while using showstat) ?
1'/ Incidentally, even if this simulator is designed for internal purposes alone, is there some kind of copyright or usage limitations of the code above ?
2/ Is it possible to obtain the list of all the avaliable methods (euler, rk4, gear, ...) without without constructing it manually ?
3/ Once a method is choosen, is it possible to obtain the list of all its options (here again without without constructing it manually) ?

Maybe a quite unusual request on this site but I would greatly appreciate any answer

Thanks in advance

Hi everybody

I have two tables, namely A and B, the entries of wich can also be tables ... and so on.
These two tables have the same structure in the following sense :

Viewing A or B as tree graphs GA and GB :

  1.  the set of the names of the vertices of GA is identical to the set of the names of the vertices of GB
  2. GA and GB have the same connectivities

For instance A and B below share the same structure
A := table([x=table([u=1]), y=table([v=table([p=2]), w=3]) )]
B := table([ x=table([u=4]), y=table([v=table([p=12]), w=3]) )]

But not do A and C
C := table([x=table([u=1]), y=table(v=2, w=3]) )]


Let p(s) some path in GA from its root to some terminal leaf s.
B being "structurally identical" to A, GB also contains p(s)
Returning to the original tables, p(s) corresponds to a multi-index [k1][k2]...[kn] and the "value" of s is then given by A [k1][k2]...[kn]) or, symbolically A[p(s)]

I adopt this definition for "A = B" :
A is said to be equal to B iif the entry of A[p(s)] equals B[p(s)] for all the terminal leaves s
(here equals is intended in the "classical" senses, ie 3=3, {1,2}={2,1}, ...)
 

How can I check if "A=B" in the following sense ?

Thanks in advance

PS : Keeping in mind the analogy between A and GA, I have written a recursive procedure to check if A=B. But it is rather lengthy and I wondered if there could exist some Maple function to do this test ?


 

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

First 16 17 18 19 20 21 22 Page 18 of 22