谁能用matlab求解,有程序最好,谢谢大家。

非常感谢你,有没有微信扣扣之类的,我们以后多交流... 非常感谢你,有没有微信扣扣之类的,我们以后多交流 展开
 我来答
learneroner
高粉答主

2016-03-05 · 关注我不会让你失望
知道大有可为答主
回答量:1.1万
采纳率:91%
帮助的人:6307万
展开全部

1、建立问题的数学模型:

2、matlab程序语言实现

2.1 先建立约束函数,保存为con_fun.m文件

function [c,ceq] = con_fun(x)
AB = sqrt(x(1).^2+x(2).^2);
AE = sqrt((x(1)-0.3).^2+(x(2)-1.0).^2);
BE = sqrt(1.09);
c = [];
ceq = (AB.^2+AE.^2-BE.^2)./(2.0*AE.*AB) - cos(10/180*pi);

2.2 然后使用fmincon()函数实现约束极值问题的求解

>> fun = @(x) sqrt((x(1)+1).^2+x(2).^2);  % 目标函数
>> x0 = [1.0, 1.0]; % 假设的初始解
>> options = optimset('Algorithm','interior-point'); % 求解算法
>> [x,d]= fmincon(fun,x0,[],[],[],[],[],[],@con_fun,options)
Local minimum found that satisfies the constraints.
Optimization completed because the objective function is non-decreasing in 
feasible directions, to within the default value of the function tolerance,
and constraints were satisfied to within the default value of the constraint tolerance.
<stopping criteria details>
x =
   -0.3397   -0.5291
d =
    0.8461
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式