How can I use an 'if clause function' in a summation? Suppose we have codes as follows: > Q[0]:=[0,0]:Q[1]:=[1,0]: > len:=A->sqrt(A[1]^2+A[2]^2): > kappa:=proc(y) local h;h:=[0,0];if y=h then 5; else 1/len(y);fi;end; > s:=R->sum(kappa(R-Q[n])*e(Q[n]),n=0..1): > s([1,0]); Error, (in NumericRange) summand is singular in the interval of summation It seems that when kappa comes into a summation form, it couldn't run the 'if clause'. What is my error in writing these codes?

Please Wait...