作业帮 > 数学 > 作业

matlab solve问题,同样使用solve,在使用input的情况下,少了一个解

来源:学生作业帮 编辑:百度作业网作业帮 分类:数学作业 时间:2024/04/30 17:04:15
matlab solve问题,同样使用solve,在使用input的情况下,少了一个解
同一个方程15.24*ln(d)+15.24*d1/d-t1-35.54=0,用第一种方法算
syms t1 d1
d=solve('15.24*ln(d)+15.24*d1/d-t1-35.54=0','d');
subs(d,{t1,d1},{input('t1='),input('d1=')})
t1=5
d1=3
解是10.8416
直接把t1 d1的值代入方程d=solve('15.24*ln(d)+15.24*3/d-5-35.54=0','d')
10.841637111238806658473244298955
1.2181326953943313984631333004584
matlab solve问题,同样使用solve,在使用input的情况下,少了一个解
我运行了一下,结果是这样的:

>> d=solve('15.24*ln(d)+15.24*3/d-5-35.54=0','d')

d =

10.841637111238806658473244298955

>>

直接把t1 d1的值代入方程d=solve('15.24*ln(d)+15.24*3/d-5-35.54=0','d')
解是
10.841637111238806658473244298955
没有
1.2181326953943313984631333004584
你运行的时候出现了两个解,包括10.841637111238806658473244298955
和1.2181326953943313984631333004584吗?
再问: 是的,而且1.218……那个答案确实也正确
再答: solve得到的可能只是部分的结果,并不是全部解。 你看这篇文章:http://www.mathworks.cn/cn/help/symbolic/solve.html Try solving the following equation. The symbolic solver cannot find an exact symbolic solution for this equation, and therefore, it calls the numeric solver. Because the equation is not polynomial, an attempt to find all possible solutions can take a long time. The numeric solver does not try to find all numeric solutions for this equation. Instead, it returns only the first solution that it finds: syms x solve(sin(x) == x^2 - 1) ans = -0.63673265080528201088799090383828 你给的这个等式与之类似,solve函数找不到解析解,所以只能去找数值解。 然而等式不是多项式的,因此不去找全部的解,只找到一个解。