IGLib
1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
|
Public Member Functions | |
override double | ODE (double[] arg) |
ODE of the nonlinear oscillator. More... | |
override double | DrivingFunction (double t) |
The driving function that each oscillator has to specify. More... | |
MagneticOscHardSpring () | |
![]() | |
PlotZedgraphCurve | X_vs_T (PlotterZedGraph plotter) |
Position vs. time. More... | |
PlotZedgraphCurve | V_vs_T (PlotterZedGraph plotter) |
Velocity vs. time. More... | |
PlotZedgraphCurve | A_vs_T (PlotterZedGraph plotter) |
Acceleration vs. time. More... | |
PlotZedgraphCurve | V_vs_X (PlotterZedGraph plotter) |
Velocity vs. position. More... | |
PlotZedgraphCurve | ResonanceCurve (PlotterZedGraph plotter) |
Position vs. time. More... | |
void | FindSteadyStateAmplitude () |
Finds the steady state amplitude. The step size needs to be specified before the method call. The initial conditions are unimportant when there is damping present, so they are simply taken to be: x(0)=0, v(0)=0. After calling this method the user should respecify the initial conditions for a new Solve() call. More... | |
void | CalcSteadyStateAmplitudeVsDrivingFrequency () |
Calculates the resonance curve. You have to specify the step size for the ODE solver, the starting driving angular frequency, the ending driving angular frequency and the number of sampling points (NSamplesForResonanceCurve). More... | |
![]() | |
void | SolveNumerically () |
Solves the ODE by calling Solve() on the ODE solver. More... | |
void | CalculateErrors () |
Estimates errors by comparing the solution at current step size to the solution at half of the current step size. More... | |
void | PostProcessErrors (int forceTakeValue) |
Najprej izračuna absolutne vrednosti napak. Potem poskuša zgladiti krivuljo (uporabno če ta oscilira). More... | |
void | VerifyErrorsValidity (int nPoints) |
Only exposes the same method on the ODE solver. More... | |
![]() | |
PlotZedgraphCurve | NewCurveFromPlottableData (PlotterZedGraph plotter, int x, int y) |
Creates a new PlotZedgraphCurve object from the available plottable data. More... | |
void | LoadPlottableDataToCurve (PlotZedgraphCurve curve, int x, int y) |
Copies the calculated data to the existing PlotZedgraphCurve object. Enough space must be available on the curve object's list. More... | |
Public Attributes | |
const string | DefaultTitle = "Nonlinear oscillator with a soft or hard spring" |
const double | Default_bOverJ = 0.5 |
const double | Default_DOverJ = 3.0 |
const double | Default_AlphaOverJ = 2 |
const double | Default_M0OverJ = 2.0 |
const double | DefaultDrivingAngularFrequency = 1.5 |
![]() | |
const double | DefaultGamma = 0.0 |
Protected Attributes | |
double | _bOverJ = Default_bOverJ |
double | _DOverJ = Default_DOverJ |
double | _alphaOverJ = Default_AlphaOverJ |
double | _M0OverJ = Default_M0OverJ |
![]() | |
double | _drivingPeriod |
double | _drivingAngularFrequency |
double | _gamma = DefaultGamma |
double | _steadyStateAmplitude |
int | _stepsInPeriod |
The number of steps in a period. The oscillating period is almost always the same as the driving period. More... | |
InitialProblemSolverRK4 | _miniPinpointExtremeSolver |
Mini solver which finds the position of a maximum to a specified tolerance. Its solution list is typically small (length of ~5). It finds the local maximum using a bisection approach. More... | |
double | _xExtremeTolerance = 0.000001 |
int | _firstPeriodStart |
int | _secondPeriodStart |
This variable tells us the starting position of the first period in which we are searching for the local maximum. We are going to compare the maxima values in both periods. More... | |
double | _initialSolvingDepth = 40.0 |
double[] | _firstExtreme |
A maximum in the first period. A point in 2D. More... | |
double[] | _secondExtreme |
A maximum in the second period. A point in 2D. More... | |
double | _consecutivePeaksDifferenceTolerance = 0.000001 |
double | _consecutivePeaksPositionTolerance = 0.01 |
int | _extendSolutionFactor = 10 |
int | _numOfSolutionExtendIterations = 0 |
How many times the steady state amplitude searcher has failed to find the amplitude and the solution has been extended. More... | |
int | _startingIterationsLimit = 50 |
int | _iterationsLimit |
See: StartingIterationsLimit, which is just the default starting value for this variable. More... | |
int | _iterationsLimitIncrement = 10 |
string | _usersSolutionExtendDecision |
Used as an input field for the users decision, whether to continue the search or plot the solution. More... | |
double | _originalStepSize |
The method FindSteadyStateAmplitude uses this variable. It adjusts the step size for its own purposes and then restores the original value after it is finished. More... | |
int | _miniSolverSteps = 7 |
double | _startingDrivingAngularFrequency |
double | _endingDrivingAngularFrequency |
int | _nSamplesForResonanceCurve |
![]() | |
InitialProblemSolverRK4 | _solver |
double[] | _initialConditions |
![]() | |
string | _title |
Properties | |
double | bOverJ [get, set] |
The damping coefficient over the moment of inertia. More... | |
double | DOverJ [get, set] |
The torsion coefficient over the moment of inertia. More... | |
double | AlphaOverJ [get, set] |
Nonlinearity of the torsion spring over the moment of inertia. More... | |
double | M0OverJ [get, set] |
number of coil wraps * cross section * current * magnetic field density / moment of inertia. More... | |
![]() | |
double | DrivingPeriod [get] |
Driving period. It is needed for a simpler calculation of the steady state amplitude. More... | |
double | DrivingAngularFrequency [get, set] |
The driving frequency of the harmonic driving force. More... | |
double | Gamma [get, set] |
Driving phase. More... | |
double | SteadyStateAmplitude [get] |
The steady state amplitude. It exists only when some damping is present in the system to bleed of the transient oscillations. More... | |
double | XExtremeTolerance [get, set] |
The tolerance for finding local maxima of the mini solver. More... | |
double | InitialSolvingDepth [get, set] |
Tells us for how many periods the ODE solution is calculated, before the mini solver kicks in to compare two neighbouring maxima and thus determine the steady state amplitude. More... | |
double | ConsecutivePeaksDifferenceTolerance [get, set] |
The method, which calculates the steady state amplitude and compares the values of two neighbouring maxima, stops when the height difference is under this value and the peaks are one driving period apart. More... | |
double | ConsecutivePeaksPositionTolerance [get, set] |
The tolerance for the condition that the peaks are one driving period apart. More... | |
int | ExtendSolutionFactor [get, set] |
For how many periods the ODE solution is extended, if the steady state amplitude searcher method has not found one to the specified tolerance. More... | |
int | StartingIterationsLimit [get, set] |
Determines after how many failed searches for the steady state amplitude and thus extensions of the ODE solution, the checks for convergence to a steady state will start. The users gets prompted whether to continue the search or plot the ODE solution, so that he can inspect for unusual behaviour. More... | |
int | IterationsLimitIncrement [get, set] |
How many more times the ODE solution can get extended after the user has been prompted to check the convergence and he decided to just continue the search. More... | |
int | MiniSolverSteps [get, set] |
The number of steps on the mini solver. The greater the number, the greater the accuracy wtih which the mini solver pinpoints the extreme in a single go. More... | |
double | StartingDrivingAngularFrequency [get, set] |
The starting point of the resonance curve method. More... | |
double | EndingDrivingAngularFrequency [get, set] |
The ending point of the resonance curve method. More... | |
int | NSamplesForResonanceCurve [get, set] |
The number of samples for the resonance curve. More... | |
List< double[]> | SteadyStateAmplitudeVsDrivingFrequency [get, set] |
This list gets full after the "CalcSteadyStateAmplitudeVsDrivingFrequency()" method call. More... | |
![]() | |
InitialProblemSolverRK4 | Solver [get, set] |
An ODE solver object. More... | |
double[] | InitialConditions [get, set] |
User definable initial conditions which are passed to the ODE solver object. You must provide the correct number of initial conditions. For a II. order ODE they should be specified as: {x, f(x), f'(x), f''(x)}. The value of the highest derivative is deduced automatically and is only provided by the user as a placeholder. It does not need to be correct (can be any number). More... | |
![]() | |
string | Title [get, set] |
The plottable model's name. Also used as a plot title. More... | |
List< double[]> | PlottableData [get, set] |
The main solution array, which is used by the plotter. More... | |
|
inline |
|
inlinevirtual |
ODE of the nonlinear oscillator.
Implements IG.MPetekLib.Algorithms.PlottableModels.PlottableODEModelBase.
|
inlinevirtual |
The driving function that each oscillator has to specify.
Implements IG.MPetekLib.Algorithms.PlottableModels.Oscillators.DrivenOscillatorBase.
const string IG.MPetekLib.Algorithms.PlottableModels.Oscillators.MagneticOscHardSpring.DefaultTitle = "Nonlinear oscillator with a soft or hard spring" |
const double IG.MPetekLib.Algorithms.PlottableModels.Oscillators.MagneticOscHardSpring.Default_bOverJ = 0.5 |
const double IG.MPetekLib.Algorithms.PlottableModels.Oscillators.MagneticOscHardSpring.Default_DOverJ = 3.0 |
const double IG.MPetekLib.Algorithms.PlottableModels.Oscillators.MagneticOscHardSpring.Default_AlphaOverJ = 2 |
const double IG.MPetekLib.Algorithms.PlottableModels.Oscillators.MagneticOscHardSpring.Default_M0OverJ = 2.0 |
const double IG.MPetekLib.Algorithms.PlottableModels.Oscillators.MagneticOscHardSpring.DefaultDrivingAngularFrequency = 1.5 |
|
protected |
|
protected |
|
protected |
|
protected |
|
getset |
The damping coefficient over the moment of inertia.
Referenced by IG.MPetekLib.Application.Scripts.MagOscHardSpring._23SingleResCurveManyPhases.Run(), and IG.MPetekLib.Application.Scripts.MagOscHardSpring._24MultiResCurvesPlotPhaseScan.Run().
|
getset |
The torsion coefficient over the moment of inertia.
Referenced by IG.MPetekLib.Application.Scripts.MagOscHardSpring._23SingleResCurveManyPhases.Run(), and IG.MPetekLib.Application.Scripts.MagOscHardSpring._24MultiResCurvesPlotPhaseScan.Run().
|
getset |
Nonlinearity of the torsion spring over the moment of inertia.
Referenced by IG.MPetekLib.Application.Scripts.MagOscHardSpring._23SingleResCurveManyPhases.Run(), and IG.MPetekLib.Application.Scripts.MagOscHardSpring._24MultiResCurvesPlotPhaseScan.Run().
|
getset |
number of coil wraps * cross section * current * magnetic field density / moment of inertia.
Referenced by IG.MPetekLib.Application.Scripts.MagOscHardSpring._23SingleResCurveManyPhases.Run(), and IG.MPetekLib.Application.Scripts.MagOscHardSpring._24MultiResCurvesPlotPhaseScan.Run().