Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Tutorials
Rootfinding and optimization
In many applications we would like to find a root or minimum of a function in one or more variables. We will learn more about these methods later on, but will show some black-box methods in Python here.
Rootfinding in one variable
We want to find for which . Two well-known methods are Bisection and Newton's method.
Exercise
Try both methods on the function , what is going on?
Exercise
Find all roots of the functions and .
Optimization in one variable
Findig the minimum of a function in one variable is a common task. Various methods are available via a common interface:
Exercise
Check out the documentation of minimize_scalar
and try different methods for finding the minimum of . Which one works best?
Optimization in multiple variables
Exercise
Find the minimum of the function in the example above by hand and verify the solution found by the algorithm. Hint: at a minimum of we have .