Questions tagged [scipy]
SciPy is a Python-based ecosystem of open-source software for mathematics, science, and engineering.
270
questions
0
votes
0
answers
43
views
Solve beam equation with elastic term using scipy solve_bvp
I want to solve the beam equation with distributed load and elatic term (which depends on how much the beam interact with the terrain) :
$$
EI\frac{d^4w}{dx^4}+k*(w(x)-t(x))=q(x)
$$
where $q(x)$ is a ...
1
vote
1
answer
86
views
How to run scipy.optimize.minimize with L-BFGS-B for maxiter (completely)
I want to run the below code for maxiter = 20001. I don't want it to stop by some default criteria.
...
0
votes
0
answers
42
views
Find peaks method for finding elusive peaks
I'm currently utilizing the find_peaks function to identify peaks within this spectrum. However, despite consulting similar queries on Stack Overflow, my attempts to incorporate features such as ...
0
votes
0
answers
44
views
How to calculate the numerical integration and plot the result in python?
I am trying to solve the question below in McQuarrie Physical-Chemistry book.
The first step of the exercise, I solved. However, the second step involves a numerical integration. I can develop a code ...
0
votes
1
answer
75
views
BSplines from scipy not defined on whole range of the knots
I am looking at the construction of BSplines out of curiosity. I created a small code that uses scipy.interpolate.BSpline to create basic splines. I get the following basic splines for order 0, 1 and ...
0
votes
1
answer
59
views
solve_ivp method=ODE23 time step not decreasing in order
My time step with the function scipy.integrate.solve_ivp is not decreasing in t_span fluctuating (reaching values below or ...
2
votes
1
answer
122
views
Different Results for Double Pendulum
In this study, (Hidden Fractals in the Dynamics of the Compound Double Pendulum) the authors provide various fliptime fractals (of a double pendulum) for different length combinations. However, when I ...
0
votes
2
answers
62
views
scipy exp model fitting: prevent coefficients blowup
I'm trying to fit a few X-Y points that look like exponential.
I used the following scipy code:
...
2
votes
0
answers
65
views
Hyperbolic integral of the second kind
The elliptic integral of the second kind is given by
$$
E(t,m) = \int_{0}^t \sqrt{1-m \sin(s)^2} \operatorname{ds}
$$
and there is for instance a scipy function ellipeinc that computes it.
The ...
0
votes
0
answers
40
views
using scipy.sparse.linalg.eigsh for degenerate states in Bose Hubbard model
I am currently writing a code for the Bose-Hubbard model, and I am calculating the ground states and single-particle density matrix for different values of U and J. As U=0, one would see how the ...
0
votes
2
answers
133
views
BFGS Constrained Optimization Failure Due to Precision Loss
I am trying to optimize the following objective function according to some constraints. However, the optimization fails at the first iteration with the message that the desired error was not ...
1
vote
2
answers
457
views
optimizing piecewise linear objective functions (perhaps non convex) with equality constraints
When I do my project, I need to optimize piecewise linear objective functions (perhaps non convex) with equality constraints.
The piecewise linear objective function may be not convex like this in the ...
0
votes
0
answers
104
views
How to minimize a numerical integration in python?
I need some help to minimize a numerical integration. It's about a classical problem in physics (hydrogen atom). It can be solved analytically but I need to solve it numerically in Python.
We have an ...
0
votes
0
answers
74
views
Singular Matrix Error in Incomplete LU Decomposition
I’m currently working on solving the following PDE:
$$\begin{equation}
-(\mu_x \frac{\partial^2 u}{\partial x^2} + \mu_y \frac{\partial^2 u}{\partial y^2}) = f(x, y)\end{equation}$$
Where a right hand ...
5
votes
2
answers
2k
views
What algorithm(s) do numpy and scipy use to calculate matrix inverses?
I am solving differential equations that require inverting dense square matrices, and I wanted to know what algorithm(s) do numpy and scipy use to calculate matrix inverses?