integration

Python - Integrating a function and plotting results

我们两清 提交于 2020-12-13 03:21:30
问题 I'm trying to solve Bernoulli's beam equation numerically and plotting the results. First derivative of the equation is the slope and the second derivative is the deflection. I approached the problem step-by-step, first plot the function and then integrate it and plot the integration results on the same diagram. My code so far is bellow. I suspect the problem lies in the fact that the integrate.quad returns a single value and I'm trying to get multiple values from it. Does anyone know how to

why does it say “ValueError: The array returned by a function changed size between calls”?

流过昼夜 提交于 2020-11-30 01:43:25
问题 I'm trying to calculate an integral and I don't understand the error output, what does it mean, what's the problem and how do I fix it? the output is "ValueError: The array returned by a function changed size between calls", I added the full output. pleas help, thank you import numpy as np import matplotlib.pyplot as plt import astropy.cosmology as cosmo from astropy import units as u from astropy import constants as const import scipy.integrate as integrate from scipy.optimize import fsolve

why does it say “ValueError: The array returned by a function changed size between calls”?

安稳与你 提交于 2020-11-30 01:43:14
问题 I'm trying to calculate an integral and I don't understand the error output, what does it mean, what's the problem and how do I fix it? the output is "ValueError: The array returned by a function changed size between calls", I added the full output. pleas help, thank you import numpy as np import matplotlib.pyplot as plt import astropy.cosmology as cosmo from astropy import units as u from astropy import constants as const import scipy.integrate as integrate from scipy.optimize import fsolve

why does it say “ValueError: The array returned by a function changed size between calls”?

Deadly 提交于 2020-11-30 01:40:09
问题 I'm trying to calculate an integral and I don't understand the error output, what does it mean, what's the problem and how do I fix it? the output is "ValueError: The array returned by a function changed size between calls", I added the full output. pleas help, thank you import numpy as np import matplotlib.pyplot as plt import astropy.cosmology as cosmo from astropy import units as u from astropy import constants as const import scipy.integrate as integrate from scipy.optimize import fsolve