Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
78 views

I am attempting to perform a nonlinear curve fit to some experimental data obtained from an oscilloscope. The time signal is a sinusoidal voltage over time and I want to evaluate the phase of the ...
Yolan Ankaine's user avatar
2 votes
1 answer
83 views

I'm trying to use curve_fit on a function for which I want to freeze one or more parameters using partial. E.g. this pattern, which is working: from scipy.optimize import curve_fit from functools ...
euronion's user avatar
  • 1,319
7 votes
2 answers
179 views

I noticed that the formulation matters when trying to fit a non-linear equation of the form y = a + b * x ** c and I wonder which formulation in general results in the best fit? Formulation 1 y = a + ...
3UqU57GnaX's user avatar
0 votes
0 answers
60 views

I am minimising the objective function which is -100 * fill rate(floors) together with L2 penalty on epsilon and gamma: -100 * fill_rate(floors) + l1 * ||epsilon|| + l2 * ||gamma|| I have constraints ...
Rakesh Balhara's user avatar
1 vote
2 answers
100 views

I am trying to do something similar as described in Parallelize a function call with mpi4py But there are some things there that make me skeptical of the provided answer. Additionally, I have a class ...
Sterling Butters's user avatar
2 votes
3 answers
124 views

Question: Does scipy.optimize have minimizing functions that can divide their workload among multiple processes to save time? If so, where can I find the documentation? I've looked a fair amount ...
trevdawg122's user avatar
2 votes
1 answer
129 views

I am trying to use SciPy's scipy.optimize.least_squares to solve a system of 35 non linear equations related to multilateration. For context : There are 5 "reference points" which are fixed ...
Tom's user avatar
  • 21
1 vote
1 answer
68 views

I am trying to optimize a matrix given some bounds and constraints. When I run the minimize function with only the bounds everything works fine, but when adding the constraints I get the following ...
adamskor's user avatar
1 vote
1 answer
84 views

A recent addition to scipy's differential_evolution implementation is to allow custom strategies, which should be a callable. Here is a simplistic example. from scipy.optimize import ...
Hmwat's user avatar
  • 119
0 votes
0 answers
61 views

I'm having some troubles with this optimization below. x0 is an array with -1 and 1, the result i'm trying to achieve is that the code choose to let the number as +/- 1 or change to 0, the main ...
Pedro Andion's user avatar
4 votes
2 answers
206 views

I'm trying to fit my thermal conductivity into the Debye-Callaway equation. However, one of my parameters is coming back negative. I've tried different initial guesses. So I'm attaching a code with ...
Materialsgirl's user avatar
0 votes
1 answer
132 views

To set up my differential_evolve curve-fit function, I borrowed heavily from https://bitbucket.org/zunzuncode/ramanspectroscopyfit/src/master/RamanSpectroscopyFit.py. My implemented function works ...
onix's user avatar
  • 3
1 vote
1 answer
113 views

I have the following model: -dc/dt = kc(t) - k'n(t) I compute c(t) and n(t) from a simulation trajectory with CuPy. I then compute k and k' with curve_fit, through the following code: # compute dc/dt ...
horlust's user avatar
  • 111
0 votes
2 answers
138 views

I'm trying to find the roots with the root function in Scipy for functions/variables created in Sympy. sympy: AllEquations = [x1 - 5, y1 - 5, z1 - 5, ((x1 - x2)**2 + (y1 - y2)**2 + (z1 - z2)**2)**0.5 -...
Achaibou Karim's user avatar
1 vote
2 answers
77 views

I am trying to understand why my curve_fit is only producing one optimized parameter when I have created the function using two, td and tr. The number is it producing also does not make sense as I am ...
Rena Kramer's user avatar
3 votes
3 answers
206 views

I've been working on a standard potential which I am trying to fit with a given model: ax2 - bx3 + lx4 The x and y values for the fit are generated from the code as well, the x values are generated by ...
SDee's user avatar
  • 33
1 vote
1 answer
80 views

I'm trying to create a script that will minimize the maximum distance between the ends of two lines at three different orientations. The first line, A, has a fixed origin and length, while line B's ...
Conor Carson's user avatar
0 votes
0 answers
101 views

I try to use scipy minimize to solve a minimization functions. My objective function and gradient function require multi-threaded computation. However, when calling these functions, there is no ...
nickaaa's user avatar
0 votes
2 answers
178 views

I am using fmin_slsqp to find the weights that minimize mean squared error. The weights need to be positive. For each pair of X and y, it takes ~10 seconds. (Each X is (10, 1000) and y is (10,)). I ...
Anonny's user avatar
  • 481
0 votes
2 answers
109 views

My linear constraint for scipy.optimize.minimize is ones = np.ones_like(x) np.outer(x, ones) - np.outer(ones, x) > something where something is a given matrix. (Mathematically, a_ij < x_i - x_j ...
sds's user avatar
  • 60.5k
1 vote
0 answers
71 views

I need to minimize a two variables function and I have a constraint to respect. I wrote the following code def deflection_constraint(inputs): #return value must come back as 0 to be accepted #...
Giovanni Bugli's user avatar
0 votes
1 answer
134 views

EDIT 1: This question has been completely modified for improved clarity and to better state my intent. The original post is at the end. I think a lot of people are confused by my example code. It was ...
kriegersan's user avatar
0 votes
1 answer
62 views

I'm trying to fit a curve using the curve_fit from scipy, but I'm getting RuntimeError. I have an input data (x,y) and I'd like to fit it to an equation defined in the y_fit function. Does anyone know ...
João Marcos Cavalcante's user avatar
0 votes
1 answer
96 views

I have defined an ode function, langmuir_ode, as follows: def langmuir_ode(t, AL, Rmax, kon, koff): A = np.interp(t, time, concs) L = Rmax - AL return kon * A * L - koff * AL t is some ...
Alex van der Kooi's user avatar
0 votes
1 answer
83 views

The goal is to calculate an optimization problem using python scipy.optimize. Suppose C is a given 4-dimension matrix (in the code I use a random matrix to denote that). The optimized variables are A0 ...
qmww987's user avatar
  • 133

1
2 3 4 5
24