/* Class ClosedLoop
*
* This class supports the creation of a path of Black Boxes
* i.e. of instances of BlackBox and of any of its subclasses,
* e.g. PropIntDeriv, FirstOrder, and the methods to combine
* these into both a single instance of BlackBox and a Vector
* of analogue segments, digital segments and converters,
* with a feedback path from the last box on the forward path to the first box on the forward path
*
* Author: Michael Thomas Flanagan.
*
* Created: August 2002
* Updated: 14 May 2005, 6 April 2008, 5 July 2008, 2-7 November 2009
*
* DOCUMENTATION:
* See Michael T Flanagan's JAVA library on-line web page:
* http://www.ee.ucl.ac.uk/~mflanaga/java/OpenLoop.html
* http://www.ee.ucl.ac.uk/~mflanaga/java/
*
*
* Copyright (c) 2002 - 2008 Michael Thomas Flanagan
*
* PERMISSION TO COPY:
* Permission to use, copy and modify this software and its documentation for
* NON-COMMERCIAL purposes is granted, without fee, provided that an acknowledgement
* to the author, Michael Thomas Flanagan at www.ee.ucl.ac.uk/~mflanaga, appears in all copies.
*
* Dr Michael Thomas Flanagan makes no representations about the suitability
* or fitness of the software for any or for a particular purpose.
* Michael Thomas Flanagan shall not be liable for any damages suffered
* as a result of using, modifying or distributing this software or its derivatives.
*
***************************************************************************************/
package flanagan.control;
import java.util.Vector;
import java.util.ArrayList;
import flanagan.complex.Complex;
import flanagan.complex.ComplexPoly;
import flanagan.control.OpenLoop;
public class ClosedLoop extends BlackBox{
private OpenLoop forwardPath = new OpenLoop(); // forward path boxes
private OpenLoop closedPath = new OpenLoop(); // full closed path boxes
private ArrayList feedbackPath = new ArrayList(); // feedback path boxes
private int nFeedbackBoxes = 0; // number of boxes in feedback path
private boolean checkNoMix = true; // true - no ADC or DAC
private boolean checkConsolidate = false; // true if consolidate has been called
private double deadTimeSum = 0.0; // dead time is replaced by Pade approximation to facilitate division
// sNumer and sDenom equated to sNumerPade and sDenomPade
// super.deadTime is replaced by zero
// true dead time stored in deadTimeSum which is returned by this classes getDeadTime method
// Constructor
public ClosedLoop(){
super("ClosedLoop");
}
// Add box to the forward path
public void addBoxToForwardPath(BlackBox box){
this.forwardPath.addBoxToPath(box);
}
// Add box to the open path
public void addBoxToFeedbackPath(BlackBox box){
this.feedbackPath.add(box);
this.nFeedbackBoxes++;
}
// Consolidate all boxes into appropriate segments and
// combine all boxes into either on forward path box or one closed loop box
public void consolidate(){
// add feedback boxes to forward path boxes
this.closedPath = this.forwardPath.copy();
for(int i=0; i getForwardPathSegmentsArrayList(){
if(!checkConsolidate)this.consolidate();
return this.forwardPath.getSegmentsArrayList();
}
// Return segment Vector for forward path
public Vector
Ads help maintain this website.