搜索内容 搜索用户

# [已答复] 分别代入隐函数中不同的参数，进行solve求解时得不到结果

as1025255 发表于 2020-11-26 11:24:43
 如上述公式，我想要实现：代入一系列的A值，解得一系列的x值，并且绘制两者的曲线图。 我尝试先给出一个A值（例如pi），直接代入到表达式里求解，可以成功得到结果： x=solve('x=((cos(pi)/(1+x))^2)*(sin(pi))*(((1+x)^2)-((cos(pi))^2)-1)^0.5','x') 回车得到结果x=0 然后我通过搜索，找到一个方法来实现代入一系列的A值进行求解，但是得不到想要的结果： 比如： A=[pi/2,pi] x=subs(solve('x=((cos(A)/(1+x))^2)*(sin(A))*(((1+x)^2)-((cos(A))^2)-1)^0.5','x')) 回车得到的结果是x=z1，我不明白z1是什么意思 我很奇怪，尝试了一个简单的例子，是可以成功算出来的： A=[1,2,3] x=subs(solve('x=A-2*x','x')) 回车得到结果为：x =[ 1/3, 2/3, 1] 恳请各位帮我指出问题所在，谢谢！

2 条回复

## 倒序浏览

as1025255 发表于 2020-11-26 11:26:45
 >> A=[pi/2,pi] x=subs(solve('x=((cos(A)/(1+x))^2)*(sin(A))*(((1+x)^2)-((cos(A))^2)-1)^0.5','x')) A =     1.5708    3.1416 警告: Support of strings that are not valid variable names or define a number will be removed in a future release. To create symbolic expressions, first create symbolic variables and then use operations on them. > In sym>convertExpression (line 1536)   In sym>convertChar (line 1441)   In sym>tomupad (line 1198)   In sym (line 177)   In solve>getEqns (line 405)   In solve (line 225) 警告: Do not specify equations and variables as character strings. Instead, create symbolic variables with syms. > In solve>getEqns (line 445)   In solve (line 225) 警告: The solutions are parameterized by the symbols: z1. To include parameters and conditions in the solution, specify the 'ReturnConditions' option. > In solve>warnIfParams (line 500)   In solve (line 356) 警告: The solutions are valid under the following conditions: cos(A)^6*sin(A)^2 + 4*z1^3 + 6*z1^4 + 4*z1^5 + z1^6 == z1^2*(cos(A)^4*sin(A)^2 - 1) + 2*z1*cos(A)^4*sin(A)^2 & (z1 == 0 | signIm((z1*(z1 + 1)^2*1i)/(cos(A)^2*sin(A))) == 1) & z1 ~= -1. To include parameters and conditions in the solution, specify the 'ReturnConditions' option. > In solve>warnIfParams (line 507)   In solve (line 356) x = z1

maple1314168 发表于 2020-11-27 09:46:44
 as1025255 发表于 2020-11-26 11:26 >> A= x=subs(solve('x=((cos(A)/(1+x))^2)*(sin(A))*(((1+x)^2)-((cos(A))^2)-1)^0.5','x')) 用新的写法吧！ syms A x subs(solve(x-A),A,[2 3]) 你以为随便的方程都可以解？
 您需要登录后才可以回帖 登录 | 注册 本版积分规则 回帖后跳转到最后一页