mmcdara

7891 Reputation

22 Badges

9 years, 63 days

MaplePrimes Activity


These are replies submitted by mmcdara

@vv 

I seemed to remember something like that, but I wasn't sure.
Isn't there a comparable result on a rectangular billiard table of dimensions A and B? Something of the type "the trajectories are periodic if the initial direction (U,V) of the ball is such that U/V and A/B are ????" and dense if ????

By the way: in my example the trajectory is not dense?

--------------------- completed a few minutes later

I understand why I was mistaken.
A main topic of Statistics i Sensativity Analysis whose aim is to assess the "sensitivity" of a function f(p1, p2, ..., pN) to its parameters or combination of parameters.
The FAST (Fourier Amplitude Sensitivity Testing Fourier_amplitude_sensitivity_testing)  method.
It relies upon a specific sampling strategy where points are uniformly distributed over the square (in 2D of course) [-1, 1]^2.
Basically:

  • Let T a Uniform Random Variable sith support [0, 2*Pi] 
  • Let U = arcsin(sin(a*T)) and V = arcsin(sin(b*T))
  • Let {t1, ..., tN} a sample of T
  • Then {(un, vn), n=1..N} densely fills the square [-1, 1]^2 as N tends to oo iif a and b are not commensurate (which corresponds to what you said).

For a reason I never paid attention to, the values of a and b are usually taken as different prime numbers, which means that the denseness is not strictly verified;
I guess FAST is never used with non rational frequencies  a and b because limited precision in floating point representations makes this impossible: so people are satisfied with an approximate denseness and use (large) prime integers.

I agree with vv.
For the elder of us they are these beautiful curves we used to see on oscilloscope screen during electrical experiments at school.
For special cases of m and n these curves are dense in the unit square [-1,1]^2

plot([sin(127/11*t), sin(63/5*t), t=0..200*Pi], color=gray, transparency=0.7);

 

@Carl Love 
done (even if I have vote up for your initial answer and not for your last reply)

@Carl Love 
I think it would be helpful if this kind of detailed information that some of you provide could be archived somewhere and easily accessible to users.

@Carl Love @Kitonum
Hi,

I had thought using patmatch but I didn't find a simple way to use it.
The problem comes from the fact that c*x^a (for instance) is not of the form c*x^a*y^0.
Separating all the different "degenerated" forms of c*x^a*y^b is feasible if you have only two indeterminates (x and y)

restart;
P:=randpoly([x,y]) +123;
        3         2  2       4       2       2             
    -4 x  y - 83 x  y  - 10 y  + 97 x  - 73 y  - 62 x + 123
map(u -> if patmatch(u, (c::realcons)*x^(a::realcons)*y^(b::realcons), 'abc') then 
           eval([[a, b], c], abc) 
         elif patmatch(u, (c::realcons)*x^(a::realcons), 'abc') then 
           eval([[a, 0], c], abc) 
         elif patmatch(u, (c::realcons)*y^(b::realcons), 'abc') then 
           eval([[0, b], c], abc) 
         elif patmatch(u, (c::realcons), 'abc') then 
           eval([[0, 0], c], abc) 
         end if, 
         [op(P)]
)
  [[[3, 1], -4], [[2, 2], -83], [[0, 4], -10], [[2, 0], 97], 

    [[0, 2], -73], [[1, 0], -62], [[0, 0], 123]]


So my question : could we use patmatch  to answer the problem?

Very impressive work!
I know almost nothing about chemistry but I had a lot of pleasure tio read the full pdf.
Of course I vote up.

 

@acer 
The very first sentence of my Answer states that pf is a table...
Right, but I've never realized this.
I think it's because I try to never use variables whose type is implicitly defined by the context (such as pf[i] := ...)
Probably an overcaution due to the fact that even after several years of using Maple I am still an amateur, or a habit inherited from other languages.
This was only after Carl's reply that I used whattype(pf) to see pf was a table.

What confused me is that pf := 'pf' is an unevaluation of pf, not a declaration of pf as a table (as Carl suggested), it looks like "let's let Maple do it, he'll find the right type by itself".

By the way, why doesn't Maple affect the type Vector to pf? id it because table is more general a type?

@Carl Love 

