symfit

Simultaneous optimization of two different functions to provide a universal solution for both

爷,独闯天下 提交于 2021-02-11 15:38:45
问题 I asked a similar question in January that @Miłosz Wieczór was kind enough to answer. Now, I am faced with a similar but different challenge since I need to fit two parameters ( fc and alpha ) simultaneously on two datasets ( e_exp and iq_exp ). I basically need to find the values of fc and alpha that are the best fits to both data e_exp and iq_exp . import numpy as np import math from scipy.optimize import curve_fit, least_squares, minimize f_exp = np.array([1, 1.6, 2.7, 4.4, 7.3, 12, 20, 32

How to resolve TiffFileError: Not a Tiff File and Byte Problem with KeyError: b'\x89P'

那年仲夏 提交于 2020-01-05 08:24:25
问题 I am setting up a computer vision project to detect and process GFP proteins. I keep getting errors about my file not being a Tiff Image and a Byte Error. I don't quite understand what they mean and haven't found anything about it online. I have already made sure that the file path is correct and have tried changing the file into Tiff Format. Now on Finder, it says that it is a TIFF Image but still gives an error. import tifffile from colicoords import Data, Cell, CellPlot import matplotlib

Fitting two different data sets by two model functions using symfit

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 11:18:57
问题 I am trying to fit two data sets by two model functions. I tried to do so using symfit . Here the code: from symfit import variables, parameters, Fit, cos, sin, pi, sqrt, asin import numpy as np n0 = 1.5 data = np.genfromtxt('some data') data = 1000 * data pos=[] for j in range( len(data) ): pos.append( np.arcsin( np.sin( np.deg2rad( data[j,0]/1000 ) )/1.5 ) ) m1=[] for j in range( len(data) ): m1.append( data[j,1] ) p1=[] for j in range( len(data) ): p1.append(data[j,3]) zero=[] for j in

Global fitting example with symfit

元气小坏坏 提交于 2019-12-11 06:15:50
问题 I am trying to perform global fitting with symfit package, following symfit documentation. import numpy as np import symfit as sf import matplotlib.pyplot as plt %matplotlib inline # for ipynb # Generate example data t = np.arange(0.0, 600.1, 30) k = 0.005 C1_0, C2_0 = 1.0, 2.0 C1 = C1_0 * np.exp(-k*t) C2 = C2_0 * np.exp(-k*t) # Construct model x_1, x_2, y_1, y_2 = sf.variables('x_1, x_2, y_1, y_2') kg = sf.Parameter(value=0.01, min=0.0, max=0.1) a_1, a_2 = sf.parameters('a_1, a_2')