From: Barton W. <wi...@un...> - 2024-03-20 23:14:17
|
FYI: 42.1 Functions and Variables for Bernstein Function: bernstein_poly (k, n, x) Provided k is not a negative integer, the Bernstein polynomials are defined by bernstein_poly(k,n,x) = binomial(n,k) x^k (1-x)^(n-k); for a negative integer k, the Bernstein polynomial bernstein_poly(k,n,x) vanishes. When either k or n are non integers, the option variable bernstein_explicit controls the expansion of the Bernstein polynomials into its explicit form; example: (%i1) load("bernstein")$ (%i2) bernstein_poly(k,n,x); (%o2) bernstein_poly(k, n, x) (%i3) bernstein_poly(k,n,x), bernstein_explicit : true; n - k k (%o3) binomial(n, k) (1 - x) x The Bernstein polynomials have both a gradef property and an integrate property: See also bernstein_approx, bernstein_expand, and bernstein_explicit --Barton ________________________________ From: Richard Fateman <fa...@gm...> Sent: Wednesday, March 20, 2024 18:03 To: Pierre CAMPET <pie...@ac...> Cc: <max...@li...> <max...@li...> Subject: Re: [Maxima-discuss] Bernstein's polynom Caution: Non-NU Email B[n](fun):=ratsimp(sum(binomial(n,k)*fun(k/n)*x^k*(1-x)^(n-k),k,0,n))$ f(x):=x$ B[2](f); returns x. Note that the call B[2](f(x)) is incorrect, since it is immediately changed to B[2](x), and doesn't define "f" within your function. On Wed, Mar 20, 2024 at 3:02 PM Pierre CAMPET <pie...@ac...<mailto:pie...@ac...>> wrote: Hello, I was expecting x when I evaluate B[2](f(x)) (%i1) B[n](f):=sum(binomial(n,k)*f(k/n)*x^k*(1-x)^(n-k),k,0,n); (%o1) B[n](f):=sum(binomial(n,k)*f(k/n)*x^k*(1-x)^(n-k),k,0,n) (%i2) f(x):=x; (%o2) f(x):=x (%i3) B[2](f(x)); (%o3) x^2+(1-x)*x Any idea ? Pierre _______________________________________________ Maxima-discuss mailing list Max...@li...<mailto:Max...@li...> https://lists.sourceforge.net/lists/listinfo/maxima-discuss |