I
I
Igor2015-11-22 21:11:55
Python
Igor, 2015-11-22 21:11:55

How to write code for a definite integral?

Compiled a code for solving a definite integral:

def d_phi(a):
    return a
dphi = quad(d_phi, 0, 0.01, args=(1))

When run, it gives an error:
TypeError: d_phi() takes 1 positional argument but 2 were given
What did I do wrong and how can I fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Duha666, 2015-11-22
@Duha666

Because args are optional arguments? You have an integration variable and more args. In total 2. A function from one argument

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question