Package uk.ac.cranfield.thesis.shared

Examples of uk.ac.cranfield.thesis.shared.Equation


    public Equation parseEquation(String input) throws IncorrectODEEquationException
    {
        input = input.replace(" ", "");
        String[] parts = input.split(",");
       
        Equation equation = new Equation(parts[0]);
        equation.setOrder(longestRun(parts[0], '\'', 1));
        if (equation.getOrder() < parts.length - 1)
            throw new IncorrectODEEquationException("lack of initial values");
       
        List<String> init = new ArrayList<String>(parts.length - 1);
        for (int i = 1; i < parts.length; i++)
            init.add(parts[i]);
       
        equation.setInitValues(parseInitialValues(init));
        equation.setFunctionVariable(parseFunctionVariable(parts[0]));
        equation.setIndependentVariable(parseIndependentVariable(parts[0], equation.getFunctionVariable()));
       
        return equation;
    }
View Full Code Here


    public void testRungeKutta1Order()
    {
        RungeKuttaSolverServiceAsync solverService = RungeKuttaSolverService.Util.getInstance();
        delayTestFinish(500);
       
        Equation equation = new Equation("y'=-2*y+x+4");
        equation.setFunctionVariable('y');
        equation.setIndependentVariable('x');
        equation.setOrder(1);
       
        List<Double> list = new ArrayList<Double>();
        list.add(1.0);
       
        equation.setInitValues(list);
       
        solverService.solve(equation, 0.2, 0.0, 0.2, new AsyncCallback<Solution>()
        {
           
            @Override
View Full Code Here

TOP

Related Classes of uk.ac.cranfield.thesis.shared.Equation

Copyright © 2018 www.massapicom. 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.