Hi,
I have a set of enviroment loadcase which variable are heading, Hs, Tp. The condition are such as
Load Case
Significant Wave Height, HS
Peak Period, TP
Gamma, ɤ
Angle of Incidence
m
s
deg
101
5.9
13.6
1.0
315
102
5.1
12.7
270
103
225
104
2.5
8.9
180
105
8.8
135
106
2.8
9.5
90
107
4.6
12.1
45
108
5.4
13.0
0
I have tried the loop command but moses loop all condition at once, appreciate if you can point out the mistake and correction. The code are shown below:
&set head_l = 315 270 225 180 135 90 45
&set sptum = JONSWAP
&set hs_l = 5.9 5.1 5.1 2.5 2.5 2.8 4.6 5.4
&set tp_l = 13.6 12.7 12.7 8.9 8.8 9.5 12.1 13.0
&set sp_type = peak
&set gamma_l = 1.0
&data env
&set list_env =
&loop n 1 &token (%tp_l) l
&loop m 1 &token (%head_l) l
&loop h 1 &token (%head_l) l
env env_%m%_%n% -sea %sptum% &token(%m% %head_l%) &token(%n% %hs_l%) &token(%n% %tp_l%) &token(%n% %gamma_l%) -sp_peak
&endloop
end_&data
Try the following,
&set head_l = 315 270 225 &set sptum = JONSWAP&set hs_l = 5.9 5.1 5.1 &set tp_l = 13.6 12.7 12.7&set sp_type = peak&set gamma_l = 1&loop n 1 3 1 &set hd_use = &token(%n %head_l) &set hs_use = &token(%n %hs_l) &set tp_use = &token(%n %tp_l) &data env env e_%(hd_use)_%(hs_use)_%(tp_use) \ -sea %sptum %hd_use %hs_use %tp_use %gamma_l -sp_type %sp_type end_&data&endloop
I only used the first three values. You can type in the rest.
I hope this helps.
Georgina Maldonado
Answer Verified By: Nasrul Hassan
Dear Georgina, Thank you.
Dear georgina, my question is how to loop multiple set of cog to be used with fr_point command. Given that i have listed the cog and wanted to ask moses to calculate all set of cog using &loop. Appreciate ur help. Thanks
Hi Nasrul,
You stated, "appreciate if you can correct this loop". There is no loop in the command set you posted. What loop is in need of a fix?
georgina
Sorry I missed that, the loop should look like this:
&set cog_n = 3 $assuming there’s 3 set of cog
&set cog_1 = 65 3.5 40.75
&set cog_2 = 63 3.5 40.75
&set cog_3 = 62 3.5 40.75
&loop n 1 3 1 $begin end_value increments
&set cog_%n% $loop cog 1,2,3
&set cargo_cg = %(cog_%(n))
fr_point %cargo_cg%
end
fr_fcargo
&fini
The below should work.
&loop n 1 3 1 fr_point %(cog_%(n)) report end&endloop
Georgina
Dear Georgina,
Thanks.