Location of Repository

Preliminary framework for the run-ahead predictive simulation software (RAPSS)

By 

Abstract

Graduation date: 2013The Run-Ahead Predictive Simulation Software (RAPSS) is an architecture designed for faster-than-real-time decision support for operators of complex networks. To enable further development of the RAPSS methodology, the necessary proof of principle is illustrated in two applications: decision support for shift technical advisors in nuclear power plant control rooms (RAPSS-STA), and in the event of a release outside of containment, decision support for emergency operation centers (RAPSS-EOC)

Topics: Nuclear Power, Software, Risk Analysis, Probabilistic Risk Assessment, Run-Ahead Predictive Simulation Software, RAPSS
Year: 2013
OAI identifier: oai:ir.library.oregonstate.edu:1957/38468
Provided by: ScholarsArchive@OSU

Suggested articles

Preview

Citations

  1. (0, " "));
  2. (OutDir + "/" + "initout.csv");
  3. (OutDir + "/" + greenOutFile);
  4. (realTime+simulationStartTime)); //updating info
  5. (true or false) for output cluster csv and pdf files
  6. (word!="\t\t")
  7. 0.0; //zeros new position
  8. 001 coreout valve"
  9. 001 coreout valve&quot; << endl;
  10. 0010300 trpvlv&quot;
  11. 0010301 499&quot;
  12. 002 hotplen valve&quot;
  13. 0020300 trpvlv&quot;
  14. 0020301 499&quot;
  15. 003 lclout valve&quot;
  16. 0030300 trpvlv&quot;
  17. 0030301 499&quot;
  18. 004 corein valve&quot;
  19. 0040300 trpvlv&quot;
  20. 0040301 499&quot;
  21. 009 PZRADSv valve&quot;
  22. 0090300 trpvlv&quot;
  23. 0090301 499&quot;
  24. 051 fwin tmdpjun&quot;
  25. 0510200 1 &quot;
  26. 0510201 0.0 &quot;<<
  27. 0510202 5.0+4 &quot;<<
  28. 053 msv valve&quot;
  29. 0530201 1 &quot;<< FVM602M << &quot; 0.0 0.0 &quot; << endl;
  30. 0530300 srvvlv &quot;
  31. 0530301 4 0&quot; << endl;
  32. 057 SGin valve&quot;
  33. 0570201 1 &quot;<< FVM602M << &quot; 0.0 0.0&quot; << endl;
  34. 0570300 trpvlv&quot;
  35. 0570301 498&quot;
  36. 0570301 499&quot;
  37. 058 SGout valve&quot;
  38. 0580201 1 &quot;<< FVM602M << &quot; 4.50-1 0.0&quot; << endl;
  39. 0580300 trpvlv&quot;
  40. 0580301 498&quot;
  41. 0580301 499&quot;
  42. 060 BPRin sngljun&quot;
  43. 0600201 1 0.0 &quot;<< FVM602M << &quot; 0.0&quot; << endl;
  44. 0Transient terminated by trip.&quot;;
  45. 1 is built into others because you add start into it
  46. 1 time &quot;).back()==0) {
  47. 1 time &quot;).size();
  48. 1 time &quot;)[h];
  49. 1 time &quot;)[i]-SearchVec(text, &quot;1 time &quot;)[i-1
  50. 1, axes = FALSE,
  51. 1: //
  52. 1) << &quot;
  53. 10 *State variables for thresholds (arbitrarily set for now for the MASLWR deck)
  54. 10: //
  55. 100 &quot;<< ProbType << &quot; &quot;
  56. 100 coreflow pipe&quot; <<endl;
  57. 1000 *FTAdir, directory where fta_input_file and run.sh are stored
  58. 1000 *timestep advancements from first &quot;seed&quot; run
  59. 1000 3E+6 9.0E+7 *FTA parameters - cut set order, unit time, terms, number of monte carlo simulations
  60. 1000101 8.422-3 6&quot; <<endl;
  61. 1000301 0.105 6&quot; <<endl;
  62. 1000501 0.0 6&quot; <<endl;
  63. 1000601 90.0 6&quot; <<endl;
  64. 1000701 0.105 6&quot; <<endl;
  65. 1001201 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  66. 1001202 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  67. 1001203 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  68. 1001204 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  69. 1001205 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  70. 1001206 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  71. 1001300 1&quot; <<endl;
  72. 103 &quot; << RstNbr << endl;
  73. 11: //
  74. 110 hotleg pipe&quot; <<endl;
  75. 1100101 3.051-2 5&quot; <<endl;
  76. 1100102 2.308-2 6&quot; <<endl;
  77. 1100103 1.565-2 7&quot; <<endl;
  78. 1100104 8.213-3 29&quot; <<endl;
  79. 1100201 0 28&quot; <<endl;
  80. 1100304 0.1111 5&quot; <<endl;
  81. 1100306 0.1223 7&quot; <<endl;
  82. 1100307 0.1020 14&quot; <<endl;
  83. 1100308 0.1019 15&quot; <<endl;
  84. 1100309 0.0540 16&quot; <<endl;
  85. 1100310 0.0384 17&quot; <<endl;
  86. 1100311 0.1011 18&quot; <<endl;
  87. 1100312 0.1052 26&quot; <<endl;
  88. 1100313 0.1050 27&quot; <<endl;
  89. 1100314 0.1011 28&quot; <<endl;
  90. 1100315 0.1433 29&quot; <<endl;
  91. 1100401 0 29&quot; <<endl;
  92. 1100501 0.0 29&quot; <<endl;
  93. 1100601 90.0 29&quot; <<endl;
  94. 1100804 2.0-6 0.1022 29&quot; <<endl;
  95. 1101001 0 29&quot; <<endl;
  96. 1101101 0 28&quot; <<endl;
  97. 1101201 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  98. 1101300 1&quot; <<endl;
  99. 111 29&quot; <<endl;
  100. 12:
  101. 13: //
  102. 14: //
  103. 15: //
  104. 180 A.2. CycleR5.h Source Code
  105. 180 pipe bend loss &quot;
  106. 2: //
  107. 2) << &quot;
  108. 201 coldleg pipe&quot; <<endl;
  109. 2010001 35&quot;
  110. 2010101 5.675-2 1&quot;
  111. 2010102 4.564-2 2&quot; << endl;
  112. 2010103 4.114-2 11&quot;
  113. 2010104 4.564-2 12&quot;
  114. 2010105 5.675-2 22&quot;
  115. 2010106 4.936-2 23&quot;
  116. 2010107 4.197-2 24&quot;
  117. 2010108 3.458-2 35&quot;
  118. 2010201 0 34&quot;
  119. 2010301 0.1433 1&quot;
  120. 2010302 0.1011 2&quot; << endl;
  121. 2010303 0.1050 3&quot; << endl;
  122. 2010304 0.1052 11&quot;
  123. 2010305 0.1011 12&quot;
  124. 2010306 0.0384 13&quot; << endl;
  125. 2010307 0.0540 14&quot;
  126. 2010308 0.1019 15&quot; << endl;
  127. 2010309 0.1020 22&quot;
  128. 2010310 0.1223 24&quot;
  129. 2010311 0.1111 25&quot;
  130. 2010312 0.1112 26&quot;
  131. 2010313 0.0762 28&quot;
  132. 2010314 0.0445 29&quot;
  133. 2010315 0.1050 35&quot;
  134. 2010401 0 35&quot;
  135. 2010501 0.0 35&quot;
  136. 2010601 -90.0 35&quot;
  137. 2010802 2.0-6 4.474-2 2&quot; << endl;
  138. 2010804 2.0-6 4.474-2 12&quot;
  139. 2010805 2.0-6 0.1778 22&quot;
  140. 2010806 2.0-6 0.1441 23&quot;
  141. 2010807 2.0-6 0.1148 24&quot;
  142. 2010808 2.0-6 8.89-2 35&quot;
  143. 2011001 0 35&quot;
  144. 2011101 0 34&quot;
  145. 2011201 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  146. 2011202 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  147. 2011203 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  148. 2011204 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  149. 2011205 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  150. 2011206 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  151. 2011207 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  152. 2011208 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  153. 2011209 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  154. 2011210 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  155. 2011211 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  156. 2011212 3 &quot; << R5SciConv(PT301) << &quot; &quot;
  157. 2011213 3 &quot;
  158. 2011300 1&quot;
  159. 202 lplenum branch&quot;
  160. 2020001 0 1&quot;
  161. 2020102 7.61-2 0&quot; << endl;
  162. 2020200 3 &quot;
  163. 203 &quot;
  164. 24 *timestep advancements for &quot;keep going&quot; restart files
  165. 255 A.4. OrganizeR5Output.h Source Code
  166. 260 A.5. initPCA.r Source Code
  167. 261 A.6. PCA.r Source Code:
  168. 270 A.7. unMSAPCA.r Source Code:
  169. 273 A.8. UpdateRwindex.r Source Code:
  170. 274 A.9. Display.r Source Code:
  171. 282 A.10. Cluster.h Source Code
  172. 292 A.12. RAPSS-STA Example Input File * ================================= * RAPSS-STA input file * Written by
  173. 3: //
  174. 300 luplenum branch&quot; <<endl;
  175. 3000102 0.292 0&quot; <<endl;
  176. 3000200 3 &quot;
  177. 301 pzr pipe&quot; <<endl;
  178. 3010001 8&quot; <<endl;
  179. 3010102 4.05-3 2&quot; <<endl;
  180. 3010103 6.70-2 8&quot; <<endl;
  181. 3010104 5.025-2 9&quot; <<endl;
  182. 3010303 0.0560 3&quot; <<endl;
  183. 3010304 0.1168 6&quot; <<endl;
  184. 3010305 0.0868 8&quot; <<endl;
  185. 3010306 0.1 9&quot; <<endl;
  186. 3010501 0.0 8&quot; <<endl;
  187. 3010601 90.0 8&quot; <<endl;
  188. 3010804 2.0-6 0.219 9&quot; <<endl;
  189. 3011105 0 5&quot; <<endl;
  190. 3011201 2 &quot; << R5SciConv(PT301) << &quot; &quot;
  191. 3011202 2 &quot; << R5SciConv(PT301) << &quot; &quot;
  192. 3011203 2 &quot; << R5SciConv(PT301) << &quot; &quot;
  193. 3011204 2 &quot; << R5SciConv(PT301) << &quot; &quot;
  194. 3011205 2 &quot; << R5SciConv(PT301) << &quot; &quot;
  195. 3011206 2 &quot; << R5SciConv(PT301) << &quot; &quot;
  196. 3011207 2 &quot; << R5SciConv(PT301) << &quot; &quot;
  197. 3011208 2 &quot; << R5SciConv(PT301) << &quot; &quot;
  198. 3011300 1&quot; <<endl;
  199. 302 PZRsteam branch&quot; <<endl;
  200. 3020001 0&quot; <<endl;
  201. 3020102 0.219 0&quot; <<endl;
  202. 3020200 2 &quot; << R5SciConv(PT301) << &quot; 1.0 &quot; <<endl;
  203. 335 C.2.
  204. 343 C.3. FunctionsEOC.h Souce Code
  205. 367 C.4. PlumeProgram.h Source Code
  206. 369 C.5.
  207. 371 C.6.
  208. 376 C.7. initR.r Source Code
  209. 377 C.8. updateRwindex.R Source Code
  210. 378 C.9. Sample RAPSS-EOC Input File * ================================= * RAPSS-EOC input file * Written by Kevin Makinson *
  211. 4) << &quot;
  212. 452 PCS108A valve&quot;
  213. 4520300 trpvlv &quot;
  214. 4520301 498&quot;
  215. 4520301 499&quot; << endl;
  216. 462 PCS108B valve&quot;
  217. 4620300 trpvlv &quot;
  218. 4620301 498&quot;
  219. 4620301 499&quot;
  220. 472 PCS106A valve&quot;
  221. 4720300 trpvlv &quot;
  222. 4720301 498&quot;
  223. 4720301 499&quot;
  224. 482 PCS106A valve&quot;
  225. 4820300 trpvlv &quot;
  226. 4820300 trpvlv &quot; << endl;
  227. 4820301 498&quot;
  228. 4820301 499&quot;
  229. 5: //
  230. 500 fwline pipe&quot;
  231. 500*redTableCols <<&quot;px;\&quot; border=\&quot;10\&quot; cellpadding=\&quot;2\&quot; cellspacing=\&quot;2\&quot;>&quot;<< endl;
  232. 500*yellowTableCols <<&quot;px;\&quot; border=\&quot;10\&quot; cellpadding=\&quot;2\&quot; cellspacing=\&quot;2\&quot;>&quot;
  233. 500+(index*2)+2, in other words, 501 and 502. This goes on until index is equal to the number of state variable trips divided by two (because there are two
  234. 500010000 *Raise flag if less than (lt) or greater than (gt) given threshold
  235. 5000101 6.94-5 2&quot; << endl;
  236. 5000201 0 1&quot;
  237. 5000301 0.25 2&quot; << endl;
  238. 5000401 0 2&quot; << endl;
  239. 5000501 0.0 2&quot; << endl;
  240. 5000601 90.0 2&quot; << endl;
  241. 5000701 0.25 2&quot; << endl;
  242. 5000801 2.0-6 0.0127 2&quot; << endl;
  243. 5001001 0 2&quot; << endl;
  244. 5001101 0 1&quot;
  245. 5001201 3 &quot;<< R5SciConv(PT511) << &quot; &quot;
  246. 5001300 1&quot;
  247. 501 2&quot;
  248. 501 fwline pipe&quot;
  249. 5010001 4&quot;
  250. 5010101 1.24-4 4&quot; << endl;
  251. 5010201 0 3&quot; << endl;
  252. 5010301 1.53 1&quot;
  253. 5010302 0.61 2&quot; << endl;
  254. 5010303 0.22 3&quot; << endl;
  255. 5010304 0.16 4&quot; << endl;
  256. 5010401 0 4&quot; << endl;
  257. 5010501 0.0 1&quot;
  258. 5010502 0.0 2&quot; << endl;
  259. 5010503 0.0 3&quot; << endl;
  260. 5010504 0.0 4&quot; << endl;
  261. 5010601 90.0 1&quot;
  262. 5010602 0.0 2&quot; << endl;
  263. 5010603 90.0 3&quot; << endl;
  264. 5010604 0.0 4&quot; << endl;
  265. 5010701 1.53 1&quot;
  266. 5010702 0.0 2&quot; << endl;
  267. 5010703 0.22 3&quot; << endl;
  268. 5010704 0.0 4&quot; << endl;
  269. 5010801 2.0-6 0.0127 4&quot; << endl;
  270. 5011001 0 4&quot; << endl;
  271. 5011101 0 3&quot; << endl;
  272. 5011201 3 &quot;<< R5SciConv(PT511) << &quot; &quot;
  273. 5011300 1&quot;
  274. 505 SGtube pipe&quot;
  275. 5050001 11&quot;
  276. 5050101 1.746-3 11&quot;
  277. 5050201 0 10&quot;
  278. 5050301 0.35 1&quot;
  279. 5050302 0.6048 10&quot;
  280. 5050303 0.35 11&quot;
  281. 5050401 0 11&quot; << endl;
  282. 5050501 0.0 11&quot;
  283. 5050601 90.0 11&quot;
  284. 5050701 0.06545 1&quot;
  285. 5050702 0.1131 10&quot;
  286. 5050703 0.06545 11&quot;
  287. 5050801 2.0-6 0.0126 11&quot;
  288. 5051001 0 11&quot;
  289. 5051101 0 10&quot;
  290. 5051201 3 &quot; << R5SciConv(PT511) << &quot; &quot;
  291. 5051202 3 &quot; << R5SciConv(PT511) << &quot; &quot;
  292. 5051203 3 &quot; << R5SciConv(PT511) << &quot; &quot;
  293. 5051204 3 &quot; << R5SciConv(PT511) << &quot; &quot;
  294. 5051205 3 &quot; << R5SciConv(PT511) << &quot; &quot;
  295. 5051206 3 &quot; << R5SciConv(PT511) << &quot; &quot;
  296. 5051207 3 &quot; << R5SciConv(PT511) << &quot; &quot;
  297. 5051208 3 &quot; << R5SciConv(PT511) << &quot; &quot;
  298. 5051209 3 &quot; << R5SciConv(PT511) << &quot; &quot;
  299. 5051210 3 &quot; << R5SciConv(PT511) << &quot; &quot;
  300. 5051211 3 &quot; << R5SciConv(PT511) << &quot; &quot;
  301. 5051300 1&quot;
  302. 507 MSteam pipe&quot;
  303. 5070001 8&quot;
  304. 5070101 9.64-4 8&quot;
  305. 5070201 0 7&quot; << endl;
  306. 5070301 0.2 1&quot;
  307. 5070302 0.35 2&quot; << endl;
  308. 5070303 0.34 3&quot; << endl;
  309. 5070304 0.10 4&quot; << endl;
  310. 5070305 0.26 8&quot;
  311. 5070401 0 8&quot;
  312. 5070501 0.0 3&quot; << endl;
  313. 5070502 0.0 4&quot; << endl;
  314. 5070503 0.0 8&quot;
  315. 5070601 0.0 3&quot; << endl;
  316. 5070602 90.0 4&quot; << endl;
  317. 5070603 0.0 8&quot;
  318. 5070701 0.0 3&quot; << endl;
  319. 5070702 0.1 4&quot; << endl;
  320. 5070703 0.0 8&quot;
  321. 5070801 2.0-6 3.5-2 8&quot;
  322. 5071001 0 8&quot;
  323. 5071101 0 7&quot; << endl;
  324. 5071201 3 &quot;<< R5SciConv(PT602) << &quot; &quot; << FVM602T <<&quot;
  325. 5071300 1&quot;
  326. 508 SGoutlet tmdpvol&quot;
  327. 5080102 0.0 0&quot; << endl;
  328. 5080200 2 &quot;
  329. 5080201 0.0 &quot;<<
  330. 510 feedw1 tmdpvol&quot;
  331. 5100102 0.0 0&quot; << endl;
  332. 5100200 3 &quot;
  333. 5100201 0.0 &quot;<<
  334. 5100202 376.0 &quot;<<
  335. 5100203 780.0 &quot;<<
  336. 5100204 1503.0 &quot;<<
  337. 54 is the max size of a section
  338. 6: //
  339. 6) << &quot;
  340. 60 * timestep advancements for looking ahead (runAheadTime) (hr)
  341. 600 501&quot; << endl;
  342. 600&quot; << &quot; &quot;
  343. 66666650&quot;, xpd =
  344. 7: //
  345. 7) << &quot;
  346. 751 HLLkVl valve&quot;
  347. 7510300 trpvlv&quot;
  348. 7510301 498&quot;
  349. 752 CLLkVl valve&quot;
  350. 7520300 trpvlv&quot;
  351. 7520301 498&quot;
  352. 754 ConCPLk valve&quot;
  353. 7540300 trpvlv&quot;
  354. 7540301 498&quot;
  355. 8) << &quot;
  356. 9: //
  357. 9/4/12 changed to just output 0s and 1s instead of th numbers
  358. 90 degree pipe bend loss&quot;
  359. A <- lapply(CL, function(xy){
  360. (1960). A New Approach to Linear Filtering and Prediction Problems.
  361. (2009). A Predictive Model of Nuclear Power Plant Crew Decision-Making and Performance in a Dynamic Simulation Environment (PhD Dissertation).
  362. (2001). A timely account of the role of duration in decision making.
  363. Access data and store it in a 2D array //
  364. added the break statement
  365. added these guys
  366. adder<-0 #this is for uneven splits in intervals.
  367. adding a final element that is the last element that is the size
  368. adding back the mean and standard deviation
  369. adding contour Lines if user wishes
  370. adding extra info about the trip from a txt file written by R
  371. Additional Wall Friction from pg 386 Todreas and Kazimi&quot; <<endl;
  372. ADS Vent Line Steam Space&quot; <<endl;
  373. alerts&quot;, rstNum, &quot;.pdf&quot;, sep=&quot;&quot;),onefile=TRUE
  374. and returns the restart number
  375. Appendix D: RAPPS-EOC Source Code Explanation Some sections are very similar to RAPSS-STA. The following explanations primarily pertain to the differences between RAPSS-STA and RAPSS-EOC. Please see Appendix B for explanations of functions used in
  376. Author:
  377. Author: Diego Mandelli
  378. Begin run? (y/n)&quot;
  379. below this is pasted data from above
  380. body></html>&quot;
  381. bool firstClustMember(int scenNum,
  382. br>&quot;
  383. br><ul style=\&quot;color: red;\&quot;>&quot;
  384. break; //breaks from j for loop.
  385. c(&quot;E&quot;, &quot;ENE&quot;, &quot;NE&quot;, &quot;NNE&quot;, &quot;N&quot;, &quot;NNW&quot;, &quot;NW&quot;, &quot;WNW&quot;)
  386. c(&quot;gt&quot;, &quot;lt&quot;, &quot;gt&quot;)
  387. c(&quot;httemp&quot;, &quot;p&quot;, &quot;p&quot;)
  388. c(&quot;W&quot;, &quot;WSW&quot;, &quot;SW&quot;, &quot;SSW&quot;, &quot;S&quot;, &quot;SSE&quot;, &quot;SE&quot;, &quot;ESE&quot;)
  389. Cannot open PCA file!\n&quot;;
  390. Card not read:&quot;
  391. cardno ctl fvel gvel zero&quot;
  392. cardno FROM TO area floss rloss ctl&quot; << endl;
  393. cardno name type&quot;
  394. cardno trip 498 is OPEN, 499 is CLOSED&quot;
  395. cardno valve&quot;
  396. Carlo data from mrp file
  397. case 101: //R5 Parameters:
  398. cat(&quot;An error has occured while determining the PCA linear approximation intervals&quot;)
  399. cat(&quot;An interval did not converge below given threshold! Check badInterval for details.\n&quot;)
  400. cd &quot; <<
  401. CDFwindDir[i]=1; //to correct for rounding errors
  402. CDFwindSpeedProb[j][i]=1; //to correct for rounding errors
  403. cerr <<&quot;No scenarios ended by trip, skipping plotting alerts ...&quot;
  404. change the string to a double
  405. change this one to be similar to the one above
  406. changing end point and start point going backwards
  407. changing to dynamic array
  408. check if it's gone as small as can be and isn't done yet.
  409. check if we've reached the beginning or end
  410. checks thresholds and pushes &quot;keep going&quot; threads on to a vector
  411. City Not In Danger</span></strong><br>&quot;
  412. clear the string &quot;word&quot;
  413. clustCenters&quot; << Windex << &quot;.csv&quot;; //adding index to the string
  414. clustCenters&quot;, rstNum, &quot;.csv&quot;,
  415. cluster::cluster(int dimensions, double center[], int pointID) {
  416. cluster(int dimensions, double center[], int pointID);
  417. clusterPlots&quot;, rstNum, &quot;.pdf&quot;, sep=&quot;&quot;),onefile=TRUE
  418. clustMemb&quot; << Windex << &quot;.csv&quot;; //adding index to the string
  419. clustMembers, vector<vector<string >
  420. clustMembers; //added KM 7/23 for storing the cluster membership.
  421. clustMembers) << &quot; Plots</a></li>&quot;
  422. clustMembers) << &quot;.pdf\&quot;>Cluster &quot;
  423. code takes the data, after performing PCA and MSA, and puts it back together again
  424. code takes the output from RAPS and performs PCA
  425. Cold Leg&quot; <<endl;
  426. comments section of input file
  427. complicated part goes here.
  428. Component 001 Flow Blockage Connection from Core to Hotleg&quot;);
  429. component 001 Flow Blockage&quot;
  430. component 001 ParitialFlowBlockage&quot;
  431. component 002 Flow Blockage&quot;
  432. component 002 ParitialFlowBlockage&quot;
  433. Component 003 Flow Blockage Lower cold leg outlet&quot;);
  434. component 003 Flow Blockage&quot; << endl;
  435. Component 003 ParitialFlowBlockage Lower Cold Leg Outlet CLOSED&quot;);
  436. component 004 Flow Blockage&quot;
  437. Component 004 ParitialFlowBlockage Core Inlet CLOSED&quot;);
  438. component 004 ParitialFlowBlockage&quot;
  439. component 009&quot;
  440. component 051&quot;
  441. component 053&quot;
  442. component 057 Secondary Loop Failure&quot;
  443. component 057&quot;
  444. component 058&quot;
  445. component 060&quot;
  446. component 100&quot; <<endl;
  447. Component 110 Hot Leg Leak Valve OPEN&quot;);
  448. component 110&quot; <<endl;
  449. Component 201 Cold Leg Leak Valve OPEN&quot;);
  450. component 201&quot; <<endl;
  451. component 202&quot;
  452. component 300&quot; <<endl;
  453. component 301&quot; <<endl;
  454. component 302&quot; <<endl;
  455. Component 452 disabled due to problems&quot;);
  456. Component 452 Sump Water Makeup CLOSED&quot;);
  457. component 452 Sump Water Makeup Fail&quot;
  458. component 452 SumpOpen&quot;
  459. Component 462 disabled due to problems&quot;);
  460. Component 462 Sump Water Makeup CLOSED&quot;);
  461. component 462 Sump Water Makeup Fail&quot;
  462. component 462 SumpOpen&quot;
  463. Component 472 Vent Valve disabled due to problems&quot;);
  464. component 472&quot;
  465. component 482&quot;
  466. component 500&quot;
  467. component 501&quot;
  468. component 505&quot;
  469. component 507&quot;
  470. component 508&quot;
  471. component 510&quot;
  472. Component 751 --- Component 110 (Hot Leg) Leak Valve&quot;
  473. Component 752 --- Component 201 (Cold Leg) Leak Valve&quot;
  474. Component 754 - Containment to Cooling Pool leak valve&quot;<<endl;
  475. Component 754 Containment to Cooling Pool Leak Valve OPEN&quot;);
  476. Connection from Core to Hotleg&quot;
  477. Connection from Hotleg to Upper Plenum&quot;
  478. Connection Pres & ADS Vent Line Steam Space&quot;
  479. const char *ChangeFont(int ColorCode)
  480. const char *ChangeFont(int ColorCode);
  481. const char *InitShOutput = &quot;InitRun.sh&quot;;
  482. const char *RstShOutput = &quot;rst.sh&quot;;
  483. contour<-F #this should come from the user
  484. Control structure for RAPS, gigantic while-loop
  485. converting lbm/s to kg/s
  486. Core including flow plates and regions 1-3&quot; <<endl;
  487. counter is the position of the state var
  488. counter=0; //reset counter for next loop
  489. counter=0; //reset counter for next loop Page:
  490. CountTime++; //breaks from while loop
  491. cout << &quot;ended by &quot;;
  492. cout << &quot;reaching steady state.&quot;
  493. cout << &quot;Reading: &quot; <<
  494. cout << endl << &quot;RELAP run on &quot; << nthreads << &quot; simultaneous threads&quot; << endl;
  495. cout << endl << &quot;The RAPS engine will now perform the restart run&quot; << endl;
  496. cout <<&quot;Spawning threads...&quot;
  497. cp &quot; << inDir << &quot;/Alert.gif &quot; << outDir << endl; //alerts
  498. cp &quot; << inDir << &quot;/tswtabs.css &quot; << outDir << endl; //buttons
  499. cp &quot; << OutDir << &quot;/&quot; << R5RstData << &quot; &quot;
  500. crdno A1
  501. crdno area jun&quot;
  502. crdno area jun&quot; << endl;
  503. crdno area jun&quot; <<endl;
  504. crdno area length volume h-ang v-ang delz rough &quot; << endl;
  505. crdno area length volume h-ang v-ang delz rough &quot; <<endl;
  506. crdno area vol &quot;
  507. crdno area vol &quot; <<endl;
  508. crdno area vol&quot;
  509. crdno area vol&quot; <<endl;
  510. crdno ctl &quot;
  511. crdno ctl &quot; <<endl;
  512. crdno ctl flowf flowg velj&quot;
  513. crdno ctl flowf flowg velj&quot; << endl;
  514. crdno ctl jun &quot;
  515. crdno ctl jun &quot; <<endl;
  516. crdno ctl jun&quot;
  517. crdno ctl mflowf mflowg velj&quot;
  518. crdno ctl p qual vol&quot; <<endl;
  519. crdno ctl p qual&quot; <<endl;
  520. crdno ctl p temp vol &quot;
  521. crdno ctl p temp vol &quot; <<endl;
  522. crdno ctl p temp vol&quot;
  523. crdno ctl p temp vol&quot; <<endl;
  524. crdno ctl p temp&quot; << endl;
  525. crdno ctl p temp&quot; <<endl;
  526. crdno ctl vol &quot;
  527. crdno ctl vol &quot; << endl;
  528. crdno ctl vol &quot; <<endl;
  529. crdno ctl vol&quot;
  530. crdno ctlno table no&quot;
  531. crdno delz vol &quot;
  532. crdno delz vol &quot; <<endl;
  533. crdno delz vol&quot;
  534. crdno dhy ctl&quot;
  535. crdno dhy ctl&quot; <<endl;
  536. crdno floss rloss jun&quot;
  537. crdno floss rloss jun&quot; <<endl;
  538. crdno flowf flowg velj jun&quot;
  539. crdno flowf flowg velj jun&quot; <<endl;
  540. crdno from to area &quot;
  541. crdno from to area floss rloss ctl&quot; << endl;
  542. crdno from to area floss rloss ctl&quot; <<endl;
  543. crdno h-ang vol &quot;
  544. crdno h-ang vol &quot; <<endl;
  545. crdno h-ang vol&quot;
  546. crdno length vol &quot;
  547. crdno length vol &quot; <<endl;
  548. crdno length vol&quot;
  549. crdno mflowf mflowg velj jun&quot;
  550. crdno mflowf mflowg velj jun&quot; <<endl;
  551. crdno mflowf mflowg velj&quot; <<endl;
  552. crdno name type&quot;
  553. crdno name type&quot; <<endl;
  554. crdno nj &quot; <<endl;
  555. crdno nj ctl&quot;
  556. crdno nj ctl&quot; <<endl;
  557. crdno nv &quot;
  558. crdno nv &quot; <<endl;
  559. crdno rough dhy vol&quot;
  560. crdno rough dhy vol&quot; <<endl;
  561. crdno time flowf flowv velj time flowf flowv velj&quot; << endl;
  562. crdno time p qual time p qual&quot; << endl;
  563. crdno time pres temp time pres temp&quot; << endl;
  564. crdno trip --- 498 is OPEN, 499 is CLOSED&quot;
  565. crdno trpno 401 is Normal Ops, 499 is blocked &quot; << endl;
  566. crdno trpno 402 is Normal Ops, 499 is blocked&quot;
  567. crdno trpno 403 is Normal Ops, 499 is blocked, 498 is open&quot;
  568. crdno trpno 404 is Normal Ops, 499 is blocked, 498 is open&quot;
  569. crdno type &quot;
  570. crdno type&quot;
  571. crdno v-ang vol &quot;
  572. crdno v-ang vol &quot; <<endl;
  573. crdno v-ang vol&quot;
  574. crdno valve&quot;
  575. crdno volume vol &quot;
  576. crdno volume vol &quot; <<endl;
  577. crdno volume vol&quot;
  578. (2010). Created on:
  579. creating a CDF for windDirection
  580. Creating estimate of current state for the next wind direction...&quot;
  581. Creating estimate of current state...&quot;
  582. csv\&quot;>Cluster Data</a></li>&quot;
  583. csv\&quot;>Scenario &quot; << clustMembers[j][i] << &quot;</a></li>&quot;
  584. csv&quot;, sep = &quot;&quot;
  585. currentTime<-&quot;
  586. cutSetProbs<- c(\&quot;&quot;;
  587. Cycle &quot; << cycleCounter << &quot;---------------&quot;
  588. Cycle complete!&quot;
  589. data/futureState.csv&quot;, sep = &quot;&quot;
  590. data/outputs/rst&quot;, rstNum, &quot;.csv&quot;, sep = &quot;&quot;
  591. data1.pop_back(); //Deletes the last row int the matrix; this is because the last
  592. dataOut<-&quot;
  593. dataVec; //added KM 7/18/12 for determining the size of the data
  594. (1993). Decisions with Multiple Objectives.
  595. define a color pallette,
  596. delcol will never be zero because it will always have time in it.
  597. deleting 7th character and adding &quot; &quot; to account for R5's funkiness
  598. deleting the memory created at run-time
  599. Determine the p-norm of an NDim-dimensional vector x
  600. determining average wind speed for a given direction
  601. dim 1 is the time steps, dim 2 is the state variables
  602. dim1 is replaced with how many timesteps are being analyzed (to break into equal intervals)
  603. dim2, thNum)) #occationally there's an NA at the end
  604. dimensionality does not change;
  605. Directory where the R5 input and water files are stored (IDir)
  606. disabled due problems&quot;
  607. disabled due to problems&quot;
  608. Display Engine For RAPSS-EOC - Written by Kevin Makinson-->&quot;
  609. Display Engine For RAPSS-STA - Written by Kevin Makinson-->&quot;
  610. Display Engine For RAPSS-STA - Written by Kevin Makinson-->&quot; << endl;
  611. DISPLAY&quot; << RstNum << &quot;.html&quot;; //adding index to the string
  612. div>&quot;
  613. Don't forget to convert to Kelvin for everything,
  614. don't install if already installed
  615. dos2unix &quot; << FTAdir << &quot;/&quot; << FTAfileName << &quot;/&quot;
  616. double *diff; //changing to dynamic array
  617. double *sampleWind(string windDataFile, int th_id) {
  618. double *sampleWind(string windDataFile, int th_id);
  619. double distanceFromMinimum = (h/3); //modified by KM Page:
  620. double Linterpolate(double A1, double A2, double B1, double B2, double B3) {
  621. double LpNorm(double p, double x[], int NDim) { //changed this KM
  622. double LpNorm(double p, double x[], int NDim);
  623. double m_x=0; // initialize m_x: new position - old position
  624. double p1; //threshold variables
  625. double PCAthreshold; //for PCA - how much variance do you want to capture?
  626. double qualConverter(double LDP301, int vol) {
  627. double sigYFinder(int stabClass, double hE, double x) {
  628. double sigYFinder(int stabClass, double hE, double x);
  629. double sigZFinder(int stabClass, double hE, double x) {
  630. double sigZFinder(int stabClass, double hE, double x);
  631. double T1Step, string FTAdir, string FTAfileName, int numOfCutSets,
  632. double velgj; //threshold variables
  633. double voidg; //threshold variables
  634. downloading and installing R libraries from the internet...&quot; << endl;
  635. draw circles Page:
  636. dt (in seconds) (adjust if running into memory issues for long times)
  637. dt); //runs the plume program
  638. else if ((word == &quot;Final time=&quot;) || (word==&quot;---Restart Su&quot;)
  639. else if ((word == &quot;RELAP5/3.3g&quot;) || (word==&quot;steady state&quot;)
  640. else if (fin.good()) {break;} //added because the &quot;while&quot; statement doesn't work
  641. else if (Windex==2) { //if it's the second time through (first restart)
  642. else if (word == &quot;RELAP5/3.2&quot; ) { //change with different versions of RELAP
  643. end card (don't comment out on accident!)
  644. end of allotted time.&quot;
  645. end of data&quot;
  646. end of thesholds section
  647. End time for one cycle: &quot;
  648. End time: &quot;
  649. EndBySumVec; //summary of how the scenarios terminated
  650. EndBySumVec[1][i]=0; //don't do clustering on this element
  651. EndByVec.push_back(R5EndBy(OutDir + &quot;/&quot;
  652. endl << &quot;setting cutsets to maximum value&quot;
  653. endl << &quot;Setting number of threads to &quot; <<
  654. endl << &quot;Skipping scenario clustering...&quot;
  655. endl;
  656. (2003). Ensemble Kalman Filters Bring Weather Models Up to Date. Society for Industrial and Applied
  657. Entirety of the Hot Leg&quot; <<endl;
  658. equivalence <- c(\&quot;&quot;;
  659. errors!&quot;
  660. eventVec.clear(); //clears event vec
  661. exit 0&quot;
  662. Extracting and organizing data; performing PCA...&quot;
  663. Feedwater line before FRV&quot;
  664. Feedwater Pump Cheat &quot;
  665. Feedwater Regulating Valve&quot;
  666. Feedwater Supply&quot;
  667. fell bleow the&quot;,
  668. File does not exist!&quot;
  669. flip it around so it's compatible with later stuff
  670. Flow Blockage Connection from Hotleg to Upper Plenum&quot;);
  671. Flow Blockage Connection Plenum into the Core CLOSED&quot;);
  672. for (i in 1:thNum) {
  673. for (int i=(maxSquares*-1); i<maxSquares;
  674. for (int i=0; i<(gridSize2); i+=1) {
  675. for (int i=0; i<(transient.size()-2); i++) {
  676. for (int i=0; i<5; i++) { //col nums
  677. for (int i=0; i<card; i++) { // find all the point in the sphere with radius=bandwith/2
  678. for (int i=0; i<dim; i++) {
  679. for (int i=0; i<dimensionality; i++)
  680. for (int i=0; i<dimensionality; i++) {
  681. for (int i=0; i<dimensions; i++)
  682. for (int i=0; i<dimensions; i++) {
  683. for (int i=0; i<directions; i++) {
  684. for (int i=0; i<EndBySumVec[2].size(); i++) {
  685. for (int i=0; i<flagVec[1].size(); i++) {
  686. for (int i=0; i<flagVec[2].size(); i++) {
  687. for (int i=0; i<grid[0].size(); i++) {
  688. for (int i=0; i<keepGoing.size(); i++) {
  689. for (int i=0; i<Length; i++) {
  690. for (int i=0; i<NDim; i++) {
  691. for (int i=0; i<nthreads; i++) {
  692. for (int i=0; i<requestTh; i++) {
  693. for (int i=0; i<size; i++) {
  694. for (int i=0; i<sysData[0].size(); i++) {
  695. for (int i=0; i<sysData[j].size(); i++) {
  696. for (int i=0; i<text.size(); i++) {
  697. for (int i=0; i<text[j].length(); i++) { //character nums
  698. for (int i=0; i<text[j].size(); i++) {
  699. for (int i=1; i<=directions; i++) { //start at 1 instead of 0 bc of &quot;Total(%)&quot;
  700. for (int i=data1Sections[k]+HeaderLength; i<data1Sections[k+1]; i++) {
  701. for (int i=KeyStringSize; i<(KeyStringSize+10); i++) {
  702. for (int j=(i+1); j<text[0].size(); j++) {
  703. for (int j=(maxSquares*-1); j<maxSquares;
  704. for (int j=(startTimeStep-1); j<timestep;
  705. for (int j=0; j<(gridSize2); j++) {
  706. for (int j=0; j<bins;
  707. for (int j=0; j<clustMembers.size();
  708. for (int j=0; j<dim;
  709. for (int j=0; j<dim; ++j)
  710. for (int j=0; j<dim; j++)
  711. for (int j=0; j<dim; j++){
  712. for (int j=0; j<grid.size();
  713. for (int j=0; j<positions.size();
  714. for (int j=0; j<text.size();
  715. for (int j=0; j<Width; j++) {
  716. for (int j=4; j<windObsData.size(); j++) { //line nums
  717. for (int j=jIndex; j<FormatDataWidth;
  718. for (int j=startLine; j<endLine; j++) { //line nums
  719. for (int k=0; k<clustMembers[j].size();
  720. for (int k=0; k<FormatData[0].size(); k++) {
  721. for (int k=38; k<73; k++) {
  722. for (int k=39; k<52; k++) {
  723. for (int k=7; k<=stateVarTripNames.size();
  724. for (int n=0; n<stateVarCodes.size();
  725. for (int t=1; t<=(timeInterval/dt);
  726. for (j in 1:thNum) {
  727. for (unsigned int h=0; h<SearchVec(text, &quot;1 time &quot;).size(); h++) {
  728. for (unsigned int i=0; i<(inputVec.size()); i++) {
  729. for (unsigned int i=0; i<clusterSet.size(); i++) {
  730. for (unsigned int i=0; i<clustMembers[j].size(); i++) {
  731. for (unsigned int i=0; i<clustMembers[j].size(); i++) { //i is scenario number
  732. for (unsigned int i=0; i<cutSetVec.size(); i++) {
  733. for (unsigned int i=0; i<data1.size()-1; i++) {
  734. for (unsigned int i=0; i<EndBySumVec[0].size(); i++) {
  735. for (unsigned int i=0; i<EndBySumVec[1].size(); i++) {
  736. for (unsigned int i=0; i<EndBySumVec[2].size(); i++) {
  737. for (unsigned int i=0; i<EndBySumVec[j].size(); i++) {
  738. for (unsigned int i=0; i<flagVec[0].size(); i++) {
  739. for (unsigned int i=0; i<flagVec[1].size(); i++) {
  740. for (unsigned int i=0; i<flagVec[2].size(); i++) {
  741. for (unsigned int i=0; i<keepGoing.size(); i++) {
  742. for (unsigned int i=0; i<prevKeepGoing.size(); i++) {
  743. for (unsigned int i=0; i<stateVarCodes.size(); i++) {
  744. for (unsigned int i=0; i<stateVarCodes2.size(); i++) {
  745. for (unsigned int i=0; i<stateVarEquiv.size(); i++) {
  746. for (unsigned int i=0; i<stateVarTripNames.size(); i++) {
  747. for (unsigned int i=0; i<ThTransientTranslator.size(); i++) {
  748. for (unsigned int i=0; i<Vbreak.size(); i++) {
  749. for (unsigned int i=1; i<SearchVec(text, &quot;1 time &quot;).size(); i++) {
  750. for (unsigned int i=1; i<yellowTripThresh.size(); i++) {
  751. for (unsigned int i=StrtIndx+(j*13); i<(StrtIndx+(j+1)*13); i++) {
  752. for (unsigned int j=0; j<ClusterSet.size();
  753. for (unsigned int j=0; j<clustMembers.size();
  754. for (unsigned int j=0; j<clustMembers.size(); j++) { //j is cluster number
  755. for (unsigned int j=0; j<EndBySumVec.size()-1; j++) {
  756. for (unsigned int j=0; j<text[k].length()/13; j++) {
  757. for (unsigned int j=4; j<(FormatData.size());
  758. for (unsigned int k=0; k<data1Sections.size()-1; k++) {
  759. for (unsigned int k=0; k<transientExplanation[i].size(); k++) {
  760. for cartesian coordinates (puff)
  761. for data with more than
  762. for MSA - How big do you want your clusters?
  763. For temperature, set volume 1 to TF-121, TF-122, TF-123, and TF-124&quot; <<endl;
  764. For volumes 2-5, just do a straight linear average from volume 1 to 6&quot; <<endl;
  765. for(int i = 0; i < cardinality; i++) { //Perform MSM for each data point
  766. for(int i = 0; i < cardinality; i++) { //reveresed card and dim
  767. for(int j = 0; j < cardinality;
  768. FormatData; //this is the data in string format
  769. forward<-FALSE #This tells if the data intervals have reached the beginning
  770. fout <<&quot;</span></strong><br>&quot; << endl;
  771. fout.open(greenOutFilePath.c_str()); //double check this does what I want it to.
  772. FTAfileName + &quot;/&quot; +FTAfileName+&quot;.fta&quot;);
  773. FTAfileName + &quot;/&quot; +FTAfileName+&quot;.mrp&quot;);
  774. FTAfileName + &quot;/&quot; +FTAfileName+&quot;.prp&quot;);
  775. FTAfileName <<&quot;.fta&quot;
  776. FTAfileName <<&quot;.ped&quot;
  777. function for reading input file
  778. gets probability info from prp file
  779. getting units right and varying initial conditions
  780. goes through individual words
  781. going forward after backwards initially
  782. grabs the data from the R5 output file and organizes it exactly how it is organized
  783. gridResolution<- &quot; << gridResolution << endl;
  784. gt lt gt *Yellow trip for &quot;keep going&quot;
  785. h is the number of tables to be grabbed from R5
  786. Here's what &quot;runs&quot; the program
  787. Hour&quot;).back()==0) {
  788. How many cycles would you like to run?
  789. How many cycles would you like to run? &quot;
  790. html\&quot;>Miscellaneous Information</a></li>&quot;
  791. html\&quot;>Model Became Unstable</a></li>&quot;
  792. html\&quot;>No Thresholds Tripped</a></li>&quot;
  793. html\&quot;>R5 Model Became Unstable</a></li>&quot;
  794. html><head>&quot;
  795. html><head>&quot; << endl;
  796. httemp p p *R5 model state variable codes
  797. http-equiv=\&quot;content-type\&quot;><title>RAPSS-EOC Display
  798. i is the character number line k (overloaded subscript index)
  799. i=6; //resets to the beginning of the cutsets line
  800. if (((norm(((covMatrix2)-(covMatrix1))/(delTReg), type=&quot;m&quot;
  801. if ((AMPMplumeStartTime==&quot;PM&quot;) &&
  802. if ((AMPMsimulationStartTime==&quot;PM&quot;) &&
  803. if ((answer == &quot;n&quot;)
  804. if ((answer == &quot;n&quot;) || (answer == &quot;no&quot;)
  805. if ((flagVec[2][i]==1) && (firstClustMember(i, clustMembers))) {
  806. if ((stateVarEquiv[n]==&quot;gt&quot;) &&
  807. if ((stateVarEquiv[n]==&quot;lt&quot;) &&
  808. if ((text[j][i] == ' ') ||
  809. if ((textM[keyLoc+keyLocAdder][i-4] != ' '
  810. if ((textP[keyLoc+keyLocAdder][i-4] != ' '
  811. if ((word!=&quot; \t&quot;) && (word!=&quot; \t\t&quot;) && (word!=&quot; \t\t\t&quot;)
  812. if ((word!=&quot; &quot;) && (word!=&quot; &quot;) && (word!=&quot; &quot;) && (word!=&quot; &quot;)
  813. if (dataOut==1) {
  814. if (EndBySumVec[0][i]==0) { //if it did not end by errors, then organize.
  815. if (equivalence[j]==&quot;gt&quot;) {
  816. if (j==2) {
  817. if (multiLine==false) { // this statement is only for single lines
  818. if (prevKeepGoing[th_id]==0) { //if keep going is true, don't start a new transient
  819. if (prevKeepGoing[th_id]==1) { //continue's from spot left off
  820. if (sysData[0][loopCount]==(&quot;\&quot;IO_PT602\&quot;&quot;)) {
  821. if (text.back()==fail) { //can't use a switch statement for strings
  822. if (textM[keyLoc+keyLocAdder+1][2] != ' ') {
  823. if (textP[keyLoc+keyLocAdder+1][2] != ' ') {
  824. if (th_id>=(requestTh/2)) { //only second half of threads are used for transients
  825. if (windDir==&quot;E&quot;) {
  826. if (windDir==&quot;ENE&quot;) {
  827. if (windDir==&quot;ESE&quot;) {
  828. if (windDir==&quot;N&quot;) {
  829. if (windDir==&quot;NE&quot;) {
  830. if (windDir==&quot;NNE&quot;) {
  831. if (windDir==&quot;NNW&quot;) {
  832. if (windDir==&quot;NW&quot;) {
  833. if (windDir==&quot;S&quot;) {
  834. if (windDir==&quot;SE&quot;) {
  835. if (windDir==&quot;SSE&quot;) {
  836. if (windDir==&quot;SSW&quot;) {
  837. if (windDir==&quot;SW&quot;) {
  838. if (windDir==&quot;WNW&quot;) {
  839. if (windDir==&quot;WSW&quot;) {
  840. if (windDirProb[i]!=0) { //to avoid dividing by zero
  841. if (Windex==1) { //if first time through, go through next loop normally
  842. if (Windex==2) { //copying files over
  843. if (Windex>=3) { // if something is flagged, don't cluster it
  844. if (Xrot<=0) { //Stuff behind the plume, just put in 0.0001
  845. if already been through, load the grid, and then procede
  846. if it's already done, don't do it
  847. if not at the end, and the covs look good, and we're going forward advance forward
  848. if string is all whitespace
  849. if the data has less than 54 data points
  850. if the program doesn't recognize the response, tell the use to enter a y or n
  851. if the program doesn't recognize, continue to tell the use to enter a y or n
  852. if there are three (or an odd number of) outputs, one of the 501-599 cards is repeated by RAPSS-STA on the last 601-699 card (602 in the lines below):
  853. if time is different than when the last cycle past
  854. if we're not done and below threshold look at next interval
  855. if(get(PrevKeepGoingRsti)[i,1]==(&quot; &quot;)) {
  856. if(get(TripOutRawDatai)[i,1]==(&quot; &quot;)) {
  857. if(IncludeTh[translator[i]]==1) { //if it is not flagged as &quot;keep going&quot;
  858. if(InitOutRawData[i,1]==(&quot; &quot;)) {
  859. if(n==1) { #the next steps won't work with one principal component
  860. if(R5OutRawDataC[i,1,1]==(&quot; &quot;)) {
  861. if(string::npos != startpos)
  862. ifstream fin((OutDir + &quot;/&quot;
  863. ifstream ifile((FTAdir +&quot;/&quot; + FTAfileName + &quot;/&quot; + FTAfileName + &quot;.prp&quot;).c_str());
  864. img style=\&quot;width: 164px; height: 41px;\&quot; alt=\&quot;\&quot; src=\&quot;Alert.gif\&quot;>&quot;;
  865. img style=\&quot;width: 164px; height: 41px;\&quot; alt=\&quot;\&quot; src=\&quot;Alert.gif\&quot;><br>&quot;;
  866. In the MeanShiftOperator() function, OldPosition[dim] and diff[dim] were changed to dynamic arrays because dim (dimensionality) was now determined at run time (lines 160, 167), and deleted later to avoid dangling memory (lines 195-
  867. in the R5 output, which is not always desirable
  868. include //for appending strings
  869. include //for removing shell files.
  870. include //for system calls
  871. index++; //this is the cluster number
  872. Initialize the set of clusters (ClusterSet.size() gives size of vector
  873. initializing RAPSS;&quot;
  874. initout.csv&quot;,
  875. (2011). Innovative Systems Software (ISS) Website.
  876. Input error! Number of requested cutsets greater than size of cutsets&quot;
  877. Input file: &quot; <<
  878. INPUT LOSS COEFFICIENTS FOR PIPE BENDS&quot;
  879. inputting data into a vector
  880. install.packages(\&quot;abind\&quot;, repos=Rrepos, lib=libloc)&quot;
  881. install.packages(\&quot;corpcor\&quot;, repos=Rrepos, lib=libloc)&quot;
  882. install.packages(\&quot;MASS\&quot;, repos=Rrepos, lib=libloc)&quot;
  883. int card, int dim);
  884. int cardinality = dataVec.size();
  885. int count; //counts how many lines the multline algorithm uses
  886. int CountTime=0; //how many times &quot;time&quot; appears.
  887. int CtlMode,
  888. int CtlMode, int MinEdit, int MajEdit, int RstFreq, string R5ExePath,
  889. int cycleCounter=1; Page:
  890. int dim, double h);
  891. int dimensionality = dataVec[0].size(); // Number of dimensions for each scenario
  892. int EndByTimeStepCounter,
  893. int gridResolution, int maxY,
  894. int index=0; //added KM for clusterMembers, rename later.
  895. int R5EndBy(string FileName)
  896. int requestTh, int BW, string inDir, string outDir, string windDataFile,
  897. int runAheadTime, int plumeStartTime, int simulationStartTime, int dt, int realTimeSpeedUp,
  898. int scenClustTranslator(int scenNum,
  899. int stabClass, int maxY, int gridResolution, int timeInterval, int dt) {
  900. int startTimeStep, int timestep, string outDir) {
  901. int yellowTableCols=0; Page:
  902. int1Direction<-TRUE #checks to see which direction we initially go
  903. interval 1 stays the same,
  904. interval2Real<- as.integer(dim1/2) #took out -adder on this statement
  905. Invalid thread number request. Setting number of threads to 2.&quot;
  906. Invalid thread number request. Setting number of threads to 2.&quot; << endl;
  907. IODir<-\&quot;&quot; << OutDir <<&quot;\&quot;&quot; << endl << &quot;libloc<-\&quot;&quot; << libloc <<&quot;\&quot;&quot;
  908. it searches for cols that have difference in sd compared to the mean of 0.00001
  909. it's a new section
  910. j is the the col of the new matrix being created
  911. j-1, &quot;\n Run-Ahead &quot;, runAheadTime, &quot; hr from: &quot;,
  912. Junction 3 is used to simulate the extra losses at the grid wires&quot; <<endl;
  913. Junction with SG inlet&quot;
  914. Junction with SG Outlet to Main Steam Line&quot;
  915. k[h] is the line(row) number in the string in the R5 output file
  916. k++; //k is part of the &quot;while loop&quot;
  917. k<-0 #leave this k here, important
  918. keepGoing.push_back(0); //if nothing needs to be flagged,
  919. keepGoing[i]=0; //remove the keep going flag
  920. keepGoingEndTime[i]=EndTime; //resets keepGoingEndTime for flagged
  921. (2008). Key attributes of the SAPHIRE risk and reliability analysis software for risk-informed probabilistic applications. Reliability Engineering
  922. l -1.0&quot;
  923. l&quot;
  924. labels=&quot;=> current cycle&quot;,
  925. labels=&quot;previous restart <=&quot;,
  926. Last compiled on &quot; << __DATE__ << &quot; at &quot;
  927. Last compiled on &quot; << __DATE__ << &quot; at &quot; << __TIME__
  928. last whole number after division by 13
  929. Leave quality at 1.0&quot;
  930. Less than two scenarios completed time histories without flags.&quot;
  931. li> Everything's in danger! Run away!
  932. li> No model instabilities on this cycle << endl;
  933. li> No red trips << endl;
  934. li> No yellow thresholds exceeded << endl;
  935. li> No yellow trips << endl;
  936. li>&quot;
  937. li></li></ul></ul>&quot;
  938. li></li></ul></ul><p>&quot;
  939. li><a href=\&quot;alerts&quot; << RstNum <<&quot;.pdf\&quot;>Secnario &quot;
  940. li><a href=\&quot;clusterPlots&quot;
  941. li><a href=\&quot;green&quot;
  942. li><a href=\&quot;misc&quot;
  943. li><a href=\&quot;plumeRst&quot; << RstNum <<&quot;Cl&quot;
  944. li><a href=\&quot;Th_&quot;
  945. li><a href=\&quot;Th_&quot; << i << &quot;_data/outputs/rst&quot; << RstNum << &quot;.p\&quot;>Scenario &quot;
  946. li><a href=\&quot;Th_&quot; << i <<&quot;_data/outputs/rst&quot;
  947. li><a href=\&quot;unMSAPCAc&quot;
  948. li><a href=\&quot;unstable&quot;
  949. li>Cluster &quot; << j+1 << &quot; Plot Members</li>&quot;
  950. li>Cluster Members << endl;
  951. li>Other information</li>&quot; << endl;//transient information goes here
  952. li>Scenario &quot; <<
  953. li>Scenario &quot; << i << &quot;</li>&quot;
  954. li>Secnario &quot; << i << &quot;</li>&quot;
  955. (2009). Licensing of Production and Utilization Facilities.
  956. Linear Interpolation for the others&quot; << endl;
  957. link rel=\&quot;stylesheet\&quot; type=\&quot;text/css\&quot; href=\&quot;tswtabs.css\&quot;>&quot;
  958. listing of the fuctions
  959. load currentState(Windex-1).csv and put it into grid
  960. load(\&quot;R_data/RAPSspace.RData\&quot;)&quot;
  961. Loading the file into a vector called &quot;text&quot;
  962. loading the file into a vector of strings: &quot;text&quot;
  963. Logic: if the same index of the next section isn't the same time
  964. Lower cold leg outlet&quot;
  965. Lower Plenum &quot;
  966. m/s&quot;
  967. Main Steam Line from Steam Drum to Vortex Meter Inlet&quot;
  968. Main Steam Outlet to Back Pressure Regulator&quot;
  969. makes a directory based on the thread ID, and returns a string of directory name
  970. making syntax more readable
  971. mapping x and y to rotated axes
  972. maslwr *Number of cutsets to grab from OpenFTA.
  973. maxY<- &quot;
  974. MCvec.end()); //puts high probability events on top.
  975. MeanShift analysis... &quot;
  976. meanShiftReady&quot;, rstNum, &quot;.csv&quot;,
  977. meta content=\&quot;text/html;
  978. meta content=\&quot;text/html; charset=ISO-8859-1\&quot; http-equiv=\&quot;content-type\&quot;>&quot;;
  979. misc&quot; << RstNum << &quot;.html&quot;; //adding index to the string
  980. mkdir &quot;
  981. mkdir &quot; + outDir + &quot;/&quot; + NameDir(th_id)); //making directories
  982. Model Became Unstable</span></strong><br>&quot;
  983. MSA indexes and thread indexes
  984. Multiply PT-301 by 6894.757 to get the right units&quot; <<endl;
  985. n is the number of principal components
  986. n Probability = &quot;,
  987. n*\n*&quot; << string(70, '=')
  988. n#\n#&quot; << string(70, '-') << endl; //end comments
  989. Name of windrose data file from: http://www.raws.dri.edu/index.html
  990. nat: &quot;, currentTime, &quot;:00&quot;, sep=&quot;&quot;)
  991. need to use an extra string &quot;word&quot; b/c no push_back += function
  992. Next run index is &quot; << Windex << &quot; Continue run? (y/n)&quot; << endl;
  993. Next run index is &quot; << Windex << &quot;. Continue run? (y/n)&quot; << endl;
  994. Next section is defining initial conditions from MASLWR data
  995. nfs/stak/students/m/makinske/cpp/FTA *FTA folder/file nanme, name of model without any file type appended
  996. No minor edit data to be read on thread &quot; << th_id << &quot;!&quot;
  997. No transients run&quot;
  998. No valid wind data. Please see http://www.raws.dri.edu/index.html for data&quot;
  999. No valid wind observation data.&quot;;
  1000. No&quot;
  1001. now importing from MSA
  1002. now loading the tripped runs:
  1003. now reading the file just written
  1004. now to put in the first and last values
  1005. Now we organize the data.
  1006. nthreads; //thread identifier
  1007. (2011). Nuclear Power in an Age of Uncertainty. Chapter 8: Public Attitudes Toward Nuclear Power. OpenFTA Website.
  1008. Number of threads greater than maximum allowable by the system.&quot;
  1009. Number of threads requested greater than maximum allowable by the system.&quot;
  1010. o &quot; << OutDir << &quot;/&quot; << ThDir << &quot;/outputs/&quot; << R5RstOutput << &quot; -r &quot;
  1011. ofstream f2out((OutDir + &quot;/&quot;
  1012. ofstream fout((outDir + &quot;/&quot;
  1013. OldPosition[i]=point[i]; //point is the data
  1014. oldRealTime=realTime-1; //just make it different than real time for the first time
  1015. omp_set_dynamic(0); // turn off dynamic teams
  1016. only go into this loop when you're out of cycles
  1017. Organizing Grid... &quot;
  1018. outDir = (inDir + &quot;/RAPSS_data&quot;); //Assigning Output Directory inside the input directory
  1019. output cluster centers and membership
  1020. Output file: &quot; <<
  1021. output to a csv file
  1022. Outputting display...&quot; << endl;
  1023. Outputting only wind direction, speed, and time
  1024. outputting the file PC.csv for MSA
  1025. p><br>&quot;
  1026. p><span style=\&quot;text-decoration: underline;\&quot;>&quot;;
  1027. p><span style=\&quot;text-decoration: underline;\&quot;>R5 Model Became Unstable&quot;;
  1028. ParitialFlowBlockage Connection from Core to Hotleg CLOSED&quot;);
  1029. ParitialFlowBlockage Connection Hotleg to Upper Plenum CLOSED&quot;);
  1030. PC&quot; << Windex << &quot;.csv&quot;; //adding index to the string
  1031. PC&quot;, rstNum, &quot;.csv&quot;,
  1032. PCS 108-A&quot;
  1033. PCS 108-B&quot;
  1034. PCS-106A&quot;
  1035. PCS-106B&quot;
  1036. pdf\&quot;>Cluster &quot; << j+1 << &quot; Plot</a></li>&quot;
  1037. perform MeanShift for point i and get the centroid for each point
  1038. Performing initial RELAP5 run...&quot;
  1039. Performing MSA...&quot;
  1040. Please carefully the number of cycles.
  1041. Please carefully type the name of RAPS input file, or type \&quot;exit\&quot;: &quot;;
  1042. Please carefully type the name of RAPSS-EOC input file, or type \&quot;exit\&quot;: &quot;;
  1043. Please see http://www.raws.dri.edu/index.html&quot;
  1044. Please type the name of RAPSS input file (e.g., input.raps): &quot;;
  1045. Please type the name of RAPSS-EOC input file (e.g., input.rapss): &quot;;
  1046. plopping it into a 3D matrix
  1047. Plots</a></li>&quot;
  1048. plotting for keepgoing tripped data
  1049. Plotting tripped data...&quot;
  1050. Plume has been active since: &quot;<< plumeStartTime << &quot; &quot; << AMPMplumeStartTime
  1051. plume program expects it.
  1052. Plume program run on &quot; << nthreads << &quot; threads&quot;
  1053. plumeRst&quot;, rstNum, &quot;Cl&quot;, k-1, &quot;.pdf&quot;, sep=&quot;&quot;),onefile=TRUE
  1054. plus the length of the final section (which is a different
  1055. Point added!&quot;
  1056. PointID is the scenario number that gets removed and combined with another cluster
  1057. pragma omp barrier //needed?
  1058. pragma omp barrier //wait to run until all the restart files are written
  1059. pragma omp critical //maybe atomic?
  1060. pragma omp critical //restricts the execution of the associated statement
  1061. pragma omp parallel for //disabling parallel processing for the time being.
  1062. pragma omp parallel private(th_id,
  1063. pragma omp parallel shared(nthreads, flagVec, transientExplanation)
  1064. Prepare for RELAP...&quot; << endl;
  1065. prepping for parallel section:
  1066. Pressurizer &quot; <<endl;
  1067. prevKeepGoing<- c(&quot;;
  1068. Primary System&quot; <<endl;
  1069. probably also add in state variable codes
  1070. Processing fault tree information...&quot;
  1071. putting in time and units. -Don't worry about error message here, works like I want
  1072. Q is release activity
  1073. R doesn't let you assign a unit labels to only 1 dimension
  1074. R would see 5 threads and number them
  1075. RAPS input file error!&quot;
  1076. RAPSinputFile(RAPSinput); //reads input file
  1077. RAPSS secondary loop failure&quot;
  1078. RAPSS simulating Containment Leak&quot;
  1079. RAPSS simulating Flow Blockage&quot;
  1080. RAPSS simulating Hot channel chimney hole&quot; << endl;
  1081. RAPSS simulating partial Flow Blockage&quot; << endl;
  1082. RAPSS simulating RPV leak&quot;
  1083. RAPSS simulating sump open&quot;
  1084. RAPSS simulating Sump Water Makeup failure&quot; << endl;
  1085. RAPSS simulating VentValve closed&quot;
  1086. RAPSS simulating VentValve Open&quot;
  1087. RAPSSinputFile(RAPSSinput.c_str()); //reads input file
  1088. real time simulator reproduces data until given timestep
  1089. Rearranging, outputting and plotting data...&quot;
  1090. red threshold&quot;, sep=&quot; &quot;
  1091. Red Thresholds Tripped</span></strong><p><br>&quot;
  1092. redefining cols as numeric instead of characters
  1093. redefining cols as numeric instead of characters Page:
  1094. relap5.x &quot; << &quot;-i &quot; << InDir << &quot;/&quot; << R5Input << &quot; -o &quot; << OutDir << &quot;/&quot;
  1095. relap5.x &quot; << &quot;-i &quot; << OutDir << &quot;/&quot; << ThDir << &quot;/inputs/&quot;
  1096. releaseAmt<- &quot;
  1097. removing the &quot;e&quot;
  1098. Reorganizing RELAP5 output into csv file...&quot; << endl;
  1099. reorganizing the data into 2D matrix
  1100. returns a vector of the line numbers of the search term.
  1101. returns true only if the scenario is the first member of a cluster
  1102. rgb.palette<-colorRampPalette(c(&quot;gray25&quot;,&quot;red&quot;, &quot;yellow&quot;, &quot;green&quot;, &quot;gray85&quot;, &quot;white&quot;),
  1103. (1978). Risk Assessment Review Group Report to the U.S. Nuclear Regulatory Commission (Ad Hoc Risk Assessment Review
  1104. rm(list=ls())&quot;
  1105. row is always written before the test is performed to determine stop time
  1106. row.clear(); //clear row for next iteration
  1107. row.push_back(word.substr(0, word.size())); //last word doesn't have a comma
  1108. Rrepos<-\&quot;&quot; << Rrepos << &quot;\&quot;&quot; << endl << &quot;libloc<-\&quot;&quot; << libloc << &quot;\&quot;&quot; << endl;
  1109. rst&quot; << Windex << &quot;.i&quot;; //adding index to the string
  1110. rst&quot; << Windex << &quot;.p&quot;; //adding index to the string Page:
  1111. rst&quot; << Windex-1 << &quot;.p&quot;; //adding previous index to the string
  1112. RstNbr will change after the first time
  1113. rstNum<-&quot;
  1114. rstNum<-&quot; << Windex << endl;
  1115. run? (y/n)&quot;
  1116. run.sh fta_input_file&quot;
  1117. runAheadTime<- &quot; <<
  1118. s&quot;
  1119. save.image(\&quot;R_data/RAPSspace.RData\&quot;)&quot;
  1120. Sc&quot;, EndByTrip[k], &quot;.txt&quot;, sep = &quot;&quot;
  1121. (1997). SCAAT: Incremental Tracking with Incomplete Information. Association for Computing Machinery
  1122. scenario i has no threshold reached
  1123. scenario i has red threshold reached
  1124. scenario i has yellow threshold reached
  1125. Scenarios: &quot;
  1126. Search for the line number of the key
  1127. Secondary System&quot;
  1128. section for communicating which thresholds were exceeded Page:
  1129. seq(-outer.radius, outer.radius,
  1130. Serch function returns a vector with the line numbers of where the key is
  1131. Set temperature to FVM-602T&quot;
  1132. Set temperature to TF-131, TF-133, TF-134&quot; << endl;
  1133. Set temperature to TF-501&quot;
  1134. Set temperature to TF-501&quot; << endl;
  1135. Set volume 1 temperature to TF-501&quot;
  1136. Set volume 11 temperature to FVM-602T&quot;
  1137. Set Volume 6 temperature to TF-132&quot; <<endl;
  1138. Setting number of threads to &quot;
  1139. (2006). Severe Accident Analysis Using Dynamic Accident Progression Event Trees (PhD Dissertation). The Ohio State
  1140. sigX are std dev of lateral, vertical, and horizontal diffusion
  1141. simulate the number of time steps of the difference.
  1142. Simulating: &quot; << 1 << &quot; hour(s) with a wind coming from the &quot;
  1143. Simulating: &quot; << 1 << &quot; hour(s) with a wind coming from the&quot;
  1144. Simulating: &quot; << runAheadTime << &quot; hour(s) with a wind coming from the &quot;
  1145. sin(radians), cos(radians)),
  1146. Since there is no line &quot;0&quot; this will signify an error
  1147. Single Feedwater Line for Modeling of FRV to Branch before SGs &quot; << endl;
  1148. singleTransientExplanation.push_back(&quot;Component 482 Vent Valve OPEN&quot;);
  1149. singleTransientExplanation.push_back(&quot;RAPSS simulating Containment Leak&quot;);
  1150. singleTransientExplanation.push_back(&quot;RAPSS simulating Flow Blockage&quot;);
  1151. singleTransientExplanation.push_back(&quot;RAPSS simulating Hot channel chimney hole&quot;);
  1152. singleTransientExplanation.push_back(&quot;RAPSS simulating partial Flow Blockage&quot;);
  1153. singleTransientExplanation.push_back(&quot;RAPSS simulating Secondary Loop Failure&quot;);
  1154. singleTransientExplanation.push_back(&quot;RAPSS simulating Sump Open&quot;);
  1155. singleTransientExplanation.push_back(&quot;RAPSS simulating VentValve closed&quot;);
  1156. singleTransientExplanation.push_back(&quot;RAPSS simulating VentValve Open&quot;);
  1157. Site Criteria, 10CFR100.11. Page: 165 US Nuclear Regulatory Commission (USNRC). (2002b). Regulatory Guide 1.174 - An approach for Using Probabilistic Risk Assessment
  1158. size_t startpos =
  1159. Skipping thread... &quot;
  1160. something's funky!&quot;
  1161. span style=\&quot;text-decoration: underline;\&quot;>&quot;;
  1162. span style=\&quot;text-decoration: underline;\&quot;></span>&quot;;
  1163. span style=\&quot;text-decoration: underline;\&quot;>City X in danger</span></strong><p><br>&quot;
  1164. span style=\&quot;text-decoration: underline;\&quot;>Cluster Information&quot;;
  1165. span style=\&quot;text-decoration: underline;\&quot;>Cluster Information</strong><br>&quot;
  1166. span style=\&quot;text-decoration: underline;\&quot;>No Thesholds Tripped&quot;;
  1167. span></strong><br>&quot;
  1168. span></strong><p><br>&quot;
  1169. span><br><div id=\&quot;tswcsstabs\&quot;>&quot;
  1170. Spawning threads, sampling MASLWR data, writing restart files...&quot;
  1171. specialized variables for data organization
  1172. split up the second interval and start from the same spot.
  1173. sstm << &quot;conditions&quot; << Windex << &quot;.txt&quot;;
  1174. sstm << &quot;green&quot; << RstNum << &quot;.html&quot;; //adding index to the string
  1175. sstm << &quot;rst&quot; << Windex << &quot;.csv&quot;;
  1176. sstm << outDir << &quot;/currentState&quot; << Windex << &quot;.csv&quot;; //adding index to the string
  1177. sstm << outDir << &quot;/currentState&quot; << Windex-1 << &quot;.csv&quot;;//adding index to the string
  1178. stabClass=1; //keeping stab class the same for now
  1179. Start at the end of the key string character on the line
  1180. start by determining which transients to run from fault tree
  1181. start parallel processing for restart runs.
  1182. State variables, variable codes, equivalence, or thresholds are not of same size!&quot;
  1183. stateVarCodes <- c(\&quot;&quot;;
  1184. stateVarCodes2=stateVarCodes #strange artifact from R5! Have to remove second to last zero
  1185. stateVarTripNames <- c(\&quot;&quot;;
  1186. Steam generator--secondary outlet-Backpressure Regulator &quot;
  1187. Steam generator--tube &quot;
  1188. string author = &quot;Kevin Makinson&quot;;
  1189. string chmod = (&quot;chmod +x &quot; + FullFilePath);
  1190. string chmod = &quot;chmod +x &quot;;
  1191. string CreateDataDir= (&quot;mkdir -p &quot;
  1192. string CreateDataDir= (&quot;mkdir -p &quot; + outDir);
  1193. string fail = &quot;0******** Transient terminated by failure.&quot;;
  1194. string FTAinput = &quot;FTA/fta_input_file&quot;;
  1195. string FullFilePath = (OutDir + &quot;/&quot;
  1196. string FullFilePath = &quot;ChangeFont.sh&quot;;
  1197. string FullFilePath = &quot;ResetFont.sh&quot;;
  1198. string FullFilePath= (OutDir + &quot;/&quot; + ThDir + &quot;/inputs/&quot; + R5RstInput);
  1199. string key = &quot;0---Restart no.&quot;;
  1200. string key = &quot;Minimal cut set probabilities :&quot;;
  1201. string libloc, double PCAthreshold, double BW, bool dataOut, string InDir,
  1202. string libloc; //for R library files to download into
  1203. string MkLibDir = (&quot;mkdir -p &quot; + libloc);
  1204. string MkRdataDir = (&quot;mkdir -p R_data&quot;);
  1205. string MkRdataDir = (&quot;mkdir -p R_data&quot;); //added
  1206. string OutDir
  1207. string OutDir = (InDir + &quot;/RAPS_data&quot;); //Assigning Output Directory inside input directory
  1208. string ProbOpt = &quot;transnt&quot;;
  1209. string ProbOpt, double RstNbr, double EndTime, string MinTimeStep,
  1210. string ProbType = &quot;restart&quot;;
  1211. string R5Input, string R5Output, int requestTh, double TStep,
  1212. string R5Output, string R5RstData, string R5H2oData, string OutDir) {
  1213. string R5RstData, string R5H2oData, const char *InitShOutput, const char *RstShOutput,
  1214. string R5RstData, string R5RstInput, string R5RstOutput, string R5H2oData,
  1215. string R5RstInput; Page:
  1216. string R5SciConv(double num)
  1217. string radianDirTranslator(double radians)
  1218. string sState = &quot;0Transient has reached steady state.&quot;;
  1219. string sysDataFileName = (InDir + &quot;/&quot; + realTimeSimData);
  1220. string TimeStep = &quot;0Transient terminated by end of time step cards.&quot;;
  1221. string TimeStep3D = &quot; Transient terminated by end of time step cards.&quot;;
  1222. string TrimSpace(string MyString)
  1223. string Trip3D = &quot; Transient terminated by trip.&quot;;
  1224. string whitespaces (&quot; \t\f\v\n\r&quot;);
  1225. string windObsDataFile, string Rrepos, string libloc) {
  1226. string WriteInitShFile (const char *ShOutput, string InDir, string R5ExePath, string R5Input,
  1227. string WriteRstShFile (const char *RstShOutput, string InDir, string R5ExePath, string ThDir,
  1228. string(3, ' ') << &quot;Written by &quot; << author << endl;
  1229. string(3, ' ') << &quot;Written by Kevin Makinson&quot;
  1230. string(70, '=') << &quot;\n*\n*\n&quot;;
  1231. strong><br>&quot;
  1232. strong><font size=\&quot;+2\&quot;>RAPSS-EOC Output Restart &quot;
  1233. strong><font size=\&quot;+2\&quot;>RAPSS-EOC Output Restart &quot; << RstNum << &quot;</font><br>&quot;
  1234. strong><font size=\&quot;+2\&quot;>RAPSS-STA Output Restart &quot;
  1235. strong><span style=\&quot;text-decoration: underline;\&quot;>&quot;;
  1236. strong><span style=\&quot;text-decoration: underline;\&quot;>City X Possibly in Danger&quot;;
  1237. structure of updating keepGoing[
  1238. system((&quot;rm -rf &quot; + outDir).c_str()); //this removes it if it already exists (to overwrite)
  1239. system((&quot;rm &quot; + extraTripInfo).c_str()); //removing temporary file
  1240. system(&quot;R CMD BATCH --slave R_data/initPCA.r R_data/initPCA.Rout&quot;);
  1241. system(&quot;read -p \&quot;Press the [Enter] key to continue...\&quot;&quot;);
  1242. system(CreateDataDir.c_str()); //creates a directory for data output
  1243. system(RstShFullPath.c_str());//this actually runs it
  1244. t\t\t\t&quot;) && (word!=&quot; \t\t\t\t\t&quot;)
  1245. T1Step, FTAdir, FTAfileName, numOfCutSets, stateVarTripNames, stateVarCodes,
  1246. table style=\&quot;border-color: rgb(255, 0, 0); text-align: left; width: &quot;
  1247. table style=\&quot;border-color: rgb(255, 180, 0); text-align: left; width: &quot;
  1248. table>&quot;
  1249. take chunks of the string 13 characters at a time
  1250. taken out in one scenario, but not in others!
  1251. tbody>&quot;
  1252. td style=\&quot;width: 500px;\&quot;>&quot; << endl; //just added
  1253. td>&quot;
  1254. (1982). Technical Guidance for Siting Criteria Development, NUREG/CR-2239, SAND81-1539. Sandia National Laboratories.
  1255. Terminate by Trip, Timestep, or Errors?
  1256. text(x=-1.25*outer.radius, y=-1.25*outer.radius, xpd = TRUE, labels=&quot;Distance (m)&quot;
  1257. Th_&quot; << th_id << &quot;_data&quot;;
  1258. Thank you for running RAPS&quot;
  1259. Thank you for running RAPSS-EOC&quot;
  1260. Thank you for running RAPSS&quot;
  1261. ThDir << &quot;/&quot;
  1262. the closest centroid to NewCentroid and return the position of that point
  1263. the initial march towards the beginning.
  1264. The Length of the first section times the number of sections,
  1265. The number is in lbm/s, divide by 2.205 to switch to kg/s&quot; << endl;
  1266. The RAPSS engine will first perform the initial run for a RELAP5 file.&quot;
  1267. (2005). The SPAR-H Human Reliability Analysis Method, NUREG/CR-6883. Idaho National Lab.
  1268. (1944). Theory of Games and Economic Behavior.
  1269. these are defined locally.
  1270. these two loop checks to see if there are any cols or rows that have &quot;NA&quot; as members
  1271. these two loop checks to see if there are any cols or rows that have &quot;NA&quot; as members.
  1272. Theta (radians): &quot;
  1273. theta=(theta+pi); //changes to where wind is going (plume equation)
  1274. this allows extra space at the end just in case
  1275. this changes it from how the windrose does it (N is 0)
  1276. This code takes the grid structure from RAPSS-EOC and
  1277. This contains the majority of the functions used
  1278. this converts it from how wind directions are normally expressed,
  1279. this ends the main page.
  1280. this expects wind &quot;coming from&quot; a direction, not &quot;headed&quot;
  1281. This file loads the libraries and initial parameters
  1282. This file loads the libraries and initial parameters in R&quot;<<endl;
  1283. This files contains the misc functions for RAPSS-STA
  1284. This function expects a vector EndByVec, and returns a 2D vector with a summary of the
  1285. This function searches for the restart number in an R5 output file
  1286. This functions writes the user display
  1287. this goes to the end of the line
  1288. This guy converts between how the rest of the world does scientific notation Page:
  1289. this guy is tells you where the new sections are in the data.
  1290. this initializes R with the correct libraries and initial conditions for PCA
  1291. This is a header file that organizes the R5 output
  1292. This is a header file to go with Pmain.cpp for RAPSS-EOC
  1293. This is a test program for the display part of the decision engine
  1294. This is designed for RAPSS-EOC to produce the approperiate plots
  1295. this is eliminating the first and last time steps because they're funky
  1296. this is for single entries in the data to be pushed onto data vector
  1297. This is the main control structue for RAPSS-EOC
  1298. This is the main control structure
  1299. This is the main control structure for RAPSS
  1300. this loads the previous restart data instead of the seed data for the prevKeepGoing case
  1301. this loads the seed file in
  1302. this loop checks to see if there are any state variables that might need to be
  1303. this loop fixes a problem much later involving the inverting of the y variables.
  1304. This loop formats (reorganizes) the data to get into a form similar to normalized
  1305. this makes it so only the first section has headers
  1306. this method add a new point to an existing cluster and update the cluster center
  1307. this next section finds the items to remove
  1308. this one needs ot be included.
  1309. this one's rewritten!
  1310. this puts the data into a form so it can be MSA'd
  1311. this reduces delcol down to a 1D variable
  1312. This resets fin to the begining
  1313. This section is needed (to get n)
  1314. This section reduces n trips into a form that R5 can understand
  1315. This simulates a integrated puff model
  1316. This tells the outside world how the R5 terminated
  1317. This the structure that Cycles R5 and controls the parallel structure
  1318. this updates R with each cycle
  1319. thNum<- &quot; <<
  1320. thNum<-&quot;
  1321. threads that ended a certain way, 1: time, 2:Trip, 3: Steady State, 0: Errors
  1322. thresholds<-cbind(thresholds, rbind(&quot;
  1323. thresholds<-rbind(&quot;
  1324. ThTransientTranslator<- c(&quot;;
  1325. Time is now: &quot; << simulationStartTime << &quot; &quot; << AMPMsimulationStartTime << endl;
  1326. Time sampled: &quot; <<
  1327. Time sampled: &quot; << timestep << &quot; s&quot;
  1328. Time,AM/PM,Windspeed (m/s),Direction&quot;
  1329. time1<-units[,1] #added to get a better label for time.
  1330. timeInterval=timeInterval*3600; //converts hours to seconds
  1331. timestep <- &quot;
  1332. timestep=1; //writes a single timestep to &quot;realTimeData.txt&quot;
  1333. title>RAPSS-EOC Cluster Information
  1334. title>RAPSS-EOC No Thresholds
  1335. title>RAPSS-EOC Unstable Scenarios
  1336. title>RAPSS-STA Cluster Information
  1337. title>RAPSS-STA Display
  1338. title>RAPSS-STA Green Thresholds
  1339. title>RAPSS-STA Unstable Scenarios
  1340. To how the rest of the program does it (E is 0)
  1341. TOMNOTE: For all of these, pull data from PT-301 for the pressure column&quot; <<endl;
  1342. TOMNOTE: Set all of the flowfs to FVM-602M&quot; << endl;
  1343. TOMNOTE: Set flowf to FVM-602M&quot;
  1344. TOMNOTE: Set flowg (NOT flowf) to FVM-602M&quot; << endl;
  1345. TOMNOTE: Set pressure to PT-301 as usual&quot; <<endl;
  1346. TOMNOTE: Set pressure to PT-301, temperature to TF-111&quot; <<endl;
  1347. TOMNOTE: Set pressure to PT-301, temperature to TF-132&quot; <<endl;
  1348. TOMNOTE: Set pressure to PT-301&quot;
  1349. TOMNOTE: Set pressure to PT-301&quot; <<endl;
  1350. TOMNOTE: Set pressure to PT-511&quot;
  1351. TOMNOTE: Set pressure to PT-602 for all times&quot; << endl;
  1352. TOMNOTE: Set pressure to PT-602&quot; << endl;
  1353. Total Length from Problem Specification is 63.01 cm&quot; <<endl;
  1354. tpfh2onew * Restart file parameters * End Time (seconds)
  1355. tput setf &quot; << ColorCode << endl << &quot;tput bold&quot; << endl << &quot;exit 0&quot;;
  1356. tput sgr0&quot; << endl << &quot;exit 0&quot; << endl;
  1357. tr>&quot;
  1358. tr>&quot; << endl;
  1359. Transient ended by end of alloted time.&quot;
  1360. Transient ended by errors!&quot;
  1361. Transient ended by reaching steady state.&quot;
  1362. Transient ended by trip&quot;
  1363. transientExplanation; //explains transient
  1364. transientExplanation) //only on this line for print version
  1365. Trims white space around words
  1366. Trims white space around words grabbed from R5
  1367. TrimSpace(word); //trims excess white space around 13 character blocks
  1368. trip &quot;
  1369. trip; Scen #&quot;,
  1370. Trou&quot;) ||
  1371. truely parallel portion.
  1372. turns it into something MSA can use.
  1373. ul style=\&quot;color: green;\&quot;>&quot;
  1374. ul style=\&quot;color: red;\&quot;>&quot;
  1375. ul style=\&quot;color: red;\&quot;>&quot; << endl;
  1376. ul style=\&quot;color: rgb(0, 153, 0);\&quot;>&quot; << endl;
  1377. ul style=\&quot;color: rgb(225, 180, 0);\&quot;>&quot; << endl;
  1378. ul style=\&quot;color: rgb(255, 180, 0);\&quot;>&quot; << endl;
  1379. ul>&quot;
  1380. ul>&quot; << endl;
  1381. unMSAPCAc&quot;, j, &quot;rst&quot;, rstNum, &quot;.csv&quot;, sep=&quot;&quot;)), row.names = FALSE,
  1382. unstable&quot; << RstNum << &quot;.html&quot;; //adding index to the string
  1383. Upper Plenum&quot; <<endl;
  1384. using namespace std;
  1385. usr/bin/Rscript&quot;
  1386. variables for this program
  1387. vector < vector > cutSetVec, vector ThTransientTranslator,
  1388. vector > > loadGridData(string sysDataFileName)
  1389. vector > > loadSystemData(string sysDataFileName)
  1390. vector > loadWindObsData (string windDataFile);
  1391. vector > MeanShift (int Windex, double BW, string OutDir,
  1392. vector eventVec; //a single event of a cutset
  1393. vector prevKeepGoing, vector transient,
  1394. vector R5Values (stateVarTripNames.size());
  1395. vector record2; //gotta clear record2 each time!
  1396. vector redTripThresh, int requestTh, vector<vector<string >
  1397. vector redTripThresh, vector FTApars, string realTimeSimData
  1398. vector RstIptGen(string R5Output, string R5RstInput, string ThDir,
  1399. vector stateVarCodes2=stateVarCodes; //for when R5 deletes the 7th character
  1400. vector stateVarEquiv, vector yellowTripThresh,
  1401. vector stateVarTripNames, vector stateVarCodes,
  1402. vector temp1; Page:
  1403. vector ThDir; //name of thread directory
  1404. vector ThDir; //name of thread directory Page:
  1405. vector ThDir; //resets the vector
  1406. vector translator; //translates scenario numbers to real scenario names
  1407. vector updateRwindex(int Windex, int nthreads, vector > EndBySumVec,
  1408. void addPoint (double NewCentroid[], int pointID, int dimensions, int clustCount);
  1409. void cluster::addPoint (double NewCentroid[], int pointID, int dimensions, int clustCount) {
  1410. void cyclePlumeProgram(double Q, double hE, double z, int maxY, int gridResolution,
  1411. void CycleR5(string answer, string ProbType, string ProbOpt, double EndTime, string MinTimeStep,
  1412. void doFTA(vector FTApars, string FTAfileName, string FTAdir) {
  1413. void ftaFileFixer(string filename) { //this deletes the stuff that LiteFTA doesn't like
  1414. void htmlDisplayWriter(string OutDir, string InDir,
  1415. void initR(string Rrepos, string libloc, double PCAthreshold, bool dataOut, string OutDir,
  1416. void initR(string Rrepos, string libloc, string OutDir, int thNum, int Windex, int runAheadTime,
  1417. void MeanShiftOperator(double *NewPosition, double *point, double **data, double h,
  1418. void printGrid(vector < vector > grid, string outputFileName) {
  1419. void printGrid(vector < vector > grid, string outputFileName);
  1420. void RAPSinputFile(string RAPSinput); //function that reads input file,
  1421. void RAPSSinputFile(string RAPSSinput); //function that reads input file,
  1422. void setNew (int dimensions, double center[], int pointID);
  1423. void updateRwindex(int Windex, int time);
  1424. Website for downloading R files (Rrepos)
  1425. Welcome to RAPSS-EOC&quot; << endl << &quot;Written by Kevin Makinson&quot;
  1426. Welcome to RAPSS&quot; << endl << &quot;Written by Kevin Makinson&quot;
  1427. What time of day did the plume start? (plumeStartTime) (e.g., 1 AM) (note: not 1:00
  1428. What time of day did the simulation start?
  1429. while ((answer != &quot;n&quot;) && (answer != &quot;y&quot;)
  1430. while ((answer == &quot;y&quot;) || (answer == &quot;yes&quot;)
  1431. while (lastLineInSet == false) {// this goes to the next cut set number
  1432. windDataFile, th_id)[0]; //windrose data
  1433. windObsDataFile ).c_str());
  1434. WindSpeed: &quot; <<
  1435. with a speed of &quot;
  1436. with the given parameters Page:
  1437. Working for storing files (inDir)
  1438. xlab=&quot;Time (s)&quot;, ylab=&quot;Normalized data (unitless)&quot;,
  1439. xpd = TRUE,
  1440. Xrot); //not needed for ground level
  1441. y,
  1442. y=75, labels=&quot;City X&quot;,
  1443. Yellow Thesholds Tripped</span></strong><p><br>&quot;
  1444. YES this is where this is supposed
  1445. yes&quot;) && (answer != &quot;no&quot;)
  1446. You did not enter a \&quot;y\&quot; or an \&quot;n\&quot;!&quot; << endl;

To submit an update or takedown request for this paper, please submit an Update/Correction/Removal Request.