Composition Functions Mathematica

In summary, the conversation is discussing the use of a for loop to find the limit of a function, specifically f(x) = 5x(-x+1) as n approaches 0.75. The expert summarizes that the definition of f(x) should be placed outside the for loop and suggests using the Limit function instead of a for loop. The expert also asks for clarification on the purpose of the for loop and how the iteration is being done. Finally, the expert explains that an iterative method usually involves a While loop with a convergence criteria instead of a fixed number of iterations.
  • #1
Nusc
760
2
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?
 
Physics news on Phys.org
  • #2
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.
 
  • #3
It's going to keep iterating and eventually converge to a number.
 
  • #4
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?)
 
  • #5
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.
 
Last edited:

What is Composition Functions Mathematica?

Composition Functions Mathematica is a feature in the Mathematica software that allows users to apply a function to the output of another function. This is useful for creating complex mathematical operations and data transformations.

How do I use Composition Functions in Mathematica?

To use Composition Functions in Mathematica, you can use the @ symbol between two functions. For example, if you want to apply the function f to the output of the function g, you would write f@g. You can also use Composition Functions with multiple functions, such as f@g@h.

What are the benefits of using Composition Functions in Mathematica?

Composition Functions in Mathematica can help simplify complex mathematical operations by allowing you to combine multiple functions into one. This can save time and reduce the chances of error in your calculations. It also allows for more efficient use of memory and resources.

Can I use Composition Functions with built-in Mathematica functions?

Yes, you can use Composition Functions with built-in Mathematica functions as well as user-defined functions. This includes both numerical and symbolic functions.

Are there any limitations to using Composition Functions in Mathematica?

One limitation of Composition Functions in Mathematica is that the output of one function must match the input of the next function. This means that the functions must be compatible and have the same number and type of arguments. It is also important to consider the order in which the functions are applied, as this can affect the final result.

Similar threads

Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
911
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
866
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
Back
Top