Examples of CTDirector


Examples of ptolemy.domains.ct.kernel.CTDirector

     *  <i>maxIterations</i> number. Meanwhile, the round count is reset.
     *  @return True if the resolved states have converged.
     *  @exception IllegalActionException Not thrown in this base class.
     */
    public boolean resolveStates() throws IllegalActionException {
        CTDirector director = (CTDirector) getContainer();

        if (_getRoundCount() > director.getMaxIterations()) {
            _resetRoundCount();
            return false;
        }

        return super.resolveStates();
View Full Code Here

Examples of ptolemy.domains.ct.kernel.CTDirector

            throws IllegalActionException {
        if (_getRoundCount() == 0) {
            // During the first round, use the current derivative to predict
            // the states at currentModelTime + currentStepSize. The predicted
            // states are the initial guesses for fixed-point iteration.
            CTDirector director = (CTDirector) getContainer();
            double tentativeState = integrator.getState();
            double f = integrator.getDerivative();
            tentativeState = tentativeState
                    + (f * (director.getCurrentStepSize()));

            // Set converged to false such that the integrator will be refired
            // again to check convergence of resolved states.
            _voteForConverged(false);
            integrator.setTentativeState(tentativeState);
View Full Code Here

Examples of ptolemy.domains.ct.kernel.CTDirector

     @exception IllegalActionException If there is no director, or can not
     *  read input, or can not send output.
     */
    public void integratorFire(CTBaseIntegrator integrator)
            throws IllegalActionException {
        CTDirector director = (CTDirector) getContainer();
        int r = _getRoundCount();
        double xn = integrator.getState();
        double outputValue;
        double h = director.getCurrentStepSize();
        double[] k = integrator.getAuxVariables();

        switch (r) {
        case 0:

View Full Code Here

Examples of ptolemy.domains.ct.kernel.CTDirector

     @param integrator The integrator of that calls this method.
     *  @return True if the integration is successful.
     */
    public boolean integratorIsAccurate(CTBaseIntegrator integrator) {
        try {
            CTDirector director = (CTDirector) getContainer();
            double tolerance = director.getErrorTolerance();
            double h = director.getCurrentStepSize();
            double f = ((DoubleToken) integrator.input.get(0)).doubleValue();
            integrator.setTentativeDerivative(f);

            double[] k = integrator.getAuxVariables();
            double error = h
View Full Code Here

Examples of ptolemy.domains.ct.kernel.CTDirector

     *
     *  @param integrator The integrator that calls this method.
     *  @return The next step size suggested by the given integrator.
     */
    public double integratorPredictedStepSize(CTBaseIntegrator integrator) {
        CTDirector director = (CTDirector) getContainer();
        double error = (integrator.getAuxVariables())[6];
        double h = director.getCurrentStepSize();
        double tolerance = director.getErrorTolerance();
        double newh = 5.0 * h;

        if (error > director.getValueResolution()) {
            newh = h * Math.pow((tolerance / error), 1.0 / _order);
        }

        if (_debugging) {
            _debug("integrator: " + integrator.getName()
View Full Code Here

Examples of ptolemy.domains.ct.kernel.CTDirector

     *  the current step size.
     *  @exception IllegalActionException If thrown in the super class or the
     *  model time can not be set.
     */
    protected void _advanceModelTime() throws IllegalActionException {
        CTDirector director = (CTDirector) getContainer();
        // NOTE: why is the current model time changed here?
        // Some state transition actors may be some functions
        // defined on the current time, such as the CurrentTime actor.
        Time iterationBeginTime = director.getIterationBeginTime();
        double currentStepSize = director.getCurrentStepSize();
        director.setModelTime(iterationBeginTime.add(currentStepSize
                * _timeInc[_getRoundCount()]));
    }
View Full Code Here

Examples of ptolemy.domains.ct.kernel.CTDirector

     @see ptolemy.domains.ct.kernel.CTStepSizeControlActor#predictedStepSize
     *  @param integrator The integrator that want to predict the step size.
     *  @return The current step size of the director.
     */
    public final double integratorPredictedStepSize(CTBaseIntegrator integrator) {
        CTDirector director = (CTDirector) getContainer();
        return director.getCurrentStepSize();
    }
View Full Code Here

Examples of ptolemy.domains.ct.kernel.CTDirector

     *  model time can not be set.
     */
    protected void _advanceModelTime() throws IllegalActionException {
        if (_getRoundCount() == 0) {
            // At the first round, advance the time with the current step size.
            CTDirector director = (CTDirector) getContainer();
            director.setModelTime(director.getModelTime().add(
                    director.getCurrentStepSize()));
        }
    }
View Full Code Here

Examples of ptolemy.domains.ct.kernel.CTDirector

     @exception IllegalActionException If there is no director, or can not
     *  read input, or can not send output.
     */
    public void integratorFire(CTBaseIntegrator integrator)
            throws IllegalActionException {
        CTDirector director = (CTDirector) getContainer();
        int r = _getRoundCount();
        double xn = integrator.getState();
        double outvalue;
        double h = director.getCurrentStepSize();
        double[] k = integrator.getAuxVariables();

        switch (r) {
        case 0:

View Full Code Here

Examples of ptolemy.domains.ct.kernel.CTDirector

     @param integrator The integrator of that calls this method.
     *  @return True if the integration is successful.
     */
    public boolean integratorIsAccurate(CTBaseIntegrator integrator) {
        try {
            CTDirector director = (CTDirector) getContainer();
            double tolerance = director.getErrorTolerance();
            double h = director.getCurrentStepSize();
            double f = ((DoubleToken) integrator.input.get(0)).doubleValue();
            integrator.setTentativeDerivative(f);

            double[] k = integrator.getAuxVariables();
            double error = h
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.