PDSim.core package¶
Submodules¶
PDSim.core.bearings module¶
- PDSim.core.bearings.journal_bearing(**kwargs)[source]¶
The necessary calculations for a journal bearing
We only take keyword arguments to avoid problems with order of parameters
Parameters must be specified by name!
- Parameters:
- Returns:
output_dict – Dictionary of output terms,
- Return type:
dictionary
Notes
Short-bearing analysis is used. Here we are implementing the equations from the Ph.D. dissertation of Jay Kim (Purdue, 2005). Knowing \(w_r\) and the dimensions we can then obtain \(\epsilon\) using a 1D secant solver with the initial guess of \(\epsilon=0.5\). Then we obtain \(F_{shear}\) for the given value of \(\epsilon\).
\[W_r = \frac{w_r}{\eta_0\omega r_b L}\left(\frac{c}{L}\right)^2 = \frac{\epsilon}{4(1-\epsilon^2)^2}[16\epsilon^2+\pi^2(1-\epsilon^2)]^{1/2}\]\[\mathbf{F}_{shear} = \frac{F_{shear}}{\eta_0\omega r_b L}\left(\frac{c}{r_b}\right) = \frac{2\pi}{(1-\epsilon^2)^{1/2}}\left[\left(\frac{b}{r_b}\right)^2\frac{\epsilon^2}{16(1-\epsilon^2)}+1\right]\]\[\mu = \frac{F_{shear}}{w_r}\]
- PDSim.core.bearings.journal_bearing_design(**kwargs)[source]¶
The necessary calculations for a journal bearing
We only take keyword arguments to avoid problems with order of parameters
Parameters must be specified by name!
- Parameters:
r_b (float) – Radius of journal [m]
L (float) – Length of journal [m]
omega (float) – Rotational speed [rad/s]
eta_0 (float) – Viscosity of lubricant [Pa-s]
W (float) – Applied load [N]
c (float) – Bearing clearance [m]
design (string or float) – Either one of
'friction'(design for minimum friction)'load'(design for maximum load) or a floating point value in the range [0,1] that weights the minimum friction and maximum load parameters and 0 gives the friction solution. Hamrock recommends a value of 0.5 for general applications
Notes
One of
designorcmust be providedBased on the method presented by
Raimondi, A. A., and Boyd, J. (1958) : A Solution for the Finite Journal Bearing and Its Application to Analysis and Design-I, -II, and -III. ASLE Trans., vol. 1, no. I, I- pp. 159-174; II- pp. 175-193; III- pp. 194-209.
And further analysis presented in Hamrock:
In Fig. 11.2 a recommended operating eccentricity ratio, or minimum film thickness, is indicated as well as a preferred operating area. The left boundary of the shaded zone defines the optimum eccentricity ratio for a minimum coefficient of friction, and the right boundary the optimum eccentricity ratio for maximum load. The recommended operating eccentricity for general application is midway between these two boundaries.
- PDSim.core.bearings.thrust_bearing(**kwargs)[source]¶
Analysis for the journal bearing
We only take keyword arguments to avoid problems with order of parameters Parameters must be specified by name!
- Parameters:
Notes
To derive the speed of contact of the orbiting scroll
\[x = {r_o}\cos \left( {{\phi _{ie}} - \frac{\pi }{2} - \theta } \right)\]\[y = {r_o}\sin \left( {{\phi _{ie}} - \frac{\pi }{2} - \theta } \right)\]\[\frac{{dx}}{{d\theta }} = {r_o}\sin \left( {{\phi _{ie}} - \frac{\pi }{2} - \theta } \right)\omega\]\[\frac{{dy}}{{d\theta }} = - {r_o}\cos \left( {{\phi _{ie}} - \frac{\pi }{2} - \theta } \right)\omega\]\[\left| v \right| = \sqrt {{{\left( {\frac{{dx}}{{d\theta }}} \right)}^2} + {{\left( {\frac{{dy}}{{d\theta }}} \right)}^2}} = {r_o}\omega\]But it is quite possible that you do not have hydro-dynamic lubrication, and as a result you can get asperity-asperity contact and much higher friction coefficients - see for example Kobayashi et al. “Experimental Study on Journal Bearing Characteristics in Reciprocating Compressors for HFC-134a” Purdue Compressor Conferences 1998. http://docs.lib.purdue.edu/cgi/viewcontent.cgi?article=2257&context=icec
Can be off by a factor of as much as 10 times at low Sommerfeld number
PDSim.core.callbacks module¶
- class PDSim.core.callbacks.CallbackContainer¶
Bases:
object- endcycle_callback¶
object
- Type:
- heat_transfer_callback¶
PDSim.core.callbacks.HeatTransferCallback
- Type:
- lumps_energy_balance_callback¶
PDSim.core.callbacks.LumpsEnergyBalanceCallback
- step_callback¶
PDSim.core.callbacks.StepCallback
- Type:
- class PDSim.core.callbacks.HeatTransferCallback(Core)¶
Bases:
objectA wrapper to contain the callback that is called to evaluate the heat transfer rate for all of the control volumes. It is not meant to be instantiated directly, rather inherited
- Two methods are provided, call(t) and __call__(t). The special method
__call__(t) allows an instance of StepCallback to be called directly like:
SC = StepCallback(core) SC(t)
or you can call the call() method like:
SC.call(t)
Having both methods allows cython functions to stay at the C++ layer since they can call the .call() function with defined argument types and not need to come back to python layer for speed
- class PDSim.core.callbacks.LumpsEnergyBalanceCallback(Core)¶
Bases:
objectA wrapper to contain the callback that is called to evaluate the lump energy balance, as well as the error on the discharge temperature
- Two methods are provided, call() and __call__(). The special method
__call__() allows an instance of LumpsEnergyBalanceCallback to be called directly like:
LEBC = LumpsEnergyBalanceCallback(core) LEBC()
or you can call the call() method like:
LEBC.call()
Having both methods allows cython functions to stay at the C++ layer since they can call the .call() function with defined argument types and not need to come back to python layer for speed
- class PDSim.core.callbacks.StepCallback(Core)¶
Bases:
objectA wrapper to contain the callback that is called when at the beginning of the step, before the step is actually evaluated.
- Two methods are provided, call(t,h,i) and __call__(t,h,i). The special method
__call__(t,h,i) allows an instance of StepCallback to be called directly like:
SC = StepCallback(core) SC(t,h,i)
or you can call the call() method like:
SC.call(t,h,i)
Having both methods allows cython functions to stay at the C++ layer since they can call the .call() function with defined argument types and not need to come back to python layer for speed
- call(self, double t, double h, int i) double¶
This is the base class function, so don’t do anything, use the same step size again
- disable_adaptive¶
- h¶
- class PDSim.core.callbacks.WrappedHeatTransferCallback(Core, func)¶
Bases:
HeatTransferCallback
- class PDSim.core.callbacks.WrappedLumpsEnergyBalanceCallback(Core, func)¶
Bases:
LumpsEnergyBalanceCallback
- class PDSim.core.callbacks.WrappedStepCallback(Core, func)¶
Bases:
StepCallbackThis class is intended to provide a python-friendly wrapper of the Cython base class so that high-level python code can seamlessly interface through into Cython. It is not as fast as developing a cython Callback function, but it is easier to do
- call(self, double t, double h, int i) double¶
This function returns the values from the wrapped function
PDSim.core.containers module¶
- class PDSim.core.containers.CVArrays¶
Bases:
CVScoreA stub class that contains the arraym arrays of the state variables for all the control volumes that are passed into the instantiator
- calculate_derivs(self, double omega, bool has_liquid)¶
- properties_and_volumes(self, list CVs, double theta, int state_vars, arraym x)¶
Calculate all the required thermodynamic properties as well as the volumes for each control volume.
- class PDSim.core.containers.CVScore¶
Bases:
objectThe base class for all control volumes
In the derived class, before anything is done, you must set the parameter array_list as a list of strings, each entry in the list should be the name of an arraym instance that will be stored in the class
- calculate_flows(self, FlowPathCollection Flows)¶
Calculate the flows between tubes and control volumes and sum up the flow-related terms
Loads the arraym instances
summerdTandsummerdmof this classThese terms are defined by
\[\mathrm{summerdm} = \sum \frac{\dot m}{\omega}\]and
\[\mathrm{summerdT} = \sum \frac{\dot m h}{\omega}\]where the signs are dependent on whether the flow is into or out of the given control volume
- Parameters:
Flows (
FlowPathCollectioninstance)
- copy(self)¶
Make copies of all of the arraym instances in this class
- dpdT_constV¶
PDSim.misc.datatypes.arraym
- Type:
- drhodtheta¶
PDSim.misc.datatypes.arraym
- Type:
- just_volumes(self, list CVs, double theta)¶
Just calculate the volumes for each control volume.
- Parameters:
CVs (list of control volumes)
theta (double) – Crank angle [radians]
- property_derivs¶
PDSim.misc.datatypes.arraym
- Type:
- update_size(self, int N)¶
Update the size of the arraym instances in this class
- class PDSim.core.containers.ControlVolume(str key, VdVFcn, State initialState, bool exists=True, dict VdVFcn_kwargs={}, str discharge_becomes=None, becomes=None)¶
Bases:
objectThis is a class that contains all the code for a given control volume.
It includes the code for calculation of volumes and others.
- V_dV_kwargs¶
dict
- Type:
- discharge_becomes¶
- key¶
- class PDSim.core.containers.ControlVolumeCollection¶
Bases:
objectControlVolumeCollection is class to hold all the control volumes
- CVs¶
- N¶
- Nexist¶
- Nodes¶
- T¶
Temperature for each CV that exists
- add(self, ControlVolume CV)¶
Add a control volume to the list of control volumes
- Parameters:
CV (
ControlVolumeinstance)
- at(self, int i)¶
Return the control volume at the given index
- cp¶
Specific heat at constant volume for each CV that exists
- cv¶
Specific heat at constant volume for each CV that exists
- dpdT¶
Derivative of pressure with respect to temperature at constant volume for each CV that exists
- exists_CV¶
- exists_indices¶
- exists_keys¶
- get(self, parameters key, double factor=1.0)¶
Get a value from all the control volumes :param key: The key to get from CoolProp :param factor: The value to multiply each acquired value by :type factor: double
- h¶
Enthalpy for each CV that exists
- index(self, key)¶
- indices¶
- keys¶
- p¶
Pressure for each CV that exists
- rebuild_exists(self)¶
Rebuild all the internal lists that hold the indices, keys, and control volumes
- rho¶
Density for each CV that exists
- updateStates(self, str name1, arraym array1, str name2, arraym array2)¶
- volumes(self, double theta, bool as_dict=False)¶
Each control volume class must define a function V_dV (through a pointer) that defines the volume and derivative of volume with respect to the independent variable. The function that V_dV points to MUST be of the form
V,dV=V_dV(theta,**kwargs)
If the parameter V_dV_kwargs is passed to the class constructor, these keyword arguments will be unpacked into the volume function call. Useful for passing a flag to a given function
- Parameters:
as_dict (boolean, optional) – If
True, return the volumes and derivatives of volumes as a dictionary- Return type:
A tuple of volumes and derivatives of volumes as arraym instances
- class PDSim.core.containers.Tube(key1, key2, L, ID, State1=None, State2=None, OD=-1, fixed=-1, TubeFcn=None, mdot=-1, exists=True)¶
Bases:
objectA tube is a component of the model that allows for heat transfer and pressure drop.
With this class, the state of at least one of the points is fixed. For instance, at the inlet of the compressor, the state well upstream is quasi-steady.
- key1¶
- key2¶
- class PDSim.core.containers.TubeCollection¶
Bases:
list- Nodes¶
- get_T(self) arraym¶
Get an arraym instance with the enthalpies of each node in the Tubes collection. In the same order as the indices of the enthalpies, but offset by the number of control volumes in existence
- get_h(self) arraym¶
Get an arraym instance with the enthalpies of each node in the Tubes collection. In the same order as the indices of the enthalpies, but offset by the number of control volumes in existence
- get_p(self) arraym¶
Get an arraym instance with the pressures of each node in the Tubes collection. In the same order as the indices of the pressures, but offset by the number of control volumes in existence
- update(self)¶
_Nodes is a dictionary of flow states for any tubes that exist
- update_existence(self, int NCV)¶
Set the indices for each tube node in the array of enthalpies
First index is equal to NCV since python (& c++) are 0-based indexing
- PDSim.core.containers.rebuildCVCollection(CVs)¶
PDSim.core.core module¶
- class PDSim.core.core.EulerIntegrator(sim, x_state)[source]¶
Bases:
IntegratorMixin,AbstractSimpleEulerODEIntegratorMixin class using the functions defined in IntegratorMixin and the generalized simple ODE
- class PDSim.core.core.HeunIntegrator(sim, x_state)[source]¶
Bases:
IntegratorMixin,AbstractHeunODEIntegratorMixin class using the functions defined in IntegratorMixin and the generalized Heun ODE integrator
- class PDSim.core.core.IntegratorMixin(sim, x_state)[source]¶
Bases:
objectThis class contains the methods that will be merged with one of the system of ODE integrators and includes the methods that are specific to PDSim
- class PDSim.core.core.PDSimCore(stateVariables=None)[source]¶
Bases:
objectThis is the main driver class for the model
This class is not intended to be run on its own. It must be subclassed and extended to provide functions for mass flow, etc.
The basic order of steps that should be followed can be summarized as
Instantiate the subclass of PDSimCore
Add each of the control volumes
Add each of the tubes
Add all the flow models between CV and tubes
Add valves (if applicable)
Connect the callbacks for heat transfer, step, etc.
Run the model
- CVs¶
The
ControlVolumeCollectioninstance that contains all the control volumes in the machine
- FlowStorage¶
A
listthat contains copies of theFlowPathCollectionat each crank angle
- Flows¶
The
FlowPathCollectioninstance
- IsentropicNozzleFMSafe(FlowPath, A, DP_floor, **kwargs)[source]¶
A generic isentropic nozzle flow model wrapper with the added consideration that if the pressure drop is below the floor value, there is no flow. This was added to handle the case of the injection line where there is no flow out of the injection which greatly increases the numerical stiffness
- OBJECTIVE_CYCLE(Td_Tlumps0, X, epsilon_cycle=0.003, epsilon_energy_balance=0.003, cycle_integrator='RK45', OneCycle=False, cycle_integrator_options=None, plot_every_cycle=False)[source]¶
The Objective function for the energy balance solver
- Parameters:
Td_Tlumps0 (list) – Discharge temperature and lump temperatures
X (
arrayminstance) – Contains the state variables for all the control volumes in existence, as well as any other integration variablesepsilon (float) – Convergence criterion applied to all of the solvers (DEPRECATED!)
epsilon_cycle (float) – Cycle-cycle convergence criterion
epsilon_energy_balance (float) – Energy balance convergence criterion
cycle_integrator (string, one of 'RK45','Euler','Heun') – Which solver is to be used to integrate the steps
OneCycle (bool) – If
True, stop after one cycleplot_every_cycle (bool) – If
True, make the debug plots at every cyclecycle_integrator_options (dict) – Options to be passed to cycle integrator
- Valves¶
The Valves container class
- add_CV(CV)[source]¶
Add a control volume to the model
- Parameters:
CV (
ControlVolumeinstance) – An initialized control volume
- add_flow(FlowPath)[source]¶
Add a flow path to the model
- Parameters:
FlowPath (
FlowPathinstance) – An initialized flow path
- add_tube(Tube)[source]¶
Add a tube to the model.
- Parameters:
Tube (
Tubeinstance) – An initialized tube.
- add_valve(Valve)[source]¶
Add a valve to the model.
- Parameters:
Valve (
ValveModelinstance) – An initialized valve.
- attach_HDF5_annotations(fName)[source]¶
In this function, annotations can be attached to each HDF5 field
- Parameters:
fName (str) – The file name for the HDF5 file that is to be used
- calc_boundary_work()[source]¶
This method calculates the boundary work rate using a trapezoidal integration of
\[\dot W_{pv} = -\int p\frac{dV}{d\theta}\frac{\omega}{2\pi} d\theta\]for all the control volumes and sets the parameter
self.Wdot_pvwith the result.The units of the boundary work are kW.
- check_abort()[source]¶
A callback for use with the graphical user interface to force solver to quit
It will check the Scroll.pipe_abort pipe for a
Truevalue, and if it finds one, it will set the Scroll._want_abort value toTruewhich will be read by the main execution threadOnce
self._want_abortisTrue, it will stay latchedTrueuntil the run is terminated
- connect_callbacks(step_callback=None, heat_transfer_callback=None, lumps_energy_balance_callback=None, endcycle_callback=None)[source]¶
Connect up the callbacks for the simulation
The callbacks must either be unbound methods or methods of a class derived from PDSimCore
No keyword arguments are supported to be passed to the callbacks. The callback is probably a bound method of a PDSimCore instance, in which case you have access to all the data in the class anyway
- Parameters:
step_callback (function, or
StepCallbacksubclass) –If a function is provided, it must have the call signature:
disable_adaptive,h = step_callback(double t, double h, int i)
where
his the step size that the adaptive solver wants to use,tis the current value of the independent variable, andiis the index in the container variables. The return valuedisableAdaptiveis a boolean value that describes whether the adaptive method should be turned off for this step (False: use the adaptive method), andhis the step size you want to use. If you don’t want to disable the adaptive method and use the given step size, just:return False,h
in your code.
heat_transfer_callback (function, or
HeatTransferCallbacksubclass) –If a function is provided, the heat_transfer_callback function must have the call signature:
Q = heat_transfer_callback(double t)
It should return an
arrayminstance with the same length as the number of CV in existence. The entry in thearraymis positive if the heat transfer is TO the fluid in the CV in order to maintain the sign convention that energy (or mass) input is positive.lumps_energy_balance_callback (function, or
LumpsEnergyBalanceCallbacksubclass) –If a function is provided, the lumps_energy_balance_callback function must have the call signature:
r = lumps_energy_balance_callback()
It should return an
arrayminstance with the same length as the number of lumps. The entry inris the value of the energy balance. It will be driven to zero by the solver
- connect_flow_functions()[source]¶
Reconnect function pointers
For pickling purposes, it can sometimes be useful to just give the name of the function relative to the PDSimCore (or derived class). If the function is just a string, reconnect it to the function in the PDSimCore instance
- derivs(theta, x)[source]¶
Evaluate the derivatives of the state variables
derivs() is an internal function that should (probably) not actually be called by any user-provided code, but is documented here for completeness.
- endcycle_callback(eps_wrap_allowed=0.0001)[source]¶
This function can be called at the end of the cycle if so desired. Its primary use is to determine whether the cycle has converged for a given set of discharge temperatures and lump temperatures.
- get_prune_keys()[source]¶
Remove some elements when the simulation finishes that are not very useful and/or are very large when stored to file
- Returns:
prune_key_list – A list of HDF5 keys that are to be removed from the HDF5 file.
- Return type:
- guess_outlet_temp(inlet_state, p_outlet, eta_a=0.7)[source]¶
Function to guess outlet temperature
Using a guess value for the adiabatic efficiency, calculate the guessed outlet temperature. In compressor mode, the adiabatic efficiency is defined by
\[\eta_a = \frac{h_{2s}-h_1}{h_2-h_1}\]and in expander mode it is defined by
\[\eta_a = \frac{h_2-h_1}{h_{2s}-h_1}\]This function can also be overloaded by the subclass in order to implement a different guess method
- post_cycle()[source]¶
This stuff all happens at the end of the cycle. It is a private method not meant to be called externally
The following things are done:
The boundary work is calculated
The flows are post-processed
The heat transfer is post-processed
The mass flow rate is calculated
The volumetric efficiency is calculated
The adiabatic efficiency is calculated
The isentropic power is calculated
The power input is calculated
- pre_cycle(x0=None)[source]¶
This runs before the cycle is run but after pre_run has been called
- Parameters:
x0 (
arrayminstance)
- pre_run(N=40000)[source]¶
This function gets called before the run begins. It builds large matrices to store values, and does other initialization.
- precond_solve(**kwargs)[source]¶
This function is deprecated and will be removed in a future version
- reset_initial_state()[source]¶
Reset the initial state of the core class, typically after doing a preconditioning run
- solve(key_inlet=None, key_outlet=None, solver_method='Euler', OneCycle=False, Abort=None, pipe_abort=None, UseNR=False, alpha=0.5, plot_every_cycle=False, x0=None, reset_initial_state=False, timeout=3600, eps_cycle=0.001, eps_energy_balance=0.01, cycle_integrator_options=None, max_number_of_steps=40000, **kwargs)[source]¶
This is the driving function for the PDSim model. It can be extended through the use of the callback functions
It is highly recommended to call this function using keyword arguments like:
solve(key_inlet = 'inlet.1', key_outlet = 'outlet.1', ....)
- Parameters:
key_inlet (str) – The key for the flow node that represents the upstream quasi-steady point
key_outlet (str) – The key for the flow node that represents the upstream quasi-steady point
solver_method (str)
OneCycle (bool) – If
True, stop after just one rotation. Useful primarily for debugging purposesAbort (function) – A function that may be called to determine whether to stop running. If calling Abort() returns
True, stop runningpipe_abort
UseNR (bool) – If
True, use a multi-dimensional solver to determine the initial state of the state variables for each control volumealpha (float) – Use a range of
(1-alpha)*dx, (1+alpha)*dxfor line search if neededplot_every_cycle (bool) – If
True, make the plots after every cycle (primarily for debug purposes)x0 (arraym) – The starting values for the solver that modifies the discharge temperature and lump temperatures
reset_initial_state (bool) – If
True, use the stored initial state from the previous call tosolveas the starting value for the thermodynamic values for the control volumestimeout (float) – Number of seconds before the run times out
eps_cycle (float) – Cycle-cycle convergence criterion
eps_energy_balance (float) – Energy balance convergence criterion
cycle_integrator_options (dict) – A dictionary of options to be passed to the cycle integrator
max_number_of_steps (int) – Maximum number of steps allowed per rotation
Notes
The callbacks
step_callbackandendcycle_callbackandheat_transfer_callbackandlump_energy_balance_callbackandvalves_callbackshould now be passed to the connect_callbacks() function before running precond_solve() or solve()
- class PDSim.core.core.RK45Integrator(sim, x_state)[source]¶
Bases:
IntegratorMixin,AbstractRK45ODEIntegratorMixin class using the functions defined in IntegratorMixin and the generalized RK45 integrator
PDSim.core.integrators module¶
- class PDSim.core.integrators.AbstractHeunODEIntegrator[source]¶
Bases:
AbstractODEIntegrator
- class PDSim.core.integrators.AbstractRK45ODEIntegrator[source]¶
Bases:
AbstractODEIntegrator- do_integration(tmin=0, tmax=6.283185307179586, hmin=0.0001, eps_allowed=1e-10, step_relax=0.9, valves_callback=None, UseCashKarp=True, **kwargs)[source]¶
This function implements an adaptive Runge-Kutta-Feldberg 4th/5th order solver for the system of equations
- Parameters:
hmin (float) – Minimum step size, something like 1e-5 usually is good. Don’t make this too big or you may not be able to get a stable solution
tmin (float) – Starting value of the independent variable.
tis in the closed range [tmin,tmax]tmax (float) – Ending value for the independent variable.
tis in the closed range [tmin,tmax]eps_allowed (float) – Maximum absolute error of any CV per step allowed. Don’t make this parameter too big or you may not be able to get a stable solution. Also don’t make it too small because then you are going to run into truncation error.
step_relax (float, optional) – The relaxation factor that is used in the step resizing algorithm. Should be less than 1.0; you can play with this parameter to improve the adaptive resizing, but should not be necessary.
- Returns:
If an abort has been requested (by returning a value other than
Falsefrompremature_termination), return value frompremature_termination.Noneotherwise- Return type:
abort_flag
Notes
Mathematically the adaptive solver can be expressed as:
k1=h*dy(xn ,t) k2=h*dy(xn+1.0/4.0*k1 ,t+1.0/4.0*h) k3=h*dy(xn+3.0/32.0*k1+9.0/32.0*k2 ,t+3.0/8.0*h) k4=h*dy(xn+1932.0/2197.0*k1-7200.0/2197.0*k2+7296.0/2197.0*k3 ,t+12.0/13.0*h) k5=h*dy(xn+439.0/216.0*k1-8.0*k2+3680.0/513.0*k3-845.0/4104.0*k4 ,t+h) k6=h*dy(xn-8.0/27.0*k1+2.0*k2-3544.0/2565.0*k3+1859.0/4104.0*k4-11.0/40.0*k5 ,t+1.0/2.0*h)
where the function dy(y,t) returns a vector of the ODE expressions. The new value is calculated from:
xnplus=xn+gamma1*k1+gamma2*k2+gamma3*k3+gamma4*k4+gamma5*k5+gamma6*k6
In the adaptive solver, the errors for a given step can be calculated from:
error=1.0/360.0*k1-128.0/4275.0*k3-2197.0/75240.0*k4+1.0/50.0*k5+2.0/55.0*k6
If the maximum absolute error is above allowed error, the step size is decreased and the step is tried again until the error is below tolerance. If the error is better than required, the step size is increased to minimize the number of steps required.
Before the step is run, a callback the
step_callbackmethod of this class is called. In thestep_callbackcallback function you can do anything you want, but you must return
- class PDSim.core.integrators.AbstractSimpleEulerODEIntegrator[source]¶
Bases:
AbstractODEIntegrator
PDSim.core.journal_bearing module¶
PDSim.core.mobility module¶
From Flores 2006, JOURNAL BEARINGS SUBJECTED TO DYNAMIC LOADS: THE ANALYTICAL MOBILITY METHOD
PDSim.core.motor module¶
- class PDSim.core.motor.Motor[source]¶
Bases:
objectA class that implements the motor model
This can be either a constant efficiency model
- apply_map(tau, kind='linear')[source]¶
Actually use the motor map to calculate the slip speed and the motor efficiency
- Parameters:
tau (float) – Torque [N-m]
kind (string, optional) – The kind of interpolation to do (see scipy.interpolate.interp1d) - deprecated
- Returns:
eta (float) – Efficiency [-]
omega (float) – Rotational speed [rad/s]
- invert_map(Wdot, kind='linear')[source]¶
Invert the map to calculate the speed and the torque based on the power the power is given by tau*omega
If a constant efficiency, just return (efficiency,None) tuple