Plugin UserLab: Difference between revisions
(Created page with "{{Plugin |Name=UserLab Plugin |Description=This plugin implements various UserLab features. |Author=Koffi Daniel |Version=1.0 |Date=2024-04-15 |Features= Goenaga et al 2017 |RPSVersion=All }} You can find the source code of this plugin on the following Github repository: [https://github.com/LabRPS/LabRPS-plugins/tree/master/UserLab/UserLabPlugin Get the code here!]. This plugin is one of the official plugins provided by LabRPS. It provides very u...") |
No edit summary |
||
Line 32: | Line 32: | ||
<math>m</math> is a pavement waviness indicator. It has been found that this parameter takes values between 1.75 and 2.25. | <math>m</math> is a pavement waviness indicator. It has been found that this parameter takes values between 1.75 and 2.25. | ||
=== Properties === | === Properties === | ||
* {{PropertyData| | * {{PropertyData|ReferenceWaveNumber}}: The reference wave number. | ||
* {{PropertyData|ReferenceSpectrum}}: The spectrum at the reference wave number. | |||
* {{PropertyData|PavementWavinessIndicator}}: The pavement waviness indicator. | |||
* {{PropertyData| | |||
* {{PropertyData| | |||
=== Scripting === | === Scripting === | ||
Line 61: | Line 50: | ||
from LabRPS import Vector as vec | from LabRPS import Vector as vec | ||
def compute(): | def compute(): | ||
installResuslt = UserLab.installPlugin("UserLabPlugin") | |||
if not installResuslt: | |||
LabRPS.Console.PrintError("The installation the UserLabPlugin has failed.\n") | |||
return None | |||
# | # Document | ||
doc = LabRPS.newDocument() | |||
# Simulation | |||
sim = UserLabObjects.makeSimulation(doc, "Simulation") | |||
if not sim: | if not sim: | ||
LabRPS.Console.PrintError("The simulation does not exist.\n") | LabRPS.Console.PrintError("The simulation does not exist.\n") | ||
return None | return None | ||
featureType = " | featureType = "Goenaga et al 2017" | ||
featureGroup = " | featureGroup = "Simulation Method" | ||
# create the feature and add it to the existing simulation (you may refer to the UserLab Workbench page in | # create the feature and add it to the existing simulation (you may refer to the UserLab Workbench page in | ||
# case you don't understand the next line) | # case you don't understand the next line) | ||
method = UserLabObjects.makeFeature("Goenaga et al 2017", sim.Name, featureType, featureGroup) | |||
# check if the created feature is good | # check if the created feature is good | ||
if not | if not method: | ||
LabRPS.Console.PrintError("Error on creating the | LabRPS.Console.PrintError("Error on creating the method function feature.\n") | ||
return None | return None | ||
sim.setActiveFeature(method) | |||
sim.setActiveFeature( | |||
# | # run the simulation and return the first sample | ||
pavement = sim.simulate(0) | |||
# show the results | # show the results | ||
GeneralToolsGui.GeneralToolsPyTool.showArray(len( | GeneralToolsGui.GeneralToolsPyTool.showArray(len(pavement), len(pavement[0]), pavement) | ||
LabRPS.ActiveDocument.recompute() | LabRPS.ActiveDocument.recompute() | ||
compute() | compute() | ||
}} | }} |
Latest revision as of 08:52, 1 February 2025
Description |
---|
This plugin implements various UserLab features. Plugin version: 1.0 Last modified: 2024-04-15 LabRPS version: All Author: Koffi Daniel |
Author |
Koffi Daniel |
Download |
None |
Features |
Goenaga et al 2017 |
Plugin Version |
1.0 |
Date last modified |
2024-04-15 |
LabRPS Version(s) |
All |
Default shortcut |
None |
See also |
None |
You can find the source code of this plugin on the following Github repository: Get the code here!. This plugin is one of the official plugins provided by LabRPS. It provides very useful features (tools) for the simulation of user defined random phenomena. Plugins are very easy to create in LabRPS, therefore, anyone can develop plugin for any random phenomenon in LabRPS. Go to this page to see how to create new plugin for LabRPS. You can get quick assistance from LabRPS community by sending your concern to the community forum.
Goenaga et al 2017
This feature simulates pavement profiles according to the sinusoidal approach proposed in Goenaga et al 2017 where the longitudinal pavement profiles corresponding to a wheel track can be mathematically constructed from a set of sinusoidal waves with different wavelengths, amplitudes and phases. Assuming a vehicle travels at a constant speed over a road segment with length L, a random pavement profile is approximated overlaying an infinite number of sine waves [math]\displaystyle{ (N \to \infty) }[/math] as follows:
[math]\displaystyle{ Z_R(s) = \sum_{i=1}^NA_i\mbox{sin}\left ( \Omega_is - \phi_i \right ) }[/math]
where:
[math]\displaystyle{ A_i = \sqrt{\Phi(\Omega_i)\left ( \frac{\Delta\Omega}{\pi} \right )} }[/math]
[math]\displaystyle{ \Phi(\Omega) }[/math] is the power spectral density function of the random pavement profiles can be approximated by a PSD in the following form:
[math]\displaystyle{ \Phi(\Omega) = \Phi(\Omega_0)\left ( \frac{\Omega}{\Omega_0} \right )^{-m} }[/math]
[math]\displaystyle{ m }[/math] is a pavement waviness indicator. It has been found that this parameter takes values between 1.75 and 2.25.
Properties
- DataReferenceWaveNumber: The reference wave number.
- DataReferenceSpectrum: The spectrum at the reference wave number.
- DataPavementWavinessIndicator: The pavement waviness indicator.
Scripting
The feature can be used from the python console as follows:
import UserLab import UserLabObjects import GeneralToolsGui import LabRPS from LabRPS import Vector as vec def compute(): installResuslt = UserLab.installPlugin("UserLabPlugin") if not installResuslt: LabRPS.Console.PrintError("The installation the UserLabPlugin has failed.\n") return None # Document doc = LabRPS.newDocument() # Simulation sim = UserLabObjects.makeSimulation(doc, "Simulation") if not sim: LabRPS.Console.PrintError("The simulation does not exist.\n") return None featureType = "Goenaga et al 2017" featureGroup = "Simulation Method" # create the feature and add it to the existing simulation (you may refer to the UserLab Workbench page in # case you don't understand the next line) method = UserLabObjects.makeFeature("Goenaga et al 2017", sim.Name, featureType, featureGroup) # check if the created feature is good if not method: LabRPS.Console.PrintError("Error on creating the method function feature.\n") return None sim.setActiveFeature(method) # run the simulation and return the first sample pavement = sim.simulate(0) # show the results GeneralToolsGui.GeneralToolsPyTool.showArray(len(pavement), len(pavement[0]), pavement) LabRPS.ActiveDocument.recompute() compute()