24小时热门版块排行榜    

查看: 409  |  回复: 0

艾雨0802

新虫 (初入文坛)

[求助] 用1stopt迭代求参数,求高手帮我看看代码哪里有问题,谢谢

我是菜鸟一个,昨天才接触1Stopt,更加不会pascal语言。想迭代求解参数,使方程值最小。但是,点了“执行”后确没有啥反应。我用的1.5pro版本。跪求高手指点!谢谢

algorithm=5par_retrieval ;
constant theta(1:9)=[30,32.5,35,37.5,40,42.5,45,47.5,50] ;
constant TBh_obs(1:9)=[241.17748,240.65136,239.83198,238.66749,237.10444,235.08808,232.56285,229.47270,225.76159] ;
constant p=0.01744,mus=0.1;
parameter eb[3,30],tau[0,1.0],omega[0,0.5],rms[0.0025,0.03],cl[0.05,0.5];
minimum;
startprogram [pascal];
procedure mainmodel;
var i:integer;
    tt:array[1..9] of double;
    Ah:array[1..9] of double;
    Bh:array[1..9] of double;
    Ch:array[1..9] of double;
    rh:array[1..9] of double;
    eh:array[1..9] of double;
    E_eff:array[1..9] of double;
    cf,temp:double;
Begin
    cf:=0.0
    tt[1]:=exp(-tau/COS(theta[1]*p)) ;
    rh[1]:=ABS((mus*COS(theta[1]*p)-SQRT(mus*eb-SIN(theta[1]*p)*SIN(theta[1]*p)))/(mus*COS(theta[1]*p)+SQRT(mus*eb-SIN(theta[1]*p)*SIN(theta[1]*p))))^2;
    Ah[1]:=0.068502*(theta[1]*p)^2 -0.058486*(theta[1]*p) +0.976321;
    Bh[1]:=-0.051377*(theta[1]*p)^2 +0.014978*(theta[1]*p) +0.045456 ;
    Ch[1]:=0.601618*(theta[1]*p)^2 -0.151848*(theta[1]*p) -0.607679;
    eh[1]:=1-rh[1]*Ah[1]*exp(Bh[1]*(rms^2/cl)^2+Ch[1]*(rms^2/cl)) ;
    E_eff[1]:=eh[1]*tt[1]+(1-tt[1])*(1-omega)+(1-eh[1])*(1-omega)*(1-tt[1])*tt[1];
    for i:=2 to 9 do begin
        tt:=exp(-tau/COS(theta*p)) ;
        rh:=ABS((mus*COS(theta*p)-SQRT(mus*eb-SIN(theta*p)*SIN(theta*p)))/(mus*COS(theta*p)+SQRT(mus*eb-SIN(theta*p)*SIN(theta*p))))^2;
        Ah:=0.068502*(theta*p)^2 -0.058486*(theta*p) +0.976321;
        Bh:=-0.051377*(theta*p)^2 +0.014978*(theta*p) +0.045456 ;
        Ch:=0.601618*(theta*p)^2 -0.151848*(theta*p) -0.607679;
        eh:=1-rh*Ah*exp(Bh*(rms^2/cl)^2+Ch*(rms^2/cl)) ;
        E_eff:=eh*tt+(1-tt)*(1-omega)+(1-eh)*(1-omega)*(1-tt)*tt;
        cf:=cf+(E_eff/E_eff[1]-TBh_obs/TBh_obs[1])^2 ;
        temp:=cf;
    end ;
    Functionresult:=temp  ;
End;
Endprogram;
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

智能机器人

Robot (super robot)

我们都爱小木虫

相关版块跳转 我要订阅楼主 艾雨0802 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 售SCI一区T0P文章,我:8.O.55.1.O.54,科目齐全,可+急 +3 gy1nBQXYQJqL 2026-08-29 4/200 2026-08-30 06:57 by ZPa0EcMwuECS
[找工作] 售SCI文章,我:8O5.5.1.O.54,科目齐全,可+急 +4 gy1nBQXYQJqL 2026-08-29 7/350 2026-08-30 06:46 by ZPa0EcMwuECS
[考博] 售SCI一区T0P文章,我:8.O.55.1.O54,科目全,可伽急 +6 ASdOkHsho7FD 2026-08-28 10/500 2026-08-30 06:11 by ZPa0EcMwuECS
[硕博家园] 售SCI一区T0P文章,我:8.O55.1.O.54,科目全,可十急 +6 ASdOkHsho7FD 2026-08-28 13/650 2026-08-30 05:38 by ZPa0EcMwuECS
[公派出国] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +4 gy1nBQXYQJqL 2026-08-29 4/200 2026-08-30 01:45 by ZPa0EcMwuECS
[考博] 售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急 +3 gy1nBQXYQJqL 2026-08-29 4/200 2026-08-30 01:34 by ZPa0EcMwuECS
[基金申请] 中青基了要发朋友圈吗? +4 349506619 2026-08-28 4/200 2026-08-29 22:41 by alongwaytogo
[基金申请] 2026年叶企孙基金 +4 bud_bud 2026-08-27 7/350 2026-08-29 07:23 by foolishmani
[基金申请] 怎么查啊 +6 huang1991js 2026-08-26 6/300 2026-08-28 08:42 by winsaint
[基金申请] 为什么 国际(地区)合作与交流项目 没有放榜? 10+3 majunge000 2026-08-26 11/550 2026-08-27 08:42 by 北京莱茵编辑
[基金申请] 我不理解! +15 Edward_pc 2026-08-26 23/1150 2026-08-26 20:34 by zzuzxg
[基金申请] 出来了 +9 trojank 2026-08-26 9/450 2026-08-26 14:25 by 宝贝虫子
[基金申请] 国合里面能看到了 +7 一怀馨秋 2026-08-26 7/350 2026-08-26 11:23 by zhaosm1982
[基金申请] 国际合作可查了,中了面上 (EPI+1)(金币+50) +18 Ldrop2023 2026-08-26 18/900 2026-08-26 11:15 by cmrandy
[基金申请] 国合可查了 +3 paperzjh 2026-08-26 3/150 2026-08-26 10:41 by LemmonTr
[基金申请] 国合现在查不到了吗? +10 chengyan1220 2026-08-24 20/1000 2026-08-26 08:57 by peasantsprig
[基金申请] 牛来!米来!面来! +8 beefly 2026-08-26 8/400 2026-08-26 08:37 by xuzhipiao
[基金申请] 在坚冰还盖着北海的时候,我看到了怒放的梅花。 (金币+10) +6 ziyangfang 2026-08-25 9/450 2026-08-25 20:26 by huagongfeihu
[基金申请] 明天应该可查了!? +6 chengyan1220 2026-08-23 6/300 2026-08-25 19:45 by zfd97
[基金申请] 某些机构,以效率低为荣,以效率低作为存在感 +9 yuleib84 2026-08-25 10/500 2026-08-25 17:14 by alexon
信息提示
请填处理意见