mmcdara

7404 Reputation

20 Badges

8 years, 297 days

MaplePrimes Activity


These are replies submitted by mmcdara

@vv 
(copy to @Kitonum)

You wrote "abs is necessary because we want an unoriented area (Area(ABC) = Area(ACB))."

I'm not okay with that.
There are never two solutions as you say: either the solution is area(10)=4 Or (exclusive) it is area(10)=8 .
What makes a solution to be 4 or 8 is the fact that the area becomes 0 somewhere in betwwen 0 and 5, or not.

A correct expression of the solution should be

  • If the area is strictly positive in the range t=0..5, then the solution is 4
  • If it gets to 0 somewhere in between 9 and 5, then the area is 8.

(I didn't try to verify that if the area is strictly potitive in the range 0..5 then it remains strictly positive in the range 5..10 too.

So, in my opinion, using abs is not correct as it leads to 2 solutions

ABC_area_falls_to_0.mw

I don't know hot to get this piecewise solution with maple (I mean using built-in functions and without writing a procedure)

I use Maple for graphic purpose an for pretty displaus but it is not at all necessary (whas it a challenge to use it).

ABC.mw

Assuming all the velocities have the same sign we get by hand "the area at t=10 is equal to 4" (5 units of time increase the initial area by one then 10 units of time increase it by 2 as the transformation is a dilatation along rhe parallel lines)

Why does @vv code provide then two solutions?
Removing abs in line area := -> ... removes the second solution: is abs necessary?

@nm 

Did you find this by trial and error? Or was it by accident?
IThat's what I've always done, and I'd probably have been very confused if the reverse order hadn't produced the desired result.
In fact the Grid:-Set help page says "The Set command sets variables in remote parallel compute nodes." ... so I guess I found natural to do Grid:-Setup before Grid:-Set in order this latter command knowson which processors it has to set variables or procedures.
But yeah, I was also probably lucky.

Or do you think this is a bug I should report it?
I don't know, it seems to me there is som logic in placing Grid:-Setup before Grid:-Set, but one could also say that Grid:-Set is a kind of statement which tells all the nodes "hey, I'm going to use the function ...ok", and then Grid:-Setup declares the nodeswhich are going to be used.
Maybe it's not a bug, but surely an undocumented feature that should be reported.

@nm 

I did almost the same thing you did and got the same lack of results.
I tried using LibraryTools to display the Grid:-Run function and understand how the printer option works.
And, of course, advanced search is of no help.

Grid:-Run help page says:
The printer option specifies a procedure that will be called with a string every time there is a line of output available from an external computation. The printf command is the default if no custom procedure is supplied.   The printer is called with a single argument, a string, that represents intermediate printed output from each of the nodes.

I've tried unsuccessfuly to figure out how to use this option (no example provided in my 2015 version).

Maybe you will bemore astute than me.

@C_R 

The same feature exists with Maple 2015.
I'm gong to check if it fixes my issue.

Thanks for the tip.

@salim-barzani 

You can change the cokors as you want (things to play with are yellow highlighted in theattached file)

graph-density-adjusted_colors.mw

PLOT3D examples:

@acer 

That is exactly what I wanted.
More: the way you define T by modifying its font will be very useful to me for making more readable a training session about Statistics I'm working on.

PS: Sorry for the poor wording of my initial question.

@acer 

And I wouldn't have mentioned it.

My goal is to define a binary operator (T) .
I looked to the operator, binary help page and saw that &<name> was neutral binary operator neutral, but I git this

`&T`(a, b)
                             a &T b

So I thought 

(1) to use  define and write something like 

define(T, 'binary');

# and hoped to get 
T(a, b);
          a T b

but  'binary' is not a property of define.

(2) use an already existing binary operator, for instance union, and define an alias of it 

restart
alias(T=`union`):
`union`(a, b)
                            T(a, b)    # not a T b

Nevertheless your answer, like @dharr's are probably enough for me.

Thank you both.

@C_R 

Thanks for the encouragement.
I'll think about your suggestion but I think there may be other members here who are more qualified than me on the subject.

I got a master in signal processing about 35 years ago but ketp another route for years now.
So my memory is quite partial on the subject and my skills have slowly become blunt.

But I'll try to think about it

@C_R 

I bought more than 30 years ago an excellent introduction to chaos (in French) by Bergé, Pomeau and Vidal.
Here is the 1987 English edition (oldies but goodies)

Berge, Pierre; Pomeau, Yves; Vidal, Christian
Wiley-VCH, 1987
ISBN 10 : 0471849677 / ISBN 13 : 9780471849674

I don't now if a legit pdf version is avaliable for free online, but it is worth to be read, IMO.


"How should it be possible to prove chaos?"

There are basically two tests for chaos detection: the Lyapounov exponent test and the 0-1 test.
For a compared study see Lok.

Here is an excerpt from the conclusion of Lok's work :
Although the 0-1 test is much more general and is suitable for the analysis
of many different dynamical systems, including experimental data, the Lyapunov
Exponent test appears to be more elegant in understanding and in use, and has
some beneficial extra’s, for example it’s ability to show super attractive fixed points.
If a phase space reconstruction is possible, the Lyapunov Exponent test is highly
favorable, but if a phase space reconstruction is not possible, the 0-1 test can be
used



In the sequel I onsider only the 0-1 test for time issues.
A simple code for the Lyapounov exponent test is given in Lok page 12 [only when the derivative of the dynamical system is known, which makes this code useless for time series]; for more details I advice you to read Wolf et al , specifically paragraph
4 An approach to spectral estimation for experimental data [a Fortran code is given in appendix B]).

