求助用MATLAB求解如下三角函数方程组,最好有源程序

L2*sin(θ2)-L3*sin(θ3)-A+L1*sin(θ1)=0
L2*cos(θ2)-L3*cos(θ3)-B+L1*cos(θ1)=0

其中,L1=0.1、L2=0.4、L3=0.22、A=0.3、B=-0.35,变量为θ2、θ3
目的:当θ1分别等于0,2,4,······,360(即θ1从0到360两度一间隔取值)时,求出变量θ2、θ3的值
请不吝赐教,给出MATLAB源程序,万分感谢!!!

theta = 0:2:360;
L = length(theta);
SolvedTheta = zeros(L,2);

for i = 1:L

f = @(theta,theta1)([ 0.4*sin(theta(1))-0.22*sin(theta(2))-0.3+0.1*sin(theta1) ...
0.4*cos(theta(1))-0.22*cos(theta(2))+0.35+0.1*cos(theta1)]);
options = optimset('TolFun',0.01,'Display','off');
SolvedTheta(i,:) = fsolve(f,[0,0],options,theta(i));
end
SolvedTheta

结果:

SolvedTheta =

2.1837 0.1401
1.9472 0.9019
1.7350 0.0957
2.1695 0.0155
2.0349 0.7966
1.6970 0.2042
2.1180 -0.0580
2.0663 0.7687
1.6851 0.3348
2.0624 0.0165
2.1320 0.6402
1.7015 0.5006
2.0070 -0.0621
2.1604 0.5343
1.7169 0.5559
1.9396 -0.0800
2.1449 0.3909
1.8099 0.7113
1.8666 -0.0541
2.1885 0.2686
1.8906 0.7826
1.7966 0.0048
2.1844 0.1472
1.9434 0.9011
1.7381 0.0896
2.1707 0.0229
2.0317 0.7983
1.6987 0.1968
2.1190 -0.0527
2.0659 0.7700
1.6850 0.3258
2.0654 0.0240
2.1298 0.6465
1.6999 0.4883
2.0109 -0.0592
2.1590 0.5410
1.7097 0.5457
1.9440 -0.0803
2.1419 0.3987
1.8049 0.7058
1.8711 -0.0567
2.1779 0.2666
1.8856 0.7793
1.8007 0.0003
2.1148 0.2157
1.9397 0.9002
1.7412 0.0836
2.1718 0.0306
2.0283 0.8000
1.7004 0.1895
2.1198 -0.0474
2.0652 0.7713
1.6850 0.3171
2.0684 0.0319
2.1276 0.6527
1.6983 0.4764
2.0147 -0.0561
2.1575 0.5478
1.7031 0.5359
1.9485 -0.0804
2.1387 0.4063
1.8000 0.7003
1.8757 -0.0593
2.1881 0.2844
1.8805 0.7757
1.8049 -0.0041
2.1857 0.1617
1.9359 0.8991
1.7445 0.0778
2.1728 0.0387
2.0249 0.8015
1.7023 0.1822
2.1203 -0.0418
2.0642 0.7728
1.6851 0.3084
2.0712 0.0401
2.1253 0.6588
1.6967 0.4648
2.0185 -0.0527
2.1560 0.5545
1.6969 0.5265
1.9529 -0.0804
2.1735 0.4500
1.7950 0.6946
1.8803 -0.0617
2.1878 0.2924
1.8755 0.7721
1.8091 -0.0084
2.1862 0.1690
1.9321 0.8978
1.7478 0.0719
2.1737 0.0473
2.0213 0.8029
1.7043 0.1751
2.1207 -0.0361
2.0631 0.7744
1.6853 0.2998
2.0741 0.0488
2.1230 0.6649
1.6952 0.4535
2.0222 -0.0490
2.1545 0.5613
1.7259 0.5445
1.9573 -0.0802
2.1728 0.4561
1.7922 0.6839
1.8849 -0.0640
2.1875 0.3004
1.8704 0.7682
1.8133 -0.0126
2.1337 0.2613
1.9283 0.8963
1.7512 0.0662
2.1744 0.0565
2.0176 0.8042
1.7063 0.1680
2.1207 -0.0303
2.0617 0.7761
1.6857 0.2913
2.0769 0.0578
2.1206 0.6709
1.6938 0.4425
2.0258 -0.0451
2.1529 0.5680
1.7074 0.6759
1.9616 -0.0797
2.1285 0.4284
1.7892 0.6732
1.8895 -0.0661
2.1872 0.3084
1.8654 0.7642
1.8176 -0.0167
2.1871 0.1838
1.9245 0.8947
1.7546 0.0606
2.1749 0.0665
1.9846 0.9004
1.7085 0.1610
2.1240 0.0471
2.0601 0.7779
1.6862 0.2829
2.0796 0.0673
2.1182 0.6768
1.6925 0.4317
2.0294 -0.0410
2.1512 0.5747
1.7097 0.6555
1.9659 -0.0792
2.1714 0.4685
1.7857 0.6634
1.8941 -0.0681
2.1868 0.3164
1.8603 0.7601
1.8219 -0.0206
2.1875 0.1913
1.8601 0.7180
1.7582 0.0550
2.1754 0.0765
1.9809 0.9013
1.7108 0.1541
2.1200 -0.0182
2.0583 0.7797
1.6868 0.2747
2.0823 0.0771
2.1158 0.6826
1.6913 0.4212
2.0330 -0.0365
2.1495 0.5814
1.7109 0.6363
1.9702 -0.0784
2.1211 0.4424
1.7030 0.5664
1.8987 -0.0700
2.1746 0.3884
1.8552 0.7558
1.8263 -0.0245
2.1878 0.1988
1.8539 0.7144
1.7617 0.0496
2.1762 0.0850
1.9772 0.9020
温馨提示:内容为网友见解,仅供参考
第1个回答  推荐于2016-04-07
syms theta1 theta2 theta3 %theta1——θ1,theta2——θ2,theta3——θ3
for theta1=0:20:360; %为了分别调试,所以步长选了20,你可以按你的要求改为 theta1=0:2:360;
L1=0.1;L2=0.4;L3=0.22;A=0.3;B=-0.35;
s=solve(L2*sin(theta2)-L3*sin(theta3)-A+L1*sin(theta1),L2*cos(theta2)-L3*cos(theta3)-B+L1*cos(theta1),'theta2','theta3');
[theta1 double(s.theta2(1)) double(s.theta2(2)) double(s.theta3(1)) double(s.theta3(2))]
end
运行结果为

