code: public double dodcps(double t,double mu1,double mu2,
  						 double t1,double t2,
  						 int option,double lambda)
  	{
  		double sqrtt;
  		double result = Double.NaN;
  
  		sqrtt = Math.sqrt(t);
  
  		if (option == 0) {
  			if (sqrtt <= t1)
  				result = p5*mu2*t;
  			else if (sqrtt > t1 && sqrtt < t2)
  				result = mu2*t1*sqrtt - lambda*mu1;
  			else if (sqrtt >= t2)
  				result = p5*mu1*t + lambda*(mu2-mu1);
  		} else if (option == 1) {
  			if (sqrtt <= t1)
  				result = p5*mu2;
  			else if (sqrtt > t1 && sqrtt < t2)
  				result = p5*mu2*t1/sqrtt;
  			else if (sqrtt >= t2)
  				result = p5*mu1;
  		} else if (option == 2) {
  			if (sqrtt <= t1)
  				result = zero;
  			else if (sqrtt > t1 && sqrtt < t2)
  				result = -p25*mu2*t1/(sqrtt*t);
  			else if (sqrtt >= t2)
  				result = zero;
  		}
  		if( Double.isNaN(result)) {
  			throw new RuntimeException("Bad");
  		}
  
  		return result;
  	}
docs: This subroutine computes the function psi(t) and the scaled
  functions psi'(t)/t and psi''(t)/t for the optimal design
  with composite materials problem.
  @param t
  @param mu1
  @param mu2
  @param t1
  @param t2
  @param option
  @param lambda
  @return