public void Test4Calculate() { modalSet.ReferenceResponse = acceleration; Tuple <double, double> frequencyBoundaries = new Tuple <double, double>(-1, -1); Tuple <double, double> levelsBoundaries = new Tuple <double, double>(0.1, 0.9); ResponseCharacteristics characteristics = new ResponseCharacteristics(acceleration, ref frequencyBoundaries, ref levelsBoundaries, 20, numInterpolationPoints: 20, modalSet: modalSet); }
public void calculateCharacteristics() { PairDouble frequencyBoundaries = new PairDouble((double)numericLeftFrequencyBoundary.Value, (double)numericRightFrequencyBoundary.Value); PairDouble levelsBoundaries = new PairDouble((double)numericLeftLevelsBoundary.Value, (double)numericRightLevelsBoundary.Value); int numLevels = (int)numericLevelsNumber.Value; int numInterpolationPoints = (int)numericInterpolationLength.Value; if (mSelectedModalSet != null) { mSelectedModalSet.ReferenceResponse = mSelectedAcceleration; } ResponseCharacteristics characteristics = new ResponseCharacteristics(mSelectedAcceleration, ref frequencyBoundaries, ref levelsBoundaries, numLevels, numInterpolationPoints, numericResonanceFrequencyReal.Value, numericResonanceFrequencyImaginary.Value, numericResonanceFrequencyAmplitude.Value, mSelectedModalSet); // Set signal data to plot mSignalGraphModels[SignalModelType.kImaginary].setData(mSelectedAcceleration, frequencyBoundaries, levelsBoundaries, characteristics.ResonanceFrequencyImaginary); mSignalGraphModels[SignalModelType.kReal].setData(mSelectedAcceleration, frequencyBoundaries, levelsBoundaries, characteristics.ResonanceFrequencyReal); mSignalGraphModels[SignalModelType.kAmplitude].setData(mSelectedAcceleration, frequencyBoundaries, levelsBoundaries, characteristics.ResonanceFrequencyAmplitude); mHodographGraphModel.setData(mSelectedAcceleration, characteristics.ResonanceRealPeak, characteristics.ResonanceImaginaryPeak); if (mSelectedModalSet != null) { mMonophaseGraphModel.setData(mSelectedModalSet.Responses); } // Set results mDecrementGraphModel.setData(characteristics.Decrement); ModalParameters modalResults = characteristics.Modal; if (modalResults != null) { foreach (ModalGraphModel model in mModalGraphModels) { model.setData(modalResults); } } // Correct input parameters numericLeftFrequencyBoundary.Value = frequencyBoundaries.Item1; numericRightFrequencyBoundary.Value = frequencyBoundaries.Item2; numericLeftLevelsBoundary.Value = levelsBoundaries.Item1; numericRightLevelsBoundary.Value = levelsBoundaries.Item2; if (characteristics.ResonanceFrequencyReal > 0) { numericResonanceFrequencyReal.Value = characteristics.ResonanceFrequencyReal; } if (characteristics.ResonanceFrequencyImaginary > 0) { numericResonanceFrequencyImaginary.Value = characteristics.ResonanceFrequencyImaginary; } if (characteristics.ResonanceFrequencyAmplitude > 0) { numericResonanceFrequencyAmplitude.Value = characteristics.ResonanceFrequencyAmplitude; } numericDecrementByReal.Value = null; if (characteristics.Decrement != null) { if (characteristics.Decrement.Real > 0) { numericDecrementByReal.Value = characteristics.Decrement.Real; } } }