θ1、 θ2、 θ2、 θ3、 θ3 %θ2、θ3有两个根

ans =
0 2.1882 2.9190 0.1192 -1.2952
ans =
20.0000 2.1328 -3.1138 0.6309 -1.6119
ans =
40.0000 1.8919 3.0468 0.7758 -2.1203本回答被提问者采纳

求助用MATLAB求解如下三角函数方程组,最好有源程序
theta = 0:2:360;L = length(theta);SolvedTheta = zeros(L,2);for i = 1:L f = @(theta,theta1)([ 0.4*sin(theta(1))-0.22*sin(theta(2))-0.3+0.1*sin(theta1) ...0.4*cos(theta(1))-0.22*cos(theta(2))+0.35+0.1*cos(theta1)]);options = optimset('Tol...

求助用MATLAB求解如下三角函数方程组,最好有源程序
syms theta1 theta2 theta3 theta1——θ1,theta2——θ2,theta3——θ3 for theta1=0:20:360;为了分别调试,所以步长选了20,你可以按你的要求改为 theta1=0:2:360;L1=0.1;L2=0.4;L3=0.22;A=0.3;B=-0.35;s=solve(L2*sin(theta2)-L3*sin(theta3)-A+L1*sin(theta1),L...

哪位高人能利用MATLAB求解如下三角函数方程组,最好有源程序?
clc,clear;syms x2 x3 x4 x5 x6 y x=0,i=1;while x<=360 x1=x*pi\/180;eq1=300*sin(x1)-1000*sin(x3)+140-1450*sin(x5)eq2=300*cos(x1)-1000*cos(x3)-600-1450*cos(x5)eq3=300*sin(x1)+1734.6*sin(x2)+1450-2628.5*sin(x4)-1450*sin(x5)eq4=300*cos(x1)+1734....

matlab计算三角函数组,列出代码?
如何用matlab计算三角函数方程组?第一步,用syms命令,对变量进行声明,即 syms x1 x2 第二步,使用vpasolve函数,求解方程组,得到其数值解,即 [x1,x2]=vpasolve(110.4*sin(x1)+96*cos(x2)==193.61,110.4*cos(x1)-96*sin(x2)==21.82)第三步,验算结果是否是方程的解,即 disp(&...

MATLAB解带三角函数的方程组,如何编程
1、对于简单的三角方程,可以用solve()来求解,得到解析解。如 其求解代码和结果为 2、对于复杂的三角方程,可以用Broyden(拟牛顿法)等方法来求解,得到数值解。如 其求解过程如下 ①建立自定义函数文件,funm。m function y = funm(x)x=x(1,1),y=x(2,1)y(1,1) = x(1,1) - 0.7...

急求,如何用matlab解下面这个三角函数方程组的解
3*tan(0.5*a)-25206029.4*tan(0.5*b)=18472644','1024441.7*tan(0.31*a)*tan(0.31*b)+5447993.34*tan(0.31*a)+5331932.755*tan(0.31*b)=16959129.83')a = -25.845985006518124088166033714856 b = 37.405182853785968383691534379009 a和b好像不在1-10之间,是不是方程数据有误 ...

matlab 求解三角函数组,列出代码
已知的三角函数组,可以通过for循环语句和vpasolve函数配合使用。求得其y、z值。x0=0:pi\/10:2*pi;for i=1:length(x0)syms y z x=x0(i);[y,z]=vpasolve(30\/tan(y)+300*cos(z)==100*cos(x),30+300*sin(z)==100*sin(x));y0(i)=double(y);z0(i)=double(z);end [x0' ...

Matlab 中解三角函数方程组,求代码!
f=solve('8-8*cos(x)-10*t=0','t-4.9*t^2+3*sin(x)=0','t,x');%一共4组解 f.t f.x

怎么用matlab解带三角函数的方程组
c =0.472074874092906 求解方法:w0=[0.3 0.3 0.4][w,fval] = fmincon(@(w) fmincon_fun(w),w0)a=w(1),b=w(2),c=w(3)x=1000*cos(a)+1000*cos(a+b)+1000*cos(a+b+c) %验证 x =2000 y=1000*sin(a)+1000*sin(a+b)+1000*sin(a+b+c) %验证 y =2000 ...

matlab 如何解三角函数的方程组 式子如下 求解x,y
用solve函数求解联立方程组。[x,y]=solve('a1=b1-x*tan(y*c1)','a2=b2-x*tan(y*c2)')求不出显示解,要给定参数,[x,y]=solve('0=2-x*tan(y*pi)','4=1-x*tan(y*pi\/4)')可以help solve查看 或者用fsolve,你可以输入fzero参看里面有个例子 ...

相似回答