

last edited 4 months ago by test1 
1 2  
Editor: test1
Time: 2022/05/30 13:56:56 GMT+0 

Note: 
changed: Yack!!! This is obviously wrong! The map $$t\mapsto N(t,0,3)$$ is $C^2$ continuous and **is not constant**, despite what Axiom seems to claim here. Yack!!! This does not work. The map $$t\mapsto N(t,0,3)$$ is $C^2$ continuous, but FriCAS only has $N$ defined as code. There is no order on expressions so this can not work (as we see below). changed: On the other hand the function is not constant. On the other hand the function can be evaluated for specific numerial arguments. changed: 'Variable t'. Ultimately 'N(t,0,3)=0' because of your function definition 'N0(t(t<0) or (t>1))==0'. This is '0' because 't>1' is 'true' when 't' is of type 'Variable t'. You can 'Variable t'. Ultimately 'N(t,0,3)' fails because of your function definition 'N0(t(t<0) or (t>1))==0'. This is because 't>1' fails. Namely, FriCAS interprets both 't' and '1' as being of type 'POLY INT' and there is no order on the polynomials. You can changed: Axiom interprets both 't' and '1' as being of type 'POLY INT' and the function '>' is defined by the lexical ordering of the polynomials.  This result is counterintuitive, but once you understand why Axiom gives this result then you will be in a good position to understand the rest of Axiom's type system! This result is counterintuitive for people expecting symbolic computation, but once you understand why FriCAS handles this as above then you will be in a good position to understand the rest of FriCAS type system! changed: desired result. See ExampleSolution1. desired result (using 'abs').
Consider the following function, given in recursive manner:
N0(t(t<0) or (t>1))==0
N0(t(t>=0) and (t<=1))==1
N(t,i, 0)==N0(ti)
N(t,i, pp>0)==(ti)/p*N(t, i, p1)+(i+1t)/p*N(t, i+1, p1)
This is a way to create (uniform) bsplines. Now try to differentiate
D(N(t,0, 3), t)
There are 3 exposed and 1 unexposed library operations named < having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse,or issue )display op < to learn more about the available operations. Perhaps packagecalling the operation or using coercions on the arguments will allow you to apply the operation. Cannot find a definition or applicable library operation named < with argument type(s) Polynomial(Integer) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type,or "$" to specify which version of the function you need. FriCAS will attempt to step through and interpret the code. There are 3 exposed and 1 unexposed library operations named < having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op < to learn more about the available operations. Perhaps packagecalling the operation or using coercions on the arguments will allow you to apply the operation. Cannot find a definition or applicable library operation named < with argument type(s) Polynomial(Integer) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type,or "$" to specify which version of the function you need. FriCAS will attempt to step through and interpret the code. There are 3 exposed and 1 unexposed library operations named < having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op < to learn more about the available operations. Perhaps packagecalling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named < with argument type(s) Polynomial(Integer) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type,or "$" to specify which version of the function you need.
Yack!!! This does not work. The map
N(t,0, 3)
There are 3 exposed and 1 unexposed library operations named < having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse,or issue )display op < to learn more about the available operations. Perhaps packagecalling the operation or using coercions on the arguments will allow you to apply the operation. Cannot find a definition or applicable library operation named < with argument type(s) Polynomial(Integer) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type,or "$" to specify which version of the function you need. FriCAS will attempt to step through and interpret the code. There are 3 exposed and 1 unexposed library operations named < having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op < to learn more about the available operations. Perhaps packagecalling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named < with argument type(s) Polynomial(Integer) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type,or "$" to specify which version of the function you need.
On the other hand the function can be evaluated for specific numerial arguments. See this:
N0(t(t<0) or (t>1))==0;
Compiled code for N0 has been cleared. Compiled code for N has been cleared. 1 old definition(s) deleted for function or rule N0
N0(t(t>=0) and (t<=1))==1;
1 old definition(s) deleted for function or rule N0
N(t,i, 0)==N0(ti);
1 old definition(s) deleted for function or rule N
N(t,i, pp>0)==(ti)/p*N(t, i, p1)+(i+1t)/p*N(t, i+1, p1);
1 old definition(s) deleted for function or rule N
for x in 5..15 repeat output N(x/10,0, 3)
Compiling function N0 with type Fraction(Integer) > NonNegativeInteger
Compiling function N with type (Fraction(Integer),Integer, Integer) > Fraction(Integer) 0 0 0 0 0 0 1  6000 1  750 9  2000 4  375 1  48 9  250 343  6000 32  375 243  2000 1  6 133   6000 43   750 217   2000 67   375 13   48
Drawing the plot (unfortunately not available here) would show it even more clearly.
But in D(N(t,0,3),t)
you are not calling the function N
with numeric parameters. In N(t,0,3)
the type of t is
Variable t
. Ultimately N(t,0,3)
fails because of your function
definition N0(t(t<0) or (t>1))==0
. This is because
t>1
fails. Namely, FriCAS interprets both t
and 1
as being of type POLY INT
and there is no order on the polynomials. You can
see why if you use the option )set message bottomup on
to
see the mode map selection
)set message bottomup on
t>1
Function Selection for > Arguments: (VARIABLE(t),PI) > no appropriate > found in Variable(t) > no appropriate > found in PositiveInteger > no appropriate > found in Symbol > no appropriate > found in Integer > no appropriate > found in Variable(t) > no appropriate > found in PositiveInteger > no appropriate > found in Symbol > no appropriate > found in Integer
Modemaps from Associated Packages no modemaps
Remaining General Modemaps [1] (D,D) > Boolean from D if D has PORDER > no function > found for arguments (VARIABLE(t), PI)
Function Selection for > Arguments: (VARIABLE(t),NNI) > no appropriate > found in Variable(t) > no appropriate > found in NonNegativeInteger > no appropriate > found in Symbol > no appropriate > found in Integer > no appropriate > found in Variable(t) > no appropriate > found in NonNegativeInteger > no appropriate > found in Symbol > no appropriate > found in Integer
Modemaps from Associated Packages no modemaps
Remaining General Modemaps [1] (D,D) > Boolean from D if D has PORDER > no function > found for arguments (VARIABLE(t), NNI)
Function Selection for > Arguments: (VARIABLE(t),INT) > no appropriate > found in Variable(t) > no appropriate > found in Integer > no appropriate > found in Symbol > no appropriate > found in Variable(t) > no appropriate > found in Integer > no appropriate > found in Symbol
Modemaps from Associated Packages no modemaps
Remaining General Modemaps [1] (D,D) > Boolean from D if D has PORDER > no function > found for arguments (VARIABLE(t), INT)
Function Selection for > Arguments: (VARIABLE(t),SINT) > no appropriate > found in Variable(t) > no appropriate > found in SingleInteger > no appropriate > found in Symbol > no appropriate > found in Variable(t) > no appropriate > found in SingleInteger > no appropriate > found in Symbol
Modemaps from Associated Packages no modemaps
Remaining General Modemaps [1] (D,D) > Boolean from D if D has PORDER > no function > found for arguments (VARIABLE(t), SINT) There are 1 exposed and 2 unexposed library operations named > having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op > to learn more about the available operations. Perhaps packagecalling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named > with argument type(s) Variable(t) PositiveInteger
Perhaps you should use "@" to indicate the required return type,or "$" to specify which version of the function you need.
This result is counterintuitive for people expecting symbolic computation, but once you understand why FriCAS handles this as above then you will be in a good position to understand the rest of FriCAS type system!
It is possible to write the function N0 so that it returns the
desired result (using abs
).