mathematica 求解带参数的方程组,下面程序解不出答案,pi = 3.14w = 3*10^(-5)x = 15*10^(-6)d = 1*10 (-3)r = 150*10^(-6)Nsolve[{(R - z + d)^2 + r^2 - 2*r*(R - z + d) == R,R == z*(1 + (pi*w^2/(x*z))^2)},{R,z}]
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 06:46:44
mathematica 求解带参数的方程组,下面程序解不出答案,pi = 3.14w = 3*10^(-5)x = 15*10^(-6)d = 1*10 (-3)r = 150*10^(-6)Nsolve[{(R - z + d)^2 + r^2 - 2*r*(R - z + d) == R,R == z*(1 + (pi*w^2/(x*z))^2)},{R,z}]
mathematica 求解带参数的方程组,下面程序解不出答案,
pi = 3.14
w = 3*10^(-5)
x = 15*10^(-6)
d = 1*10 (-3)
r = 150*10^(-6)
Nsolve[{(R - z + d)^2 + r^2 - 2*r*(R - z + d) == R,R == z*(1 + (pi*w^2/(x*z))^2)},{R,z}]
mathematica 求解带参数的方程组,下面程序解不出答案,pi = 3.14w = 3*10^(-5)x = 15*10^(-6)d = 1*10 (-3)r = 150*10^(-6)Nsolve[{(R - z + d)^2 + r^2 - 2*r*(R - z + d) == R,R == z*(1 + (pi*w^2/(x*z))^2)},{R,z}]
Mathematica的语句是要有分号结尾的,还有就是系统默认函数采用的是驼峰命名法.
不过Mathematica的提示很管用,比如你敲nsolve,紧接着按ctrl+K,就会有提示和纠正你的拼写错误,变成NSolve .
这样就可以了
pi = 3.14;
w = 3*10^(-5);
x = 15*10^(-6);
d = 1*10 (-3);
r = 150*10^(-6);
NSolve[{(R - z + d)^2 + r^2 - 2*r*(R - z + d) == R,
R == z*(1 + (pi*w^2/(x*z))^2)},{R,z}]
大写如下:
pi = 3.14
w = 3*10^(-5)
x = 15*10^(-6)
d = 1*10 (-3)
r = 150*10^(-6)
NSolve[{(R - z + d)^2 + r^2 - 2*r*(R - z + d) == R,
R == z*(1 + (pi*w^2/(x*z))^2)}, {R, z}]
第二个方程中z是三次方,两个方程不能解三次的吧