sand15

1648 Reputation

16 Badges

11 years, 228 days

MaplePrimes Activity


These are replies submitted by sand15



Etienne Ghys recently wrote an excellent biook (2023, in French, I don't think any english version is avaliable) about the history, the mathematics and physics of the soccer ball titled La petite histoire du ballon de foot (A Brief History of the Soccer Ball).

There is also this video (in French too, but you should be able to activate the automatic translation in English)  where Etienne Ghys gives a lecture at the IHES about the soccer ball.

If you really want to have a good laugh got to time 7:30 to see how soccer places are signaled on British roads

and listen the conference: the soccer ball geometry being obviously wrong,  "... a petition signed by 25,000 British mathematicians called for these road signs to be changed... to which the British government replied that its role was not to teach geometry."

British humor?


To end this, your work with Maple is very impressive.


For the anecdote, British government does really have some problems with science (Frenchies love to make fun of the Brits, who return the favor :-) ):

 



The main package you should use is the  Statistics package (run command help(Statistics) to see what functions are implemented).
There is also the Student[Statistics] subpackage which contains a few interesting functions which have not been included in  Statistics package.

Note also that some functions, which are commonly used in statistical analysis, can be found in other packages like, for instance:

  • Kriging (Interpolation package, watchout: this kriging implementation is the geostatistics' one, not the one used in computer code output analysis).
     
  • TimeSeriesAnalysis package.
     
  • Even if Statistics offers an implementation of the AutoCorrelation function, package SignalProcessing proposes another interesting one.
     
  • ScientificErrorAnalysis package is dedicated to first order mean and variance propagation (even if the implementation is very limited and quite questionable it may prove itself useful).
     
  • DeepLearning package contains some useful procedures for statistical data analysis (but I advice not to use it for advanced analysis for it is a very limited offer compared to Python's, Keras' and some others).

     

(2) Can Maple perform descriptive statistics, regression analysis, ANOVA, and hypothesis testing?
Yes, Maple can do this, but do not be too greedy, Maple is not a tool for statistical data analysis (for instance you will find linear and non linear regression in the least square sense, but no Ridge, LARS, PPR, Stepwise, PLS... regression).
The same way only One-Way ANOVA does exist (no two-way ANOVA).
The only resampling strategy is Bootstrap, (no LOO, LKO, Learn&Test strategy, which makes Maple quite limited [unless you code yourself those algorithms] to assess the quality of a model or to do model comparisons).


(3) Is Maple suitable for handling medium to large research datasets?
It depends on what is a large dataset for you.
I already used the Statistics package to analyse datasets represented by a 105 by 60 input matrix and 105 by 20 output matrix in a quite efficient (but I developped myself the corresponding analysis functions [sensitivity/reliability analysis, parallel plots, factorial analysis [[restricted to PCA in Maple]] and so on).
Huge datasets like those you may find in genomics are far beyond maple capabilities.


(4) Are there any examples or tutorials demonstrating statistical analysis workflows in Maple?
As a rule every functions from 
the Statistics packageprovides a few elementary examples to understand what you can do with them and how to use them.
I don't know if there exist any course specifically dedicated to statistical data analysis in Maple. I advice you to brose Youtube to try and find some.


At the end, keep in mind that Maple does not favorably compare to softwares/languages dedicated to statistical analysis (R for instance): Maple has a more general purpose than them and the Statistics package is only a package among many, note the central package around which maple has been developed.
Of course you always have the possibility to code yourself the function you desire (one example among many: the only GOF test avaliable is Statistics[ChiSquareGoodnessOfFitTest] but it is extremely simple to code the Kolmogorov-Smirnof GOF test)


If you give me more details about what you'd like to accomplish, I could offer you more solid advice.

 

@Karishma 

Issue fixed, thanks again.

It is interesting to observe that the cloud of points (Pi+1, Ai), where Pi+1 is the (i+1)th prime number and Ai = sqrt(Pi+1) - sqrt(Pi) seems to be made of multiple layers of hyperbolic shape:
                                
Nevertheless do not try to conjecture anything from this observation as it is a direct consequence of the distribution of the gaps between two consecutive prime numbers.
See the explanation here Layering.mw.

Although this layered structure may amuse some people, unfortunately there is neither magic nor any revolutionary mathematical result to publish.

Hi,

Both links you give return a code error 404.

@vv 

(y^2+1)/(x^4+y^4+1)

should be

(y^2+1)/(x^4+y^4+2)

After correction your result is  1.53978589107117

@Rouben Rostamian
vv accounted for the 'R' term in 

eval(f, [x=R*cos(t), y=R*sin(t)])*R

@nm 

Note that in the excerpt you provide it is written "We obviously have... u(∞)=0. By the latter we clearly mean lim(u(x), x=+∞)=0." ... which is nothing more than the author's confession of using a notational convention to achieve a more compact notation that is not mathematically rigorous.

You write later "I am here talking about using a CAS to solve an ode. Not about how one would write things for a math paper".
This is unbelievable: I get the impression that you would like Maple to solve a math problem that you haven't formulated correctly from a mathematical standpoint, all that just to ask you next why the solution isn't correct.
If you don't want to bother with mathematical rigor, you should try using some kind of AI to ask it how to solve your poorly formulated problem using Maple: perhaps it will interpret correctly some abusive notations and give you the way to proceed.

restart

kernelopts(version)

`Maple 2015.2, APPLE UNIVERSAL OSX, Dec 20 2015, Build ID 1097895`

(1)

# You wrote

ode:=diff(y(x),x$2)-y(x)=0;

IC:= y(0)=1,limit(y(x),x=infinity)=0;

sol:=dsolve([ode,IC])

 

diff(diff(y(x), x), x)-y(x) = 0

 

y(0) = 1, limit(y(x), x = infinity) = 0

 

Error, (in dsolve) invalid input: op expects 1 or 2 arguments, but received 0

 

# I write

ode:=diff(y(x),x$2)-y(x)=0;

IC:= y(0)=1, y(L) = 0;

sol:=dsolve([ode,IC]);
limit(sol, L = +infinity)

diff(diff(y(x), x), x)-y(x) = 0

 

y(0) = 1, y(L) = 0

 

y(x) = exp(L)*exp(-x)/(-exp(-L)+exp(L))-exp(-L)*exp(x)/(-exp(-L)+exp(L))

 

y(x) = exp(-x)

(2)

# Same limits whatever the path taken to {x -> +infinity, L -> + infinity, x < L}

limit(limit(eval(sol, x = t*L), t = 1, left), L = +infinity);
limit(limit(eval(sol, x = t*L), L = +infinity), t = 1, left);

limit(limit(eval(sol, x = t*L), t = a, left), L = +infinity);
eval(%) assuming a > 0, a < 1

limit(y(L), L = infinity) = 0

 

limit(y(L), L = infinity) = 0

 

limit(y(a*L), L = infinity) = limit(exp(L)*exp(-a*L)/(-exp(-L)+exp(L))-exp(-L)*exp(a*L)/(-exp(-L)+exp(L)), L = infinity)

 

limit(y(a*L), L = infinity) = 0

(3)
 

 

Download My_point_of_view.mw

Note: had you interested in numerical solution of odes (pdes) with boundary conditions at infinity, you should chose some right boundary L >> C (usually based on a dimension analysis of these odes/pdes and the identification of some characteristic length C) and solve these odes/pdes on a bounded domain with extension L in the "infinite" direction.
Next, to ensure your choice of L wascorrect, you should solve again this same poblem for a larger value of L and verify its solutions is almost the same of the one you got earlier.
Another way, more technical bur lore correct, is to reformulate your problem using the Integral Equations Method (largely used in electromagnetism for instance).

What I did above, using the lright boundary L and making it tend to infinity, is nothing but what any people solving numerically this ode would do (solve it for L = L1 and L = L2 > L1, look at the differences between the solutions and if sol(L2) - sol(L1) is larger than some quantity solve the ode for L = L3 > L2 ... and proceed until convergence).
See below.

restart

kernelopts(version)

`Maple 2015.2, APPLE UNIVERSAL OSX, Dec 20 2015, Build ID 1097895`

(1)

ode:=diff(y(x),x$2)-y(x)=0;

Ls := [$1..6];

for L in Ls do
  IC      := y(0)=1, y(L) = 0;
  sol_||L :=dsolve([ode,IC], numeric);
end do:

col := table(Ls =~ [red, green, blue, black, gold, magenta]):

plots:-display(
  seq(
    plots:-odeplot(sol_||L, [x, y(x)], x=0..L, color=col[L], legend=typeset('L' = L), axis[2]=[mode=log])
    , L in Ls
  )
  , title="Solutions (log scale) for different values of L"
)

diff(diff(y(x), x), x)-y(x) = 0

 

[1, 2, 3, 4, 5, 6]

 

 

S := proc(L, s)
  if s::numeric then
    abs(eval(y(x), (sol_||L)(s)) - evalf(exp(-s)))
  else
    'procname(_passed)'
  end if:
end proc:

plots:-display(
  seq(
    plot(S(L, s), s=0..L, color=col[L], legend=typeset('L' = L), axis[2]=[mode=log])
    , L in Ls
  )
  , title="absolute value of the error compared with the exact solution"
)

 
 

 

Download Numerical_solution.mw

I'm always surprised to see someone writting such a boundary condition, more generally someone considering +∞ as an ordinary, which is not.
A correct writting should be limit(y(x), x=+∞) = y0.

Here is a little discussion 

restart

kernelopts(version)

`Maple 2015.2, APPLE UNIVERSAL OSX, Dec 20 2015, Build ID 1097895`

(1)

ode:=2*x^(1/2)*diff(y(x),x)-y(x) = -sin(x^(1/2))-cos(x^(1/2));

2*x^(1/2)*(diff(y(x), x))-y(x) = -sin(x^(1/2))-cos(x^(1/2))

(2)

# +oo is not a number but a name (see infinity help page), so I replace +infinity by L
# which I will make further to tend to +infinity

ic:=y(L) = y__0;
sol:=dsolve([ode,ic]);
odetest(sol,[ode,ic]);  # regardless the value of L

y(L) = y__0

 

y(x) = cos(x^(1/2))-exp(x^(1/2))*(-y__0+cos(L^(1/2)))/exp(L^(1/2))

 

[0, 0]

(3)

# Now replace x by t*L, make t tend to 1 and make the result tend to +oo

tsol  := eval(rhs(sol), x=t*L):
limit(tsol, t = 1, left);
limit(%, L=+infinity);

y__0

 

y__0

(4)

# Still with x=t*L, make L tend to +oo and make the result tend to +1

limit(tsol, L=+infinity);
limit(%, t = 1, left);    # a continuum of possible limits
 

limit(cos((t*L)^(1/2))-exp((t*L)^(1/2))*(-y__0+cos(L^(1/2)))/exp(L^(1/2)), L = infinity)

 

-2+y__0 .. 2+y__0

(5)

# Thus two different ways to compute the same limit and two different results.
# Consider 'sol' as a function F of x and L.
# What we saw is that the limit of F(x, L) when both x and L tend to +oo, with x < L,
# depends on the path taken to [+oo, +oo], which means F(x, L) doesn't have a limit.
#
# To get an idea of where the previous result came from, see how Maple returns the limit
# of a function whose limit is undefined

limit(cos(x), x=+infinity);

-1 .. 1

(6)

# By the way here is what Maple 2015 returns on your problem

ic:=y(+infinity) = y__0;
sol:=dsolve([ode,ic]):
odetest(sol,[ode,ic]);

y(infinity) = y__0

 

[0, y__0+undefined]

(7)
 

 

Download limit.mw

Note that your implicit question "Shouldn't Maple return no solution?" already holds for  the limit(cos(x), x=+∞) example. In my opinion the -1..1 result is a mathematical nonsense.

What I believe, and even if Maple does accept this syntax, is that you should never write something like y(+infinity) = y0  but adopt a tighter mathematical approach.

@acer  @Elisha

Based on acer's answer here are different ways to improve, IMO, the aesthetic of the figure

(
Remark: ColumnGraph places the first bar at abscissa "0", not "1", meaning acer's picture presents a shift between the bars and their associated tickmarks.
This "0" is not consistent with dataplot or matrixplot conventions (first bar or cell at location "1"). I believe future Maple version should uniformize this.
)

 

different_aesthetics.mw

For instance
       

I'm sure that other improvements can be done using recent Maple's versions (I use Maple 2015)


@Elisha: By the way, transforming a ColumnGraph into a BarGraph, and vice-versa can be done easily using plottools:-transform:

T := textplot(
  [
    [.4, 48, "45%"],   # The ".4" is the half of the default bar width (or height)
    [1.4, 41, "38%"], 
    [2.4, 54, "51%"], 
    [3.4, 70, "67%"], 
    [4.4, 77, "74%"], 
    [5.4, 94, "91%"]
  ], 
  font = ["TIMES", "BOLD", 12]
):

display(
  [
    plottools:-transform((x, y) -> [y, x])(P), 
    T
  ],
  title = "Figure 20: Comparative Effectiveness of Optimal Control Strategies", 
  labels = ["Control Strategies", "Reduction in Coinfection Burden (%)"], 
  labelfont = ["TIMES", "BOLD", 14], 
  titlefont = ["TIMES", "BOLD", 16], 
  axes = boxed, 
  gridlines = true, 
  view = [0..6, 0 .. 100], 
  size = [1000, 650]
)

which produces this

@bashar27

answer updated

@Alfred_F 

Here is a variant where a polygonal domain with non self-intersecting boundary is randomly drawn.
Random_Pick.mw

@Alfred_F 

First of all I missed a colon after restart.
If this does not fix the problem this is a version issue (I use Maple 2015).

If you are interested in Pick's theorem here is a (in my opinion) a very interesting document from the APMEP (Association des Professeurs de Mathématiques de l'Enseignement Public)  APMEP 516

@nm 

which avoids constructing  H_lines and V_lines:

restart:
max_X:=8: 
max_Y:=5:

grid_points:= [seq(seq([n,m],n=0..max_X),m=0..max_Y)]:
the_points := plots:-pointplot(grid_points, symbol=solidcircle, symbolsize=12, color=red):
plots:-display(
  the_points
  , title="my grid"
  , axis[1] = [gridlines = [max_X, color = blue]]
  , axis[2] = [gridlines = [max_Y, color = blue]]
  , scaling=constrained
);

@Ali Guzel  

restart;

with(plots):

T:=60:
Digits:=10:
epsilon:=20:

F:=(x,y)->epsilon*(1-x^2)*y-x:

sys:=diff(X(t),t)=Y(t),diff(Y(t),t)=F(X(t),Y(t)):

vars:={X(t),Y(t)}: ic:=X(0)=0.2,Y(0)=0.1:

pow := [$-4..-2]:

for p in pow do
  sol[p] := dsolve(
              [sys,ic]
              , numeric
              , stepsize=10^p
              , method=classical[foreuler]
              , output=listprocedure
              , maxfun=0
            ):
end do:

col := [red, green, blue]:

display(
  seq(
     odeplot(
       sol[p]
       , [t,X(t)]
       , 0..T
       , axes=normal
       , style=line
       , numpoints=n
       , labels=["t","x"]
       , color=col[abs(p)-1]
       , legend=typeset(h = cat(`#msup(mo("10"),mo("`, p, `"))`))
     )
     , p in pow
  )
)

 

default_sol := dsolve(
                 [sys,ic]
                 , numeric
                 , output=listprocedure
                 , maxfun=0
               ):

display(
  odeplot(
     sol[pow[1]]
     , [t,X(t)]
     , 0..T
     , axes=normal
     , style=line
     , numpoints=n
     , labels=["t","x"]
     , color=col[abs(pow[1])-1]
     , legend=typeset(h = cat(`#msup(mo("10"),mo("`, pow[1], `"))`))
   )
   ,
   odeplot(
     default_sol
     , [t,X(t)]
     , 0..T
     , axes=normal
     , style=line
     , labels=["t","x"]
     , color=gold, thickness=7, transparency=0.7
     , legend="default solver"
   )
  )

 
 

 

Download Are_you_aware_of_convergence_issues.mw

@Alfred_F 

Years ago I bought the first French translation (2015) of this famous book "What is mathematics? An elemenrtary approach to ideas and methods" by Richard Courant and Herbert Robbins (1941).

Its 1st chapter concerns the natural numbers and on line 9 of the the introductory paragraph (page 7) it is written nombres naturels1✻ ... (The footnote  says that the notes tagged with an asterisk are from the book's translator and are thus absent in the vernacular version of the book).
This note (1) can be read page 27 and I reproduce it here (I hope I'm not infringing copyright in doing so).
Note_1.pdf
There is also a discussion about positive, strictly positive and non negative numbers.
 

1 2 3 4 5 6 7 Last Page 1 of 42