David, please start a new thread (and try IndexedBase instead of Function 
and use [] instead of ()).

WRT CHATGPT: talk with it for a while trying to get it to compute the norm 
of (1/2, 1, 1). When you tell it not to skip steps it can get it right, but 
it is hard to get it to give you the correct symbolic and decimal answer at 
the same time. The logic of the first part of the answer doesn't carry over 
into the second half. And if you get it to succeed, then ask it for the 
norm of (1/3, 1, 1).


/c

On Thursday, March 23, 2023 at 6:32:40 PM UTC-5 da...@dbailey.co.uk wrote:

> Dear Group,
>
> I tried to sum a finite set of elements, each consisting of a call to an 
> undefined function:
>
> import sympy
> from sympy import *
> k=symbols("k")
> f=Function("f")
> print("f(k)=",f(k))
> print("sum=",sum(f(k),(0,k,10)))
>
> This produced the following output:
>
> f(k)= f(k)
>
> Traceback (most recent call last):
>   File "C:\SymPyProject\test.py", line 6, in <module>
>     print("sum=",sum(f(k),(0,k,10)))
>
> TypeError: 'f' object is not iterable
>
> I would have expected to get:
>
> f(0)+f(1)+f(2)+f(3)+f(4)+f(5)+f(6)+f(7)+f(8)+f(9)+f(10)
>
> I'm using version 1.12rc1, but I'm 98% certain I got the same error with 
> 1.11
>
> Can anyone help?
>
> David
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/da90f21e-fe60-45d6-be51-b28464e122dcn%40googlegroups.com.

Reply via email to