Difficulties creating a graphics function
Hello,
I am using GeoGebra in a numerical methods class, and I want to draw some cobweb diagrams, illustrating the successive approximations of the iteration
x[n] = g(x[n-1])
I have a list L of the x[k] values which is created with IterationList. What I want to do is to plot the Polyline through the points
(L(1), L(1))
(L(1),L(2))
(L(2),L(2))
(L(2), L(3))
(L(3), L(3))
and so on. Ideally, I'd like to make a command "Cobweb(L, n)" which would draw that Polyline, given the list, and taking the first n points from it.
My attempt so far is:
Cobweb(Ls,n) = Polyline[Flatten(Sequence({(Ls(k),Ls(k)),(Ls(k),Ls(k+1))},k,1,n))]
but I get an error about "Command Sequence: Illegal argument: Function n". Does this mean I can't create a command which includes a variable indicating the number of elements of a sequence?
And for that matter, is there a better, more flexible way, of creating such a function other than one long single nested command as shown here? Should I be creating a Custom Tool for this?
Two other more minor questions:
- How can I change the font used in the Algebra View? At the moment it's a sans-serif font which means that a list name, if automatically assigned, is something like "l4": the lower case L is indistinguishable from a capital "I". Either I'd like lists to be assigned capital letters, or use a different font.
- How can I copy commands in and out of the Algebra View? My Cobweb attempt above, because it returns an error, sort of "locks up" the Algebra View, and I can't enter any more commands without deleting that one. But then where does it go, and how can I get it back for future exploration?
Thank you very much!
cheers,
Alasdair
tú quieres algo parecido a esto?
Comments have been locked on this page!