24小时热门版块排行榜    

查看: 341  |  回复: 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 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 280求调剂 +11 咕噜晓晓 2026-03-18 12/600 2026-03-21 22:40 by ACS Nano——
[基金申请] 山东省面上项目限额评审 +3 石瑞0426 2026-03-19 3/150 2026-03-21 18:59 by RRRKKK
[考研] 277材料科学与工程080500求调剂 +6 自由煎饼果子 2026-03-16 6/300 2026-03-21 17:21 by 学员8dgXkO
[考研] 268求调剂 +9 简单点0 2026-03-17 9/450 2026-03-21 15:37 by lature00
[考研] 265求调剂 +3 Jack?k?y 2026-03-17 3/150 2026-03-21 03:17 by JourneyLucky
[考研] 303求调剂 +5 睿08 2026-03-17 7/350 2026-03-21 03:11 by JourneyLucky
[考研] 华东师范大学-071000生物学-293分-求调剂 +3 研究生何瑶明 2026-03-18 3/150 2026-03-21 01:30 by JourneyLucky
[考研] 324求调剂 +5 lucky呀呀呀鸭 2026-03-20 5/250 2026-03-20 22:30 by 促天成
[考研] 材料学硕297已过四六级求调剂推荐 +11 adaie 2026-03-19 11/550 2026-03-20 21:30 by laoshidan
[考研] 一志愿西安交通大学 学硕 354求调剂211或者双一流 +3 我想要读研究生 2026-03-20 3/150 2026-03-20 20:13 by JourneyLucky
[考研] 353求调剂 +3 拉钩不许变 2026-03-20 3/150 2026-03-20 19:56 by JourneyLucky
[考研] 招收调剂硕士 +4 lidianxing 2026-03-19 12/600 2026-03-20 12:25 by lidianxing
[考博] 招收博士1-2人 +3 QGZDSYS 2026-03-18 3/150 2026-03-20 11:58 by 呱呱呱呱叫
[考研] 320求调剂0856 +3 不想起名字112 2026-03-19 3/150 2026-03-19 22:53 by 学员8dgXkO
[考研] 085601材料工程专硕求调剂 +10 慕寒mio 2026-03-16 10/500 2026-03-19 15:26 by 丁丁*
[考研] 328求调剂,英语六级551,有科研经历 +4 生物工程调剂 2026-03-16 12/600 2026-03-19 11:10 by 生物工程调剂
[考研] 0703化学336分求调剂 +6 zbzihdhd 2026-03-15 7/350 2026-03-18 09:53 by zhukairuo
[考研] 材料专硕326求调剂 +6 墨煜姒莘 2026-03-15 7/350 2026-03-17 17:10 by ruiyingmiao
[考研] 318求调剂 +3 Yanyali 2026-03-15 3/150 2026-03-16 16:41 by houyaoxu
[考研] 中科院材料273求调剂 +4 yzydy 2026-03-15 4/200 2026-03-16 15:59 by Gaodh_82
信息提示
请填处理意见