Apr-17-2023, 02:48 AM
(This post was last modified: Apr-17-2023, 02:48 AM by deanhystad.)
Please post your code (with python tags) instead of screen shots.
You aren't doing the summing part. for k starting at 1 and ending at N-1 you need to compute f(a + k / M * (b - a)) and add all the values together. This will require a loop, or something that acts like a loop.
A * x**n if x >= 1 else A * x**(-n)
You aren't doing the summing part. for k starting at 1 and ending at N-1 you need to compute f(a + k / M * (b - a)) and add all the values together. This will require a loop, or something that acts like a loop.
sumnation = 0 for k in range(1, N-1): sumnation += function(k)I think you also need to review your function. What you wrote does not look like
A * x**n if x >= 1 else A * x**(-n)