PDA

View Full Version : Composition Functions Mathematica


Nusc
Oct13-09, 05:36 PM
I need to write a loop that iterates several times to find the limit of this function


f(x) = 5x(-x+1) lim f^n(0.75) n->

For[n = 0, n < 5, n++,
x=0.75;
f[x_] := 5x(-x+1)
];
]

what am i doing wrong?

DaleSpam
Oct13-09, 09:28 PM
You probably want to put the definition of f[x_] outside the for loop, but that said I don't understand what you are trying to do. I don't understand how a for loop is going to help you find a limit. You can just use the Limit function.

Nusc
Oct13-09, 10:28 PM
It's going to keep iterating and eventually converge to a number.

Hepth
Oct14-09, 03:30 AM
Try to explain what exactly you're trying to do. What does:
f(x) = 5x(-x+1) lim f^n(0.75) n->

mean?
are you trying to do the Limit of f[x]^n (to the nth power?)

DaleSpam
Oct14-09, 08:00 AM
And are you taking the limit as x approaches something or as n approaches something?

Also, how are you iterating? In other words, in an iterative method one estimate is based on the previous estimate. It is not clear at all from your description how you are planning on obtaining one estimate from the previous.

Finally, usually when you are doing an iterative method, you will not iterate a fixed number of times using a For loop. Instead you usually have some convergence criteria that you evaluate at the end of each pass through a While loop. You then exit the While loop when the convergence criteria is met or return an error if it is not met after a certain maximum number of iterations.