LAT Hologramm-Software 2.0
Loading...
Searching...
No Matches
Functions | Variables
fit_nonlinear_spindle Namespace Reference

Functions

def piecewise_linear_1 (x, b, k1)
 
def piecewise_linear_2 (x, b, k1, k2)
 
def piecewise_linear_3 (x, b, k1, k2, k3)
 
def piecewise_linear_4 (x, b, k1, k2, k3, k4)
 

Variables

int n_pieces = 4
 
 PWM_set = np.array([2,18,36,55,73,91,109,127,146,164,182,200,218,237,254], dtype=float)
 
 RPM_measured = np.array([213.,5420,7145,8282,9165,9765,10100,10500,10700,10900,11100,11250,11400,11550,11650], dtype=float)
 
float PWM_point1 = 20.0
 
float PWM_point2 = 80.0
 
float PWM_point3 = 150.0
 
float slope_i = 100.0;
 
 PWM_max = max(PWM_set)
 
 PWM_min = min(PWM_set)
 
bool plot_figure = True
 
def piece_func = piecewise_linear_1
 
list p_initial = [RPM_measured[0],slope_i]
 
 p
 
 e
 
 p0
 
list a = [p[1]]
 
list b = [ p[0]-p[1]*PWM_min]
 
list rpm
 
tuple test_val = (1./a[0])*rpm[0] - (b[0]/a[0])
 
 fig = plt.figure()
 
 ax = fig.add_subplot(111)
 
 xd = np.linspace(PWM_min, PWM_max, 10000)
 

Detailed Description

---------------------
The MIT License (MIT)

Copyright (c) 2017-2018 Sungeun K. Jeon for Gnea Research LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
---------------------

Function Documentation

◆ piecewise_linear_1()

def fit_nonlinear_spindle.piecewise_linear_1 (   x,
  b,
  k1 
)

Definition at line 192 of file fit_nonlinear_spindle.py.

◆ piecewise_linear_2()

def fit_nonlinear_spindle.piecewise_linear_2 (   x,
  b,
  k1,
  k2 
)

Definition at line 195 of file fit_nonlinear_spindle.py.

◆ piecewise_linear_3()

def fit_nonlinear_spindle.piecewise_linear_3 (   x,
  b,
  k1,
  k2,
  k3 
)

Definition at line 204 of file fit_nonlinear_spindle.py.

◆ piecewise_linear_4()

def fit_nonlinear_spindle.piecewise_linear_4 (   x,
  b,
  k1,
  k2,
  k3,
  k4 
)

Definition at line 216 of file fit_nonlinear_spindle.py.

Variable Documentation

◆ a

list fit_nonlinear_spindle.a = [p[1]]

Definition at line 252 of file fit_nonlinear_spindle.py.

◆ ax

fit_nonlinear_spindle.ax = fig.add_subplot(111)

Definition at line 353 of file fit_nonlinear_spindle.py.

◆ b

list fit_nonlinear_spindle.b = [ p[0]-p[1]*PWM_min]

Definition at line 253 of file fit_nonlinear_spindle.py.

◆ e

fit_nonlinear_spindle.e

Definition at line 251 of file fit_nonlinear_spindle.py.

◆ fig

fit_nonlinear_spindle.fig = plt.figure()

Definition at line 352 of file fit_nonlinear_spindle.py.

◆ n_pieces

int fit_nonlinear_spindle.n_pieces = 4

Definition at line 156 of file fit_nonlinear_spindle.py.

◆ p

fit_nonlinear_spindle.p

Definition at line 251 of file fit_nonlinear_spindle.py.

◆ p0

fit_nonlinear_spindle.p0

Definition at line 251 of file fit_nonlinear_spindle.py.

◆ p_initial

list fit_nonlinear_spindle.p_initial = [RPM_measured[0],slope_i]

Definition at line 249 of file fit_nonlinear_spindle.py.

◆ piece_func

def fit_nonlinear_spindle.piece_func = piecewise_linear_1

Definition at line 248 of file fit_nonlinear_spindle.py.

◆ plot_figure

bool fit_nonlinear_spindle.plot_figure = True

Definition at line 187 of file fit_nonlinear_spindle.py.

◆ PWM_max

fit_nonlinear_spindle.PWM_max = max(PWM_set)

Definition at line 185 of file fit_nonlinear_spindle.py.

◆ PWM_min

fit_nonlinear_spindle.PWM_min = min(PWM_set)

Definition at line 186 of file fit_nonlinear_spindle.py.

◆ PWM_point1

float fit_nonlinear_spindle.PWM_point1 = 20.0

Definition at line 174 of file fit_nonlinear_spindle.py.

◆ PWM_point2

float fit_nonlinear_spindle.PWM_point2 = 80.0

Definition at line 175 of file fit_nonlinear_spindle.py.

◆ PWM_point3

float fit_nonlinear_spindle.PWM_point3 = 150.0

Definition at line 176 of file fit_nonlinear_spindle.py.

◆ PWM_set

fit_nonlinear_spindle.PWM_set = np.array([2,18,36,55,73,91,109,127,146,164,182,200,218,237,254], dtype=float)

Definition at line 162 of file fit_nonlinear_spindle.py.

◆ rpm

list fit_nonlinear_spindle.rpm
Initial value:
1= [ p[0],
2 p[0]+p[1]*(PWM_point1-PWM_min)]

Definition at line 254 of file fit_nonlinear_spindle.py.

◆ RPM_measured

fit_nonlinear_spindle.RPM_measured = np.array([213.,5420,7145,8282,9165,9765,10100,10500,10700,10900,11100,11250,11400,11550,11650], dtype=float)

Definition at line 167 of file fit_nonlinear_spindle.py.

◆ slope_i

float fit_nonlinear_spindle.slope_i = 100.0;

Definition at line 183 of file fit_nonlinear_spindle.py.

◆ test_val

tuple fit_nonlinear_spindle.test_val = (1./a[0])*rpm[0] - (b[0]/a[0])

Definition at line 343 of file fit_nonlinear_spindle.py.

◆ xd

fit_nonlinear_spindle.xd = np.linspace(PWM_min, PWM_max, 10000)

Definition at line 354 of file fit_nonlinear_spindle.py.