24小时热门版块排行榜    

查看: 2486  |  回复: 15

ju5200

木虫 (正式写手)

送红花一朵
自己琢磨了一会 这样应该可以了 (包括图)
clc
clear
format long
syms x2 x3 T
a=2.856;
X3=[];M=[];x2=[];
x1=pi/20:pi/20:pi/2
for i=1:length(x1)
    x00=x1(i);
    m=sqrt(1+(a+1)^2/(a*tan(x00))^2);
    M(i)=m;
    x20=atan(tan(x00)/(1+a*(1+tan(x00))*tan(x00)));
    %atan(x)范围-pi/2~pi/2,满足要求
    x2(i)=x20;
    [yy,fval,exitflag]=fmincon(@(x3)tan(x20)-(m^2*sin(x20+x3)*sin(x20+x3)-1)*cot(x20+x3)/(m^2*((a+1)/2-sin(x20+x3)*sin(x20+x3))-1),0,[],[],[],[],0,pi/2);
    X3(i)=yy;
end
M
x1
x2
X3
plot(x1,X3);
xlabel('x1')
ylabel('x3')
11楼2014-01-07 20:51:54
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dingd

铁杆木虫 (职业作家)

引用回帖:
10楼: Originally posted by ju5200 at 2014-01-07 19:43:58
可否告知具体实现方法...

用1stOpt,代码如下:
CODE:
Constant a=2.856;
Parameter x2=[0,pi/2], x3=[0,pi/2];
LoopConstant x1=[pi/100:pi/40:pi/2];
PlotLoopData x1[x],x3;
Function m^2=1+(a+1)^2/(a*tan(x1))^2;
         tan(x2)=tan(x1)/(1+a*(1+tan(x1))*tan(x1));
         tan(x2)=(m^2*sin(x3+x2)*sin(x3+x2)-1)*cot(x3+x2)/(m^2*((a+1)/2-sin(x3+x2)*sin(x3+x2))-1);

12楼2014-01-07 21:01:04
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

ju5200

木虫 (正式写手)

至于为何答案与版主有出入 还请自己斟酌
13楼2014-01-07 21:01:44
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

ju5200

木虫 (正式写手)

引用回帖:
12楼: Originally posted by dingd at 2014-01-07 21:01:04
用1stOpt,代码如下:

Constant a=2.856;
Parameter x2=, x3=;
LoopConstant x1=;
PlotLoopData x1,x3;
Function m^2=1+(a+1)^2/(a*tan(x1))^2;
         tan(x2)=tan(x1)/(1+a*(1+tan(x1))*tan(x1));
   ...

那我这段代码有什么问题吗 结果稍有出入
14楼2014-01-07 21:02:16
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

ju5200

木虫 (正式写手)

M =
  Columns 1 through 3
   8.582903223762685   4.273938448777693   2.832213806724004
  Columns 4 through 6
   2.110286703931021   1.680142306733627   1.400796860655276
  Columns 7 through 9
   1.213774556514105   1.091991927151632   1.022608453435410
  Column 10
   1.000000000000000
x1 =
  Columns 1 through 3
   0.157079632679490   0.314159265358979   0.471238898038469
  Columns 4 through 6
   0.628318530717959   0.785398163397448   0.942477796076938
  Columns 7 through 9
   1.099557428756428   1.256637061435917   1.413716694115407
  Column 10
   1.570796326794897
x2 =
  Columns 1 through 3
   0.103555680176685   0.144718612570458   0.158063011752686
  Columns 4 through 6
   0.157235527421285   0.147898983200563   0.132316327109166
  Columns 7 through 9
   0.111015187136047   0.083343210741282   0.047478224447335
  Column 10
   0.000000000000000
X3 =
  Columns 1 through 3
   0.868368679046074   0.850111857513349   0.873011826888741
  Columns 4 through 6
   0.921909356113148   0.991041512984862   1.077308302925381
  Columns 7 through 9
   1.181128432161135   1.306571217046848   1.570796326794897
  Column 10
   1.570796326794897
>>
15楼2014-01-07 21:02:42
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

ju5200

木虫 (正式写手)

引用回帖:
14楼: Originally posted by ju5200 at 2014-01-07 21:02:16
那我这段代码有什么问题吗 结果稍有出入...

matlan求解含有三角函数的隐函数问题?
16楼2014-01-07 21:04:18
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 815292578 的主题更新
信息提示
请填处理意见