public double calculateString(String str, double x) {
		str = str.replaceAll("PI", String.valueOf(Math.PI))
				.replaceAll("x", String.valueOf(x)).replaceAll("sinh", "i")
				.replaceAll("cosh", "o").replaceAll("tanh", "a")
				.replaceAll("asin", "n").replaceAll("acos", "m")
				.replaceAll("atan", "q").replaceAll("exp", "e")
				.replaceAll("sin", "s").replaceAll("cos", "c")
				.replaceAll("tan", "t");
		char[] strs = str.toCharArray();
		Stack<String> stack = new Stack<String>();
		// 依次提取表达式内部子表达式进行运算；
		for (int i = 0; i < strs.length; i++) {
			String stackStr = String.valueOf(strs[i]);
			stack.push(stackStr);
			if (")".equals(stack.peek())) {
				String subStr = null;
				while (!"(".equals(stack.peek())) {
					stack.pop();
					if (!"(".equals(stack.peek())) {
						subStr = addEnd(subStr, stack.peek());
					}
				}
				String pushStr = CalculateReversePolishExpression(subStr);
				stack.pop();
				stack.push(pushStr);
			}
		}
		String resultStr = null;
		while (stack.count != 0) {
			resultStr = CalculateReversePolishExpression(stack.toString());
		}
		return Double.valueOf(resultStr);
	}