我试图解决java中的非线性函数系统.特别是我有3个方程,有3个未知变量.虽然我已经设法解决了简单的方程式,但我的最终目标是解决一些相当大的方程式.例如,每个等式由以下形式的数百行(有时甚至数千行)组成:
public static double f2 (double x, double y, double z) {
double result = (0.49*Math.exp(-y - x)*Math.pow(x,2)*
(1 - Math.pow(z,94)*(0.00666 +
0.98*Math.exp(-y - x) + 0.98*Math.exp(-y - x)*
y*x + 0.245*Math.exp(-y - x)*Math.pow(y,2)*
Math.pow(x,2) + 0.02722*
Math.exp(-y - x)*Math.pow(y,3)*Math.pow(x,3) +
0.00170*Math.exp(-y - x)*
Math.pow(y,4)*Math.pow(x,4) + 0.00006*
Math.exp(-y - x)*Math.pow(y,5)*Math.pow(x,5) +
1.89043*Math.pow(10,-6)*Math.exp(-y - x)*
Math.pow(y,6)*Math.pow(x,6) + 3.85802*Math.pow(10,-8)*
Math.exp(-y - x)*Math.pow(y,7)*Math.pow(x,7) +
6.02816*Math.pow(10,-10)*Math.exp(-y - x)*
Math.pow(y,8)*Math.pow(x,8) + 7.44217*Math.pow(10,-12)*
Math.exp(-y - x)*Math.pow(y,9)*Math.pow(x,9) +
7.44217*Math.pow(10,-14)*Math.exp(-y - x)*
Math.pow(y,10)*Math.pow(x,10))))/(0.01333 +
0.98*Math.exp(-y - x)*y + …Run Code Online (Sandbox Code Playgroud) 我搜索过类似的问题,即使我找到了几个答案,也没有任何接缝可以工作.我有一个字符串列表
Z189
I142
M395
L210
V467
M203
Q277
Q461
Y440
S250
M162
Q96
22Q
W148
Q72
T22T
22TWE22
12E34
Run Code Online (Sandbox Code Playgroud)
我需要一个正则表达式才能找到只有2位数字(不多或少)的字符串.所以在这种情况下:
Q96, 22Q, Q72, T22T
我失败的尝试包括:
\D\d{2}\D
(?<!\d)\d{2}(?!\d)
Run Code Online (Sandbox Code Playgroud)