Exercises II - using functions

■ Write a program for numerical integration of a given function using some prescribed method which will be given by a formula. Follow these 3 steps:


■ Write a program for solving the equation x = f(x) for a given function f(x), using the method of simple iteration (fixed point iterations). Follow these 3 steps:

Set maxit = 100 and test the program for eps = 0.0001 and the starting value xo = 0


■ Write a program for computation of quantities and price of a fertilizer for a given size of a garden. The fertilizer is sold in 2 types of cans: either 1 kg for 5$ or 3 kg for 12$. One square meter of a garden needs 0.1 kg of the fertilizer. Follow these two steps:


■ Write a program which solves vector equation x = U x + v using the method of simple iteration, where U is n x n matrix and x and v are column vectors of dimension n. Follow these two steps:



Last updated: 2. november 2020