Extending command Iteration to functions : list -> list

Mathieu Blossier shared this idea 15 years ago
Under Consideration

Hello,


I'm looking for possibilities to do recursive tools. I had the following idea : imaging that the Iteration command is extended to "functions" that take a list a return a list. We should then be able to perform the sum of a list, e.g. this way :


L1 is a list

f(L1)=If[Length[L1]==1, L1, Sequence[Element[L1,i]+If[i==Length[L1]-1,Element[L1,Length[L1]],0],i,1,Length[L1]-1]]

(replace the n-1 element by the sum of n-1 and n elements)

s=Element[Iteration[f,L1,Length[L1]],1]

(returns the sum)


Best regards,

Mathieu


ps : It would be a way to extend R->R funtions to R^n->R^m functions...

Comments (6)

photo
1

is GG ready for this? or do we must to use custom tools ever?

I know how to do an iteration; I am speaking about functions list--->list

photo
1

What do you want to do exactly? An example would be helpful :)

photo
photo
1

how to iterate f(x,y)=(x^2-y^2+1,2x y) for mandelbrot, ie

we can do a custom tool with {u,v} input and {u^2-v^2,2u v} output then iteration or reproduce all the process in one iteration command but I think is very complex

photo
1

I think you can do that in the spreadsheet quite easily (and use Condition to Show Object to hide some if you want)

photo
photo
1

It is possible to do that using custom tools, like I did here:

https://help.geogebra.org/t...

The funicular curve is built using iterationlist applied on a custom tool taking a list as input and returning a list as output. It works, but custom tools are a little fussy about the types of parameters that are transmitted, (for example a vector-based construction might loose the origin point of vectors when they are transmitted as parameters in the custom tool ), so it has to be tested carefully.

photo
1

better if the tool has two points in input and output, or segment-->segment

https://help.geogebra.org/t...

© 2023 International GeoGebra Institute