public static CSteadyStateTask runSteadyStateCalculation(
     CCopasiDataModel dataModel,
     HashMap<String, Object> problemParameters,
     HashMap<String, Object> methodParameters) {
   CSteadyStateTask steadyStateTask =
       (CSteadyStateTask) dataModel.addTask(CCopasiTask.steadyState);
   if (steadyStateTask == null) return null;
   CSteadyStateProblem steadyStateProblem = (CSteadyStateProblem) steadyStateTask.getProblem();
   if (steadyStateProblem == null) return null;
   Set<String> keySet = problemParameters.keySet();
   for (Iterator<String> it = keySet.iterator(); it.hasNext(); ) {
     String key = (String) it.next();
     CCopasiParameter param = steadyStateProblem.getParameter(key);
     if (param == null) {
       return null;
     }
     Object o = problemParameters.get(key);
     if (o instanceof Double) {
       param.setDblValue(((Double) o).doubleValue());
     } else if (o instanceof Integer) {
       param.setIntValue(((Integer) o).intValue());
     } else if (o instanceof Boolean) {
       param.setBoolValue(((Boolean) o).booleanValue());
     } else if (o instanceof String) {
       param.setStringValue(((String) o));
     } else {
       System.err.println("Error. Unknown parameter type.");
     }
   }
   CNewtonMethod newtonMethod = (CNewtonMethod) steadyStateTask.getMethod();
   if (newtonMethod == null) {
     return null;
   }
   keySet = methodParameters.keySet();
   for (Iterator<String> it = keySet.iterator(); it.hasNext(); ) {
     String key = (String) it.next();
     CCopasiParameter param = newtonMethod.getParameter(key);
     if (param == null) {
       return null;
     }
     Object o = methodParameters.get(key);
     if (o instanceof Double) {
       param.setDblValue(((Double) o).doubleValue());
     } else if (o instanceof Integer) {
       param.setIntValue(((Integer) o).intValue());
     } else if (o instanceof Boolean) {
       param.setBoolValue(((Boolean) o).booleanValue());
     } else if (o instanceof String) {
       param.setStringValue(((String) o));
     } else {
       System.err.println("Error. Unknown parameter type.");
     }
   }
   boolean result = false;
   try {
     result = steadyStateTask.process(true);
   } catch (Exception e) {
     System.err.println("ERROR: " + e.getMessage());
   }
   if (!result) {
     return null;
   }
   return steadyStateTask;
 }