@@ -61,7 +61,7 @@ MATLAB Engine → Model Directory → Set Parameters → w2gSim() → Results
6161 - ` set_wec_sim_path() ` — Configure WEC-Sim installation location
6262
6363- ** Simulation Control**
64- - ` __call__ ()` — Execute complete WEC device simulation with parameters
64+ - ` simulate ()` — Execute complete WEC device simulation with parameters
6565 - Wave parameters: height [ m] , period [ s] , spectrum type, random seed
6666 - Simulation parameters: duration [ s] , time step [ s] , model path
6767
@@ -225,3 +225,125 @@ wec_sim_id = wecsim(
225225- Reduce simulation length for testing workflows
226226- Increase time step for faster execution (trade-off with accuracy)
227227- Use smaller wave heights to avoid numerical instabilities
228+
229+ ### Example Run
230+
231+ elow is an example of running a full 24 wec simulation of the RM3 wave energy model.
232+
233+ # Run WEC-Sim simulation of the RM3 wave energy model
234+
235+ ``` python
236+
237+ runner.wecsim(
238+ model_path = " ./wec/RM3" ,
239+ sim_length = 3600 * 24 , # 24 hours in seconds
240+ delta_time = 0.1 ,
241+ spectrum_type = ' PM' ,
242+ wave_class = ' irregular' ,
243+ wave_height = 2.5 ,
244+ wave_period = 8.0 ,
245+ wave_seed = random.randint(1 , 100 ),
246+ )
247+
248+ ```
249+ ``` bash
250+
251+ ⠀ WEC-SIM⠀⠀⠀⠀ ⣠⣴⣶⠾⠿⠿⠯⣷⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
252+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣾⠛⠁⠀⠀⠀⠀⠀⠀⠈⢻⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
253+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⠿⠁⠀⠀⠀⢀⣤⣾⣟⣛⣛⣶⣬⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
254+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⠟⠃⠀⠀⠀⠀⠀⣾⣿⠟⠉⠉⠉⠉⠛⠿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
255+ ⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⡟⠋⠀⠀⠀⠀⠀⠀⠀⣿⡏⣤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
256+ ⠀⠀⠀⠀⠀⠀⠀⣠⡿⠛⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣷⡍⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣤⣤⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
257+ ⠀⠀⠀⠀⠀⣠⣼⡏⠀⠀ ⠈⠙⠷⣤⣤⣠⣤⣤⡤⡶⣶⢿⠟⠹⠿⠄⣿⣿⠏⠀⣀⣤⡦⠀⠀⠀⠀⣀⡄
258+ ⢀⣄⣠⣶⣿⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠓⠚⠋⠉⠀⠀⠀⠀⠀⠀⠈⠛⡛⡻⠿⠿⠙⠓⢒⣺⡿⠋⠁
259+ ⠉⠉⠉⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠁⠀
260+
261+ Starting MATLAB Engine... MATLAB engine started.
262+ Adding WEC-SIM to path... WEC-SIM path added.
263+ Starting WEC-SIM simulation...
264+ Model: RM3
265+ Model Path: ./wec/RM3
266+ Simulation Length: 86400 seconds
267+ Time Step: 0.1 seconds
268+ Wave class: irregular
269+ Wave Height: 2.5 m
270+ Wave Period: 8.0 s
271+
272+ simulation complete... writing to database at
273+ c:\U sers\a lexb\r esearch\W EC-GRID\e xamples\W ECGrid.db
274+ WEC-SIM complete: model = RM3, wec_sim_id = 1, duration = 86400s
275+ MATLAB Output:
276+ ==========
277+ WEC-Sim: An open-source code for simulating wave energy converters
278+ Version: 5.0.1
279+
280+ Initializing the Simulation Class...
281+ Case Dir: C:\U sers\a lexb\r esearch\W EC-GRID\e xamples\w ec\R M3
282+
283+ WEC-Sim Input From Standard wecSimInputFile.m Of Case Directory...
284+ WEC-Sim: An open-source code for simulating wave energy converters
285+ Version: 5.0.1
286+
287+ Initializing the Simulation Class...
288+ Case Dir: C:\U sers\a lexb\r esearch\W EC-GRID\e xamples\w ec\R M3
289+ Elapsed time is 0.399332 seconds.
290+
291+ WEC-Sim Pre-processing ...
292+ Infinite water depth specified in BEM and " waves.waterDepth" not specified in input file.
293+ Set water depth to 200m for visualization.
294+ Elapsed time is 24.918356 seconds.
295+
296+ WEC-Sim Simulation Settings:
297+ Start Time (sec) = 0
298+ End Time (sec) = 86400
299+ Time Step Size (sec) = 0.1
300+ Ramp Function Time (sec) = 0
301+ Convolution Integral Interval (sec) = 60
302+ Number of Time Steps = 864000
303+
304+ Wave Environment:
305+ Wave Type = Irregular Waves (Predefined Random Phase)
306+ Spectrum Type = Pierson-Moskowitz
307+ Significant Wave Height, Hs (m) = 2.5
308+ Peak Wave Period, Tp (sec) = 8
309+
310+ List of Body: Number of Bodies = 2
311+
312+ ***** Body Number 1, Name: float *****
313+ Body CG (m) = [0,0,-0.72]
314+ Body Mass (kg) = 725834
315+ Body Diagonal MOI (kgm2)= [2.09073E+07,2.13061E+07,3.70855E+07]
316+
317+ ***** Body Number 2, Name: spar *****
318+ Body CG (m) = [0,0,-21.29]
319+ Body Mass (kg) = 886691
320+ Body Diagonal MOI (kgm2)= [9.44196E+07,9.44071E+07,2.85422E+07]
321+
322+ List of PTO(s): Number of PTOs = 1
323+
324+ ***** PTO Name: PTO1 *****
325+ PTO Stiffness (N/m; Nm/rad) = 0
326+ PTO Damping (Ns/m; Nsm/rad) = 0
327+
328+ List of Constraint(s): Number of Constraints = 1
329+
330+ ***** Constraint Name: Constraint1 *****
331+
332+
333+ Simulating the WEC device defined in the SimMechanics model C:\U sers\a lexb\r esearch\W EC-GRID\e xamples\w ec\R M3\W 2G_ss_RM3.slx...
334+ Elapsed time is 5.154023 seconds.
335+ Elapsed time is 802.377574 seconds.
336+
337+ Post-processing and saving...
338+ Elapsed time is 8.199315 seconds.
339+ Inserting simulation metadata...
340+ model_type: RM3 (class: char)
341+ wave_spectrum: PM (class: char)
342+ wave_class: irregular (class: char)
343+ sim_hash: RM3_2.5m_8.0s_94 (class: char)
344+ WEC-Sim data stored: wec_sim_id = 1, 864001 time points
345+
346+ ==========
347+ MATLAB engine stopped.
348+
349+ ```
0 commit comments