Basically the 0-1 test answers 0 (or something close) if the system is regular and 1 (or about) if it is chaotic.This test doesn't enable determining the periods of when the system is regular.
A few examples aboout the 0-1 test can be found  here.


 0-1_test_for_chaos_detection.mw  is a fairly elementary code to decide if the logistic map

f := (x, r) -> r*x*(1-x)

has a regular or chaotic regime depending on the value of r.
 

(performances were not of my concern when I wrote the code)

@C_R 

About the other tool you refer to.
A simple suggestion: did you look to the TimeSeriesAnalysis package? 
Maybe you will find some interested features like GetPeriod.

About the curve you display.
There is a huge difference between the Fourier transform of a function and the Fourier transform of a this same function regularly sampled.
For instance the function f : t --> f(t)=cos(t) defined over R cannot be sampled in the real world, that is resumed by a collection (tn, f(tn))  of points, that for three reasons:

  1. f(t) is not observable before some the timen let's say t=0, you decide to observe it.
  2. The observation of f(t) is necessarily finite.
  3. The sampling itself chnages the nature of the function.

The point 2 (point 1 is more technical) can be mathematically modeled this way:

  • Let WT(t) the function equal to 1 from t=0 to t=T and 0 elsewhere. This function denotes the observation window.
    The observed function can be written FT(t) = f(t) WT(t).
    So its Fourier transform is equal to the Fourier transform of  f(t) convoluted to the one of WT(t) : it is then clear that the original and observed functions have different Fourier transform... unless T is infinite.
     
  • The theory of Fourier transform says that an unbounded function has a bounded Fourier transform and that an unbounded function has a bounded Fourier transform.
    So, here, the Fourier transform of  f(t) is bounded, but the one of FT(t) is not.

About point 3:

  • The (regular) sampling process is modeled while using the Dirac Comb distribution Shap(t) where p is the sampling period.
    The sampled observed function writes FT,p(t) = FT(t) Shap(t) and thus its Fourier transform is equal to the convolution product of the Fourier transforms of FT(t) and Shap(t).
    One can prove that this later is anothr Dirac comp (with period 1/p) and that iots action on the Fourier transform of FT(t) corresponds to a periodization (with period 1/p) of this later.
    This is another reason why the true function and its sampling cannot have identical Fourier transforms (and thus autocorrelation functions).

Windowing_and_Sampling.mw illustrates how windowing and sampling modify the (real part of the) Fourier transform of a simple periodic signal.

The same way,  Windowing_and_Sampling_2.mw illustrates how windowing and sampling modify the (real part of the) Fourier transform of a simple periodic signal.

EDITED : The same worksheet as previously, augmented by a quick talk about the Nyquist-Shannon sampling theorem (reference wherein) Windowing_and_Sampling_2_Shannon.mw. This theorem is at thes same time quite obvious to demonstrate (inFrench we use the term condition instead of theorem) and extremely important from a practical point of view.
It often explains why the FFT of a function/signal, sampled with an arbitrary period, gives something which does not seem correct.

It is hard to operate on complex analytical expressions as no closed form of their Fourier transform may exist (which is why the FFT does exist).
So their autocorrelation function, which requires taking the inverse Fourier transform of the module of these Fourier transform is even more challenging to obtain.

Whatever, the purpose of these three worksheets is to show what happens when you compute the FFT of a limited portion of a signal. The red curves in the last plots can be interpreted as interpolations of the output of this FFT.
Note that the FFT computes only the part of the Fourier transform induced by the sampling period.

About the term "chaos".
I'm not sure a universal and consensual definition of what chaos is nor what chaotic means does exist.
It is generally admited that a dynamic regime is chaotic if its power spectrum contains a continuous part, a wide band, and possibly separatedand well defined rays (those latter being the signature of some almost periodic component).

To conclude this answer, forgive me if I've rehashed things you may already know.

Last updates: a few new materials
Windowing_and_Sampling_2_Shannon.mw
Sampling_period_1.mw
Sampling_period_2.mw
Aperiodic_Fourier_vs_FFT.mw
Periodic_Fourier_vs_FFT.mw

@acer 

To be honest, efficiency has never been one of my concerns when I opened this thread.
Until now, I'd been mainly interested in Monte Carlo integration methods (I recently asked a question about those), but the subject of efficiency came up thanks to your comment.
That's what led me to reread the help pages more carefully and discover that the method used by the default method could fork over into 1D integration.

Ultimately, this thread has probably taught me a lot more than I anticipated, and your comments, especially this last one, have had a lot to do with it.

Many thanks again.

Translated with DeepL.com (free version)

@acer 

You will find in this integration_order_effect_explained.mw  worksheet  the explanation (IMO) of the integration order effect you mentioned in your last comment.

Thanks for having put your finger on it.
I had never observed this myself before because I rarely use the default method in multiple integrations, forcind evalf/Int to use what I want it to use.

@acer 

Thank you acer, this is really helpfull.

You wrote: "I don't see the need to wrap it in a black-box..."
Agree, put out of context this is absolutely useless.
In a few words I'm using this stuff to explain aspects of the Monte-Carlo integration method in a post I'm working on. So I will aske you to be a little bit patient to understand why I integrate this characteristic function over the black-box domain instead of simply foing this

evalf[20](Int(1/(1+sinh(2*x)*ln(x)^2),x=0.8..3));

Thanks a lot, again 

2 3 4 5 6 7 8 Last Page 4 of 149