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;])

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

相关推荐
ValhallaCoder3 小时前
hot100-二叉树I
数据结构·python·算法·二叉树
猫头虎4 小时前
如何排查并解决项目启动时报错Error encountered while processing: java.io.IOException: closed 的问题
java·开发语言·jvm·spring boot·python·开源·maven
八零后琐话4 小时前
干货:程序员必备性能分析工具——Arthas火焰图
开发语言·python
青春不朽5125 小时前
Scrapy框架入门指南
python·scrapy
MZ_ZXD0016 小时前
springboot旅游信息管理系统-计算机毕业设计源码21675
java·c++·vue.js·spring boot·python·django·php
全栈老石7 小时前
Python 异步生存手册:给被 JS async/await 宠坏的全栈工程师
后端·python
梨落秋霜7 小时前
Python入门篇【模块/包】
python
三克的油8 小时前
数学建模-day5
数学建模
阔皮大师8 小时前
INote轻量文本编辑器
java·javascript·python·c#