clear all | clear `establish loading condition read fv we 250 0 0 5 /gyr:gf,gf,gf so `specify wave environment wave (spe) p2 2.5 `Pierson-Moskowitz with 2.5ft sig. wave height `call seakeeping for range of headings and write RAOs to data file vari hint=30,hmax=180 report sea.pf /box:color sea /head:0,{hint},...,{hmax} /data:re report off `use SK.LIB to parse RAO data files and store RAOs from each case for plotting macro get_all_raos `%1 is case number, %2 is crt pt, %3 is mode, %4 is resp type vari (str) cn macro store_rao `%%91 is wave sample index vari RAO%3_%2_%4_%1_%%91={sk.RAO%3_%2_%4_%%91} // if %1<=9 then set cn="00%1" if %1>9 then if %1<=99 then set cn="0%1" if %1>99 then if %1<=999 then set cn="%1" .sk.getrespdata "SK{cn}-RESPONSE.DAT" .store_rao({sk.nwaves},1)1 vari heading_%1={sk.heading} clear (cn) vari / run sk.lib /call /quiet vari ncases set ncases={hmax} DIVIDE {hint} PLUS 1 .get_all_raos({ncases},1)1 CG 3 P `in the above: `the first parameter loops through all cases (all headings) `the second parameter is critical point "CG" `the third is mode (1=surge, 2=sway, 3=heave, 4=roll, 5=pitch, 6=yaw) `the fourth is response (P=Position, V=Velocity, A=Acceleration) `make custom plot macro plot_all_raos `%1 is wave index, %2 is crt pt, %3 is mode, %4 is resp type vari (str) ln macro add_point set ln="{ln} {RAO%3_%2_%4_%%91_%1}" // set ln="{sk.freq_%1}" .add_point({ncases},1)1 me "{ln} clear (ln) vari / macro plot_label `%1 is y-axis label vari (str) ln macro add_case set ln="{ln},""{heading_%%91}""" // set ln="""Wave Freq.(Rad/Sec)|%1""" .add_case({ncases},1)1 me plotlabel {ln} / report RAOPLOT.PF me plotstart "Heave Position RAO (CG)" .plot_label "Heave RAO (Ft/Ft)" .plot_all_raos({sk.nwaves},1)1 CG 3 P me plotend report close /preview