Apr-16-2023, 06:49 PM
Help solving an exercise?
Help solving an exercise?
|
Apr-16-2023, 07:01 PM
I may as well get this out of the way.
So what have you tried? You aren't going to get any help unless you first demonstrate that you tried to solve the problem. Your question is too open ended. What kind of help your you looking for? Do you understand the assignment? Do you have a specific Python question? (Apr-16-2023, 07:01 PM)deanhystad Wrote: I may as well get this out of the way. As I understood the exercise, I tried to simplify the integration function of problem 3 under the conditions of problem 2, but I'm not sure this is the correct procedure. in a first step I've defined the integrated function of problem 2 and also defined the conditions for the interval (following the conditions of problem 2). I used a loop to define it. But I'm not sure it's the right way to solve it since my solution doesn't really take into account N and I don't know how to implement it into the original function. see my solution in the attachment. running it with the given factors prints a solution of 10
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. 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) |
|
Users browsing this thread: 1 Guest(s)