2023高教社杯全国大学生数学建模竞赛B题代码解析

2023高教社杯全国大学生数学建模竞赛B题 多波束测线问题 代码解析

因为一些不可抗力,下面仅展示部分matlab代码(第一问的部分),其余代码看文末

复制代码
x=70;
d=[-4	-3	-2	-1	0	1	2	3	4];
d=70 - 200 * tand(1.5) * d;

w = zeros(1,9);
eta = zeros(1,9);

x0 = [100 100 100 100 100];
options = optimoptions(@fsolve, 'MaxFunctionEvaluations', 10000, 'MaxIterations', 10000);

temp = fsolve(@root5d_1, x0, options);
w(1) = temp(5);
eta(1) = 1-200/w(1);

temp = fsolve(@root5d_2, x0, options);
w(2) = temp(5);
eta(2) = 1-200/w(2);


temp = fsolve(@root5d_3, x0, options);
w(3) = temp(5);
eta(3) = 1-200/w(3);


temp = fsolve(@root5d_4, x0, options);
w(4) = temp(5);
eta(4) = 1-200/w(4);


temp = fsolve(@root5d_5, x0, options);
w(5) = temp(5);
eta(5) = 1-200/w(5);

temp = fsolve(@root5d_6, x0, options);
w(6) = temp(5);
eta(6) = 1-200/w(6);

temp = fsolve(@root5d_7, x0, options);
w(7) = temp(5);
eta(7) = 1-200/w(7);

temp = fsolve(@root5d_8, x0, options);
w(8) = temp(5);
eta(8) = 1-200/w(8);

temp = fsolve(@root5d_9, x0, options);
w(9) = temp(5);
eta(9) = 1-200/w(9);

节选了部分:

复制代码
function F = root5d_7(x)
theta=pi/3*2;alpha=1.5/180*pi;D1=59.5256313723252;
k0=cos(theta/2);k1=cos(theta);k2=cos(pi/2-(theta/2)-alpha);k3=cos(pi/2-(theta/2)+alpha);
F(1) = (x(1)).^2+D1*D1-2*k0*D1.*x(1)-(x(3)).^2;
F(2) = (x(1)).^2+(x(2)).^2-2*k1.*x(1).*x(2)-(x(5)).^2;
F(3) = (x(1)).^2+(x(3)).^2-2*k2.*x(1).*x(3)-D1*D1;
F(4) = (x(2)).^2+(x(4)).^2-2*k3.*x(2).*x(4)-D1*D1;
F(5) = x(4)+x(3)-x(5);


syms q w e r t
theta=120/180*pi;alpha=1.5/180*pi;D1=70;
k0=cos(theta/2);k1=cos(theta);k2=cos(pi/2-(theta/2)-alpha);k3=cos(pi/2-(theta/2)+alpha);
eqns = [0== (q).^2+D1.^2-2*k0*D1.*q-(e).^2,
        0 == (q).*2+(w).*2-2*k1*q.*w-(t).*2,
        0== (q).*2+(e).*2-2*k2*q.*e-D1*2,
        0== (w).*2+(r).*2-2*k3*w.*r-D1*2,
        0== r+e-t];

[q, w, e, r, t] = vpasolve(eqns, [q w e r t], [0,2000;0,2000;0,2000;1,2000;0,2000;])

有关思路、相关代码、讲解视频、参考文献等相关内容可以点击下方群名片哦!

相关推荐
smart margin2 分钟前
Python安装教程
开发语言·python
Looooking3 分钟前
Python 流程自动化之 DrissionPage 使用示例
python·自动化·drissionpage
阿贵---3 分钟前
定时任务专家:Python Schedule库使用指南
jvm·数据库·python
TsukasaNZ3 分钟前
如何为开源Python项目做贡献?
jvm·数据库·python
云晓-6 分钟前
从零入门智能体:核心概念与发展脉络全解析
python
nananaij12 分钟前
【LeetCode-05 好数对的数目 python解法】
python·算法·leetcode
請你喝杯Java25 分钟前
Python 后端开发:从虚拟环境、pip、requirements.txt 到项目启动
开发语言·python·pip
YFLICKERH26 分钟前
【Python-Web后端开发框架】Flask | Django | FastAPI | Tornado 选型与 使用 | 特性
前端·python·flask
2401_8319207431 分钟前
Python生成器(Generator)与Yield关键字:惰性求值之美
jvm·数据库·python
飞Link1 小时前
具身智能中 Wrapper 架构的深度解构与 Python 实战
开发语言·python·架构