Michael Thomas Flanagan's Java Scientific Library

OpenLoop Class:      Control Theory Open Loop Modelling

     

Last update: 8 November 2009                                                                                                                              Main Page of Michael Thomas Flanagan's Java Scientific Library

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 a single instance of BlackBox and a Vector of analogue segments, digital segments and converters, e.g,



This class is a sub-class of BlackBox.
WARNING! Any BlackBox method will treat an instance of OpenLoop as a single entity, e.g. the transient response methods will use the instance's combined transfer function in the s-domain to generate a transient response curve irrespective of whether the the path contains only analogue components, only digital components or a mixture of analogue and digital components.

import directive: import flanagan.control.OpenLoop;

SUMMARY OF CONSTRUCTORS AND METHODS

Constructor   public OpenLoop()
Add boxes to the path
  public void addBoxToPath(BlackBox box)
Combine all added boxes into a single box
  public void consolidate()
Remove all boxes from the path
  public void removeAllBoxes()
Get the Vector of segments
  public Vector getSegmentsVector()
Get the names of the boxes in the path
  public String getNames()
Get the number of boxes in the path
  public int getNumberOfBoxes()
Get the number of segments in the path
  public int getNumberOfSegments()
Deep Copy   public OpenLoop copy()
public Object clone()
See BlackBox for the inherited methods



CONSTRUCTOR

public OpenLoop()
Usage:                      OpenLoop op = new OpenLoop();
This constructor creates a new instance of OpenLoop. This instance inherits all the methods of the superclass BlackBox but some of these methods may not always be physically meaningful when applied to some instances of OpenLoop.



ADD BOXES TO OPEN LOOP PATH

public void addBoxToPath(BlackBox input)
Usage:                      op.addBoxToPath(box);
The method allows a box to be added to the open loop path represented by op. The box may be BlackBox, AtoD, DtoA, FirstOrder, SecondOrder, PropIntDeriv, PropInt, PropDeriv, Prop, Transducer, DelayLine, ZeroOrderHold or any instance that is a sub-class of BlackBox.
Only one box may be added at a time but addBoxToPath() may be called as often as required to add as many boxes to the path as required.



COMBINE ALL BOXES INTO A SINGLE BOX

public void consolidate()
Usage:                      op.consolidate();
This method combines all the boxes that have been entered, via call/s to addBoxToPath(), into a single box.



REMOVE ALL BOXES FROM THE PATH

public void removeAllBoxes()
Usage:                      op.removeAllBoxes();
This method removes all the boxes that have been entered allowing a new path to be entered



GET THE VECTOR OF SEGMENTS

public Vector getSegmentsVector()
Usage:                      seg = op.getSegmentsVector();
This method returns a Vector whose elements are:

GET THE NAMES OF THE BOXES IN THE PATH

public String getNames()
Usage:                      names = op.getNames();
This method returns a String that is a list of the names of the boxes in the open path.



GET THE NUMBER OF THE BOXES IN THE PATH

public int getNumberOfBoxes()
Usage:                      numBox = op.getNumberOfBoxes();
This method returns the number of boxes entered into the path.



GET THE NUMBER OF THE SEGMENTS IN THE PATH

public int getNumberOfSegments()
Usage:                      numSeg = op.getNumberOfSegments();
This method returns the number of segments into which the path has been split.



DEEP COPY

public ClosedLoop copy()
public Object clone()

Copy a ClosedLoop
Usage:                      aa = bb.copy();
A deep copy of ClosedLoop, bb, is returned as aa.

Clone a ClosedLoop
Usage:                      aa = bb.clone();
A deep copy of ClosedLoop, bb, is returned as aa cast as Object. This method overrides java.lang.Object.clone().



EXAMPLE PROGRAM

The simple example program, OpenLoopExample.java, illustrates the display of the transient response of a proportional controller and first order process to a step input:



Compare with the CLosed Loop Example equivalent example program. Note the time axis difference.



OTHER CLASSES USED BY THIS CLASS

This class is a subclass of BlackBox which uses the following classes in this library:


This page was prepared by Dr Michael Thomas Flanagan