Search in sources :

Example 6 with PseudoConstant

use of cbit.vcell.math.PseudoConstant in project vcell by virtualcell.

the class DefaultODESolver method createIdentifiers.

/**
 * This method was created in VisualAge.
 */
private Vector<Variable> createIdentifiers() throws MathException, ExpressionException {
    SimulationSymbolTable simSymbolTable = simTask.getSimulationJob().getSimulationSymbolTable();
    // create list of possible identifiers (including reserved x,y,z,t)
    Vector<Variable> identifiers = new Vector<Variable>();
    // add reserved variables x,y,z,t
    identifiers.addElement(ReservedVariable.TIME);
    identifiers.addElement(ReservedVariable.X);
    identifiers.addElement(ReservedVariable.Y);
    identifiers.addElement(ReservedVariable.Z);
    // add regular variables
    Variable[] variables = simSymbolTable.getVariables();
    for (int i = 0; i < variables.length; i++) {
        if (variables[i] instanceof VolVariable) {
            identifiers.addElement(variables[i]);
        }
    }
    // Add sensitivity variables (for sensitivity equations)...
    fieldSensVariables = new Vector<SensVariable>();
    if (getSensitivityParameter() != null) {
        for (int i = 0; i < variables.length; i++) {
            if (variables[i] instanceof VolVariable) {
                VolVariable volVariable = (VolVariable) variables[i];
                SensVariable sv = new SensVariable(volVariable, getSensitivityParameter());
                identifiers.addElement(sv);
            }
        }
    }
    // Add pseudoConstants for fast system (if necessary)...
    if (getFastAlgebraicSystem() != null) {
        Enumeration<PseudoConstant> enum1 = fieldFastAlgebraicSystem.getPseudoConstants();
        while (enum1.hasMoreElements()) {
            identifiers.addElement(enum1.nextElement());
        }
    }
    // Assign indices...
    for (int i = 0; i < identifiers.size(); i++) {
        Variable variable = (Variable) identifiers.elementAt(i);
        variable.setIndex(i);
    }
    return (identifiers);
}
Also used : ReservedVariable(cbit.vcell.math.ReservedVariable) Variable(cbit.vcell.math.Variable) VolVariable(cbit.vcell.math.VolVariable) VolVariable(cbit.vcell.math.VolVariable) PseudoConstant(cbit.vcell.math.PseudoConstant) SimulationSymbolTable(cbit.vcell.solver.SimulationSymbolTable) Vector(java.util.Vector)

Example 7 with PseudoConstant

use of cbit.vcell.math.PseudoConstant in project vcell by virtualcell.

the class FastAlgebraicSystem method initVars.

/**
 * initVars method comment.
 */
public void initVars(double[] oldValues, double[] newValues) throws ExpressionException, MathException {
    // 
    // calculate C's for invariants
    // 
    Enumeration<PseudoConstant> enum_pc = fs_analyzer.getPseudoConstants();
    while (enum_pc.hasMoreElements()) {
        PseudoConstant pc = enum_pc.nextElement();
        int index = pc.getIndex();
        oldValues[index] = pc.getPseudoExpression().evaluateVector(oldValues);
        newValues[index] = oldValues[index];
    }
}
Also used : PseudoConstant(cbit.vcell.math.PseudoConstant)

Aggregations

PseudoConstant (cbit.vcell.math.PseudoConstant)7 ReservedVariable (cbit.vcell.math.ReservedVariable)5 Variable (cbit.vcell.math.Variable)5 VolVariable (cbit.vcell.math.VolVariable)4 MemVariable (cbit.vcell.math.MemVariable)3 Expression (cbit.vcell.parser.Expression)3 Constant (cbit.vcell.math.Constant)2 DataGenerator (cbit.vcell.math.DataGenerator)2 FastInvariant (cbit.vcell.math.FastInvariant)2 FastRate (cbit.vcell.math.FastRate)2 MathDescription (cbit.vcell.math.MathDescription)2 RationalExp (cbit.vcell.matrix.RationalExp)2 SymbolTableEntry (cbit.vcell.parser.SymbolTableEntry)2 FastSystemAnalyzer (cbit.vcell.mapping.FastSystemAnalyzer)1 CompartmentSubDomain (cbit.vcell.math.CompartmentSubDomain)1 FastSystem (cbit.vcell.math.FastSystem)1 FilamentVariable (cbit.vcell.math.FilamentVariable)1 InsideVariable (cbit.vcell.math.InsideVariable)1 MembraneParticleVariable (cbit.vcell.math.MembraneParticleVariable)1 MembraneRandomVariable (cbit.vcell.math.MembraneRandomVariable)1