sand15

1648 Reputation

16 Badges

11 years, 271 days

MaplePrimes Activity


These are replies submitted by sand15

It would have been better to represent the hanged rope upside-down. After all it is equilibrium figure of a non-stretch rope with no flexion rigidity  suspended between two fixed points (a high voltage cable or a clothesline are only approximated catenoids because their bending stiffness are not null).
A chain, as long as we neglect the friction between its links, is a better physical example of a "cable" with zero bending stiffness (see for instance Wiki).
Your parabola-vs-catenary figure is more appropriate to the construction of arches (ibid "catenary arches"). Note that apart from the Gateway Arch at the Jefferson National Expansion Memorial—which is a true catenary whose equation is based on considerations of material strength—Gaudí’s famous catenary arches are based solely on aesthetic considerations (the optimal form of an arch supporting more than its proper weight is not a catenary, it is the cableway configuration corresponding to the loading system).

Note that a 3D catenoid is also the equilibrium shape a soap bubble can take under some conditions, see for instance Salkin et al..

  The equilibrium shape of a "rope" of infinite rigidity would be a straight line while a rope with infinite elasticity (meaning it cn be strteched without no resistant effort) would have a ⨆ shape.

Splines approximators or interpolators may also be viewed as "path between points which minimize energy" (at least for most of them). Here the energy is the elastic energy. Tens of years ago "splines" were thin wooden slats bended by lead weights that draftmen used to draw smooth curves. Indeed these "splines" took on a shape that minimized the bending energy produced by their deformations induced by the lead weights (Splines as physical objects).
One 3D generalization is offered by Thin plate splines.

Here is a simple Maple code to find ("One round" case only) the poisoned bottle given the dead mice numbers:

# Number of mice

n := 10:

# Generate a random sequence of dead mice

mice_dead := sort(combinat:-randperm([$1..n])[1..rand(1..n)()]);
                  mice_dead := [3, 5, 9, 10]

# Deduce the number of the poisoned bottle

poisoned_bottle := add(2^(mice_dead[i]-1), i=1..numelems(mice_dead));
                  poisoned_bottle := 788

# Check the result: given the number of the poisoned bottle find the mice which are to die

b := < convert(poisoned_bottle, base, 2) >;
                   [0, 0, 1, 0, 1, 0, 0, 0, 1, 1]
mice_that_should_die := lhs~(op(b)[2]);
                   mice_that_should_die := {3, 5, 9, 10}

@C_R 

A counter example

U := [a, a, b];
V := [a, b, b];  # obviously not a permutation of list U

is(`minus`({U[]}, {V[]}) = {})
                              true



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

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