337909015 发表于 2022-5-16 14:54

一个三角函数的二元方程求解

L1*cos(d1)+L2*cos(d2) = x;
L1*sin(d1)+L2*sin(d2) = y;
L1, L2, x, y,这4个变量已知,求d1和d2。
哪位大神有空指导一下

liwenhui 发表于 2022-5-31 14:01

解析解应该不存在吧,数值解倒是很容易有。用LINGO就可以求出一个。

liwenhui 发表于 2022-5-31 14:04

解析解求不出来,数值解倒是很容易,用LINGO就可以求解:以L1=2,L2=1.5,x=2,y=1.7为例L1= 2  ;
L2= 1.5;
x = 2  ;
y = 1.7;
L1*@cos(d1)+L2*@cos(d2) = x;
L1*@sin(d1)+L2*@sin(d2) = y;
@free(d1);
@free(d2);

calc:
  @set("global",1);
endcalc得到结果: Feasible solution found.
  Infeasibilities:                             0.1715073E-10
  Extended solver steps:                               0
  Total solver iterations:                           273


                                           Variable           Value
                                                 L1        2.000000
                                                 L2        1.500000
                                                  X        2.000000
                                                  Y        1.700000
                                                 D1        1.308804
                                                 D2        6.128063

                                                Row    Slack or Surplus
                                                  1        0.000000
                                                  2        0.000000
                                                  3        0.000000
                                                  4        0.000000
                                                  5        0.000000
                                                  6        0.000000

即D1=1.08804,D2=6.128063

页: [1]
查看完整版本: 一个三角函数的二元方程求解