# Questions tagged [scipy]

SciPy is a Python-based ecosystem of open-source software for mathematics, science, and engineering.

173 questions
Filter by
Sorted by
Tagged with
42 views

### scipy odeint: excess work done on this call and very sensitive to initial value

I am trying out odeint and received the error 'Excess work done on this call (perhaps wrong Dfun type).'. The values returned are also super sensitive to small ...
46 views

42 views

### scipy's solve_ivp returns erroneous results for a stiff differential equation

I'm using scipy's solve_ivp for solving a stiff differential equation. I'm using method BDF for solving the same. I have already used MATLAB's ode23s and I'm getting correct results in MATLAB. However,...
77 views

### A parallelized GMRES solver?

My application calls for solving a dense, 40,000 x 40,000, ill-conditioned linear system. The native SciPy GMRES solver with preconditioning has worked well for my application and solving a single ...
161 views

### Is LAPACK behind the cutting edge of dense linear algebra?

I have been digging into some numerical linear algebra lately, and reading in particular about how LAPACK solves symmetric eigenvalue problems. I noticed that the ...
29 views

### Comparing custom linear regression solver to SciPy equivalent in Python

From a given data set, I set out to complete a task which is below Fit the data of the previous exercise to fit Eq. (8.18) using the SciPy function ...
68 views

### Functions from Scipy, Blas, or Lapack that compute only upper triangular matrix

My goal is to transform a matrix into upper triangular form in Python. I know the function scipy.linalg.lu will do LU decomposition and get both upper and lower ...
169 views

### Why is 'scipy.sparse.linalg.spilu' less efficient than 'scipy.linalg.lu' for sparse matrix?

I have a matrix B which is sparse and try to utilize a function scipy.sparse.linalg.spilu specialized for sparse matrix to ...
152 views

55 views

### Solving an ODE using odeint in Python and continuing the integration

The following relates to the linked question: Scattering of waves in a symmetrical potential (using python) I have attempted to solve the problem for $U(r)$ using ...
32 views

### How to change the value of a variable at some point lying in the time interval of solver in solve_ivp

The following code solves a differential equation with scipy: ...
108 views

### solve_ivp - Overflow encountered in double_scalars

I'm modeling an electron that orbits the nucleus. Of course, charged particles radiate away there energy so it'll crash into the nucleus. My approach has been to to evaluate the coulomb force and add ...
35 views

### How to implement Simpson's rule for double integral (without numeric limits of first integral)

I want to use Simpson's rule to evaluate the following double integral: $$\int_{a}^{b}\left|\int_{0}^{z}x\cdot \mathrm{erf}(x-10)\cdot J_{0}(x) \mathrm{dx}\right|^{2}\exp(-0.5*(z-40)^2)\mathrm{dz}$$ ...
35 views

### Scipy.integrate.odeint is returning curves with almost the same frequency for different damping ratios, shouldn't they be different?

I am trying to solve the ODE for a harmonic oscillator using Scipy's odeint solver for different dampening factors. I'm using the following code, based off of this example: ...
63 views

### Plotting optimum as a function of parameter in the objective

I am trying to minimize a 2d function using scipy.optimize. Specifically I want to plot the minimum value of the function fun as a function of the parameter wjk. The problem is that I cannot pass wjk ...
102 views

### Translating the Euler code in scipy's solve_ivp

My code is based on the similarity transformation X=VZ.I simulate the model for transformed equations involving Z by replacing ...
23 views

### Can Scipy.optimize take a user-defined objective function that contains an ML model?

I have an optimization task that requires me to choose the optimal combinations of parameters, according to the prediction of a random forest model. My main obstacle is that scipy.optimize always ...
57 views

201 views

### Symmetric sparse direct solvers in scipy

scipy.linalg.solve, in its newer versions, has a parameter assume_a that can be used to specify that the matrix $A$ is symmetric ...
21 views

### How to handle system of chemical reactions for a batch reactor SciPy solver

I have a system of chemical reactions where the rate equations represent a batch reactor model. The model is a system of ODEs which is solved with the SciPy ...
399 views

### Numerical derivative in python

I am trying to take the numerical derivative of a dataset. My first attempt was to use the gradient function from numpy but in that case the graph of the derivative ...
177 views