Python algorithm that uses the Trapezoidal rule for aproximating integrals from a data set. We know that:
| x | f(x) |
|---|---|
| ... | ... |
Which should be saved in an external file and will later be parsed onto the main file. The program will take two arguments:
| Arguments | Description |
|---|---|
| -f | Mandatory, precedes the path for the dataset |
| -g | Optional, if the argument is y then it graphs the dataset |
Finally, the program is to be used as follows on the console:
foo@bar:~$ python3 main.py -f filePath Or, in case that the graph of the function is needed:
foo@bar:~$ python3 main.py -f filePath -g yPlease let me know if there are any questions.