![]() |
[求助]关于Explicit solution could not be found的问题
t1 = [26.7 0 23.2 11.5 29.3 32.5 41.5 43.8 29.7 6.3];
t2 = [34.7 20.6 18.6 0 13.4 0 4.5 0 0 0]; t3 = [0 14.2 0 25.2 17.6 38.2 31.2 47.7 54.1 41.6]; t4 = [35.3 36.3 12.4 29.3 0 28.7 0 26.5 54.3 53.2]; t1=t1/10^6; t2=t2/10^6; t3=t3/10^6; t4=t4/10^6; t1=t1-t3; t2=t2-t3; t4=t4-t3; syms r t c; for i=1:10 result1 = solve('2 * r * sin(t) * 0.450 + 2 * r * c * t1(i) - 0.450^2 - c^2 * t1(i)^2' ,'2 * r * cos(t) * 0.3 + 2 * r * sin(t) * 0.450 + 2 * r * c * t1(i) - 0.3^2 - 0.450^2 - c^2 * t2(i)^2' ,'2 * r * cos(t) * 0.3 + 2 * r * c * t4(i) - 0.3^2 - c^2 * t4(i)^2'); 看源程序文档 R = feval(symengine,'mlfsolve',eqns,vars); --cut-- if isempty(R) warning('symbolic:solve:warnmsg3','Explicit solution could not be found.'); 这是怎么一回事? 另外我想了解一下,由下面这个方程组,其中a、b、c为未知量,t1、t2、t4为已知量,用solve命令写出来是我上面那种写法么? (a * cos(b) - 0.000)^2 + (a * sin(b) - 0.450)^2 = (a + c * t1(i))^2 (a * cos(b) - 0.300)^2 + (a * sin(b) - 0.450)^2 = (a + c * t2(i))^2 (a * cos(b) - 0.300)^2 + (a * sin(b) - 0.000)^2 = (a + c * t4(i))^2 谢谢各位 |
回复: [求助]关于Explicit solution could not be found的问题
clear;
syms a b c t1 t2 t4; [a,b,c]=solve('(a * cos(b) - 0.000)^2 + (a * sin(b) - 0.450)^2 = (a + c * t1(i))^2', '(a * cos(b) - 0.300)^2 + (a * sin(b) - 0.450)^2 = (a + c * t2(i))^2 ', '(a * cos(b) - 0.300)^2 + (a * sin(b) - 0.000)^2 = (a + c * t4(i))^2 ','a','b','c') 应该是这样些的,但是我求解出来没有显式解。估计要用牛顿法计算比较好。我这里有个函数文件,希望可以帮到你: function [R,n]=newton_methods(x0,eps) if nargin==1 eps=1.0e-4; end r=x0-myfun(x0)/dmyfun(x0); n=1; tol=1; while tol>eps x0=r; R=x0-myfun(x0)/dmyfun(x0); tol=norm(r-x0); n=n+1; if(n>100000) disp('迭代步数太多,可能不收敛!'); return; end end 你需要自己编写myfun,就是你的方程。注意写成Equation=0的形式,但只需要Equation部分。 |
所有时间均为北京时间。现在的时间是 04:58。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.