public class ContinuousTransferFunction extends TypedCompositeActor
y(s) b(1)*s^(m-1) + b(2)*s^(m-2) + ... + b(m) ----- = ------------------------------------------- u(s) a(1)*s^(n-1) + a(2)*s^(n-2) + ... + a(n)where m and n are the number of numerator and denominator coefficients, respectively. This actors has two parameters -- numerator and denominator -- containing the coefficients of the numerator and denominator in descending powers of s. These coefficients are double numbers. The order of the denominator (n) must be greater than or equal to the order of the numerator (m).
This actor extends TypedCompositeActor and works as a higher-order function. Whenever the parameters are changed, the actor will build a transparent subsystem inside it using integrators, adders, and scales. This is called a realization of the transfer function. Notice that there are infinite number of realizations of a transfer function, and they are equivalent if and only if the initial conditions are all zero. Here we choose the controllable canonical form and preset all initial states of the integrators to zero. If you need to set arbitrary initial conditions you have to use the state-space representation, for example, use the LinearStateSpace actor.
Red (cxh) |
Red (liuj) |
CompositeEntity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
Parameter |
denominator
The coefficients of the denominator, containing an array
of DoubleTokens.
|
TypedIOPort |
input
Single input port.
|
Parameter |
numerator
The coefficients of the numerator, containing an array of
DoubleTokens.
|
TypedIOPort |
output
Single output port.
|
_actorFiringListeners, _causalityInterface, _derivedPiggybacks, _initializables, _notifyingActorFiring, _piggybacks, _publishedPorts, _publisherRelations, _stopRequested, _subscribedPorts
_levelCrossingLinks
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
ContinuousTransferFunction(CompositeEntity container,
java.lang.String name)
Construct the composite actor with a name and a container.
|
ContinuousTransferFunction(Workspace workspace)
Construct a ContinuousTransferFunction in the specified
workspace with no container and an empty string as a name.
|
Modifier and Type | Method and Description |
---|---|
void |
attributeChanged(Attribute attribute)
If the argument is the numerator or the denominator
parameters, request for initialization from the director if
there is one.
|
Director |
getDirector()
Return the executive director, regardless what isOpaque returns.
|
boolean |
isOpaque()
Return the opaqueness of this composite actor.
|
void |
preinitialize()
Sanity check the parameters; if the parameters are legal
create a continuous-time subsystem that implement the transfer
function, preinitialize all the actors in the subsystem,
and set the opaqueness of this actor to true.
|
void |
wrapup()
Set the opaqueness to true and wrapup.
|
_addEntity, _addPort, _addRelation, _checkTypesFromTo, _destinationTypeConstraints, attributeTypeChanged, isBackwardTypeInferenceEnabled, newPort, newRelation, resolveTypes, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _finishedAddEntity, _setDirector, _transferPortParameterInputs, addActorFiringListener, addInitializable, addPiggyback, clone, connectionsChanged, createReceivers, createSchedule, fire, getCausalityInterface, getExecutiveDirector, getManager, getPublishedPort, getPublishedPortChannel, getPublishedPorts, getSubscribedPortChannel, inferringWidths, inferWidths, initialize, inputPortList, isFireFunctional, isPublishedPort, isStrict, iterate, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, needsWidthInference, newInsideReceiver, newReceiver, notifyConnectivityChange, outputPortList, postfire, prefire, recordFiring, registerPublisherPort, registerPublisherPort, removeActorFiringListener, removeInitializable, removePiggyback, requestChange, setContainer, setDirector, setManager, stop, stopFire, terminate, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unregisterPublisherPort, unregisterPublisherPort
_adjustDeferrals, _containedDecorators, _deepOpaqueEntityList, _description, _exportMoMLContents, _removeEntity, _removeRelation, _validateSettables, allAtomicEntityList, allowLevelCrossingConnect, classDefinitionList, connect, connect, containedObjectsIterator, deepCompositeEntityList, deepEntityList, deepGetEntities, deepNamedObjList, deepOpaqueEntityList, deepRelationSet, entityList, entityList, exportLinks, exportMoML, getAttribute, getEntities, getEntity, getPort, getRelation, getRelations, isAtomic, lazyAllAtomicEntityList, lazyAllCompositeEntityList, lazyAllCompositeTransparentAndOpaqueEntityList, lazyClassDefinitionList, lazyDeepEntityList, lazyEntityList, lazyRelationList, numberOfEntities, numberOfRelations, numEntities, numRelations, relationList, removeAllEntities, removeAllRelations, setClassDefinition, statistics, uniqueName
_checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_removePort, connectedPortList, connectedPorts, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts
_setParent, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, clone, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
fire, isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
addInitializable, initialize, removeInitializable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public TypedIOPort input
public TypedIOPort output
public Parameter numerator
public Parameter denominator
public ContinuousTransferFunction(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container
- The container.name
- The name.NameDuplicationException
- If another entity already had
this name.IllegalActionException
- If there was an internal problem.public ContinuousTransferFunction(Workspace workspace) throws IllegalActionException, NameDuplicationException
workspace
- The workspace that will list the actor.IllegalActionException
- If the name has a period in it, or
the director is not compatible with the specified container.NameDuplicationException
- If the container already contains
an entity with the specified name.public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class TypedCompositeActor
attribute
- The attribute that changed.IllegalActionException
- If the numerator and the
denominator matrix is not a row vector.public Director getDirector()
getDirector
in interface Actor
getDirector
in class CompositeActor
CompositeActor.setDirector(Director)
public boolean isOpaque()
isOpaque
in class CompositeActor
CompositeEntity
public void preinitialize() throws IllegalActionException
preinitialize
in interface Initializable
preinitialize
in class CompositeActor
IllegalActionException
- If there is no ContinuousDirector,
or any contained actors throw it in its preinitialize() method
.public void wrapup() throws IllegalActionException
wrapup
in interface Initializable
wrapup
in class CompositeActor
IllegalActionException
- If there is no director.