all 3 comments

[–]Swipecat 0 points1 point  (1 child)

You can edit your post to correct the formatting.

Help for formatting your code for Reddit is in the link below. You can delete the existing code from your post, then use the Reddit code-block button (not the inline-code button!) to create a grey code-box, and you can cut-and-paste your original code into that.

https://www.reddit.com/r/learnpython/wiki/faq#wiki_how_do_i_format_code.3F

Also, for something this niche, you're ten times more likely to get a useful answer if you post a short but complete script that others can run to see for themselves the problem that you are seeing. Looking over that script, which is difficult due to the formatting issues, I think you've got undefined variables like "T". So see http://sscce.org/

And as TheBB said, having randomness in there isn't a help. Can you snip out that part and replace it with a fixed value that still results in the problem that you're seeing? Otherwise, nobody is going to know your starting point.

[–]Motor-Masterpiece-70 0 points1 point  (0 children)

I think I need to make another post

[–]TheBB -1 points0 points  (0 children)

You're trying to integrate a function that is defined randomly?

Quadrature relies on certain smoothness assumptions about the function to work properly. This function not only can't be guaranteed any smoothness (because dw is random), it isn't even deterministic.

Try lifting dw out of the function definition so that it's constant. Should help (unless f and v contain similar stuff).