Thanks Carl.
I hadn't realized pf was a table.
In fact I never write things like this and thus I never wonder myself what type pf might have here

restart:
for i from 1 to 3 do
pf[i] := i^2:
end do:

I  always something like this depending on the structure I want for pf.

restart:
pf := table([]):  # I undesrtood pf:=table() is enough
for i from 1 to 3 do
pf[i] := i^2:
end do:

#---- or 

restart:
pf := Vector(3):
for i from 1 to 3 do
pf[i] := i^2:
end do:

So having understood that pf is a table I understand why an explicit initialization should be needed.
 

@tomleslie 

Thanks Tom, 
I'm going to look to your file right now.
Unfortunately the dirichlet boundary conditions are not that simple (but there is some home for they are a sum of gaussians, and a gaussian is a very particular function for the heat equation).

 

 

@666 jvbasha 

Here is an updated version of contours_and_labels.mw
It introduces a gaussian filter to damp the oscillation the kriging model contains.
No pretention here, just the mood to give you some more ideas.
contours_and_labels_2.mw

@666 jvbasha 

Thanks for your feedback.
 

@666 jvbasha 

One solution before using Kitonum's code (see here 202222-Contour-Curves-With-Labels) is to build a continuous representation of the unknown function f : (x,y) --> z whose z values are gathered in your xls file.

You will find an example in the attached file.
It relies upon a particular interpolation reconstruction named Kriging, whose a simplified code is included in the file.
If you want a pretty rendering, with very smooth level curves there are chances you will be disappointed; but this comes more from the data themselves than from the strategy I used, even if a lot of improvements can be done.
Among them are:

  • A much clever choice of the level curves.
  • A prior transformation of the data ot make the ECDF (look inside the attached file) less sharp.
  • Adding a nugget effect to the Kriging interpolator introduces a natural smoothing (but the fact it might be inroduced or not depends on the origin of your data: if they come from experimental measurements then a nugget term can be justified, if they are values of some algebraic functions the nugget is just an artifact).
    A nugget effect transporms a Kriging interpolation in a  Kriging approximation (more or less in the same way that there exist interpolation splines and approximation splines) ; if your data are noisy, then introducing a nugget effect makes sense.
  • One can alo average a set of Kriging solution instead of bust using the one which gives the highest value of the likelihood, or condition the choice to the psi ranges by other means.
  • Use any other interpolation/approximation method which returns a function and not a colelction of points.


As you will see on the 3D plot the surface is almost everywhere flat excepted in narrow regions close to the boundary of the x-y domain. In the vast plain the  Kriging solution presents small oscillations which do not change the whole aspect of the surface but make extremely difficult, if possible, the plot of smooth level corves for small absolute values of z.

contours_and_labels.mw
 

@acer 

Hi, 
Is there a particular reason why you unevaluate pf just after the restart command?

@adel-00 

Your equation looks like some PDE written in spherical/polar cordinates[*] with revolution symetries (diff(u(r, theta, phi), theta)=diff(u(r, theta, phi), phi)=0)
If it is so r ranges from 0 to someting positive and changing r by abs(r) would be a wrong solution.
In this case the solution is to write symmetry conditions at r=0 (diff(u(r), r)|t=0 = 0)

But I could be wrong in my interpretation of your equation



[*] It's common to introduce an integer parameter alpha whose role is to provide a unique expression if the differential operators  in different coordinate sustems (alpha=2 -->spherical, alpha=1 --> polar/cylindrical.)

@vs140580 

I'm not sure that you have tried to understand the codes I sent you?
Or even that you have completely read all my answers?


If you use Maple 2020 (maybe it works with Maple 2019 too), look to the help page about LinearFit and search what informations can be returned.
Choose these one [parametervector, standarderrors, tvalue, tprobability].
And try to do something by yourself.

 


One more time read example.mw and example_4.mw.

Now I'm done, I hope you will find someone else with more patience.

PS: Do you know that a "complete" polynomial in p indeterminates, and with a total degree equal to d, have
K = (p+d)!/p!/d! coefficients?
And that K must not be larger than the number of observations for this polynomial to be identifiable?

First 88 89 90 91 92 93 94 Last Page 90 of 154