Gonzalo Garcia

75 Reputation

2 Badges

11 years, 176 days

MaplePrimes Activity

These are replies submitted by

@tomleslie thanks for your reply! Really, it is easier.

@dharr thanks for your comments!


Thank you very much. I feel that I do not defined well the Bernstein polynomials. Your definiton works!


First at all, thanks for your reply. Yes, I have plotted correctly the Schubert function and the graph is as in the link https://www.sfu.ca/~ssurjano/shubert.html

My question is related to the plot the approximation by Bernstein polynomials (detailed in the cited paper in my post) of such function. That is, plot the function (x,y,p(x,y)), p(x,y) being the Berstein polynomial of f(x,y).


Maybe I have not defined this polynomial well, because the graph does not look like the Schubert function   plots.pdf


Again, thanks.

@acer Thanks!

@Kitonum your procedure returns me 


                         /   1\           /1   \
                RealRange|0, -|, RealRange|-, 1|
                         \   7/           \3   /
                  /         /   1\           /1   \\
           `union`|RealRange|0, -|, RealRange|-, 1||
                  \         \   7/           \3   //

but I really need to get [0,1/7], [1/3,1]. Can you help me with this, please?


Again, thanks

Thank you for your comments!! Are useful for me.

@acer  many thankls!! I feel that is what I wanted...

@Kitonum and @vv

Many thanks for your answers! If attache a "pioneer" paper on the issue on the Frechet distance between two polygonal lines, for if you are interested...This problem, in its general version, is very hard.


Also, in the following link, you can find some "hints", if you are interested, to code a program to compute the Frechet distance between two polygonal curves:



I reiterate my gratitude.

@vv First at all, many thanks fopr the procedure.

It seems works correct and fastly!! :)


I reiterate my gratitude for your useful help.



@vv see the images with the formal proof, in French (sorry if they are "crappy" but are photos with my phone)

More generally, a precompact and path-wise connected set of a metric space is densifiable. I do not understand at all yor statenmtent "...find (effectively) t in [0,1] for which g(t) \in H.".   You'd be so kind to provide me a Maple code, please?

The idea is, exactly, what you propose in your post: fin a t in [0,1] such that the cosines curve belongs to the same sub-rectanlge H which belongs the given point P.

Many thanks for all!

@vv Thanks for your inetrest! The correct term for this kind of curve is "alpha-dense curve". The formal definition:

Let (X,d) ametric space, alpha>=0 and g:[0,1] -->X continuous. We say that g is an alpha-dense curve in a subset B of X if:

(1) g([0,1]) is a subset of B

(2) for each x in B, there is y in g([0,1]) such that d(x,y)<=alpha.

If for every alpha>0 there is an alpha-dense curve in B, the set B is said to be densifiable

Effectively, this concept generalizes that of "space-filling curve" (Peano curve, Hilbert curve, etc). For more details, you can see, for instance:




Respect to this question, in the book

Y. Cherruault, G Mora, Optimisation Globale. Théorie des courbes alpha-denses, Economica, Paris, 2005

 it is proved (Proposition 9.5.4) in a constructive way that the hypercube J:=[0,1]x...x[0,1] (d times) is a densifiable set. In fact, let the mapping g:I--->R^{d} defined as

g(t):=(t,0.5*(1-cos(Pi*m *t)),....,0.5*(1-cos(Pi*m^{d-1} *t)) ) for each t in [0,1]

and divide J into m^{d-1} "sub-rectangles" of side-length (1/m)x...x(1/m)x1. Then, from the properties of g, we have a "piece of the curve" in each sub-rectangle, which take all the values beetwen 0 and 1. Now given a point P:=(p_{1},....,p_{d}) in the hypercube J, the hyperplane of equation x_{d}=p_{d} cut the curve. As the point P belogs to some sub-rectangle, taking the solution (say, t) of the above equation such that the "piece of curve" and P are in the same sub-rectangle, we find

d(P,g(t)) <= sqrt(d-1)/m   (**)

and this completes the "proof". 

Therefore, I want use Maple to find a point t in [0,1] such that for a given P in J, the inequality (**) be satisfied. A think (although I may be wrong) that the proposed Maple's procedure can find such t, what do you think?

Thank you in advance for your comments or suggestions.


@tomleslie  You are right...The problem seems to be due to the values of r1 and r2. If these values are niot numeric, the proc returns an error. Also, i n your post I see "-1/2<=t,t<=-3/8" which does not appear because t must be always in [0,1].

Maybe we need to to evaluate them before to assing:

if `and`(type(evalf(lhs(S[2])), numeric), type(evalf(rhs(S[1])), numeric)) then r1 := min(evalf(lhs(S[2])), evalf(rhs(S[1]))); r2 := max(evalf(lhs(S[2])), evalf(rhs(S[1]))) end if; if `and`(type(evalf(lhs(S[1])), numeric), type(evalf(rhs(S[2])), numeric)) then r1 := min(evalf(lhs(S[1])), evalf(rhs(S[2]))); r2 := max(evalf(lhs(S[1])), evalf(rhs(S[2]))) end if


However, with

Cosenos(50, [.2534, .46534, .41241])

The last "fsolve" does not seem to work, so I think that the procedure is not correct to find a t such that the norm of x-g(t) (the curve) is less of equal than sqrt(d-1)/m    :(


S := fsolve(1/2*(1-cos(m^(d-1)*Pi*t)) = x[d], t = r1 .. r2)


Many thanks for your help.


It is seems that this procedure works

Cosenos := proc (m, x) local x0, y, j0, k, K0, K1, S, y1, y2, r1, r2, d; K0 := NULL; K1 := NULL; S := NULL; d := nops(x); for k to d-1 do if evalf(x[k]) = 1 then j0 := m else j0 := 1+floor(x[k]*m) end if; K0 := K0, [(j0-1)/m, j0/m] end do; K0 := [K0]; r1 := K0[1][1]; r2 := K0[1][2]; for k from 2 to nops(K0) do S := solve({K0[k][1] <= 1/2-(1/2)*cos(m^(k-1)*Pi*t) and 1/2-(1/2)*cos(m^(k-1)*Pi*t) <= K0[k][2], r1 <= t and t <= r2}, t); r1 := min(evalf(lhs(S[2])), evalf(rhs(S[1]))); r2 := max(evalf(lhs(S[2])), evalf(rhs(S[1]))) end do; S := fsolve(1/2-(1/2)*cos(m^(d-1)*Pi*t) = x[d], t = r1 .. r2); y := x[1]-S; x0 := x[1]; for k from 2 to d do x0 := x0, 1/2-(1/2)*cos(m^(k-1)*Pi*S); y := y, x[k]-1/2+(1/2)*cos(m^(k-1)*Pi*S) end do; y := `<,>`(y); return evalf([x0]), evalf(Norm(y)) end proc;


However, for x with miore than 3 components (say, x:=[0.23423,1,0.4534,0.5345,0.244,0.4534]) it is very very slow....Some suggestion??





@vv Many thanks for your answer! It is seems that the command floor works more fast.

1 2 3 Page 1 of 3