pycba
pycba copied to clipboard
Run vehicle on a given range
https://github.com/ccaprani/pycba/blob/283df18832e610f59461e0866719c4e614bb6ff6/src/pycba/bridge.py#L211C10-L211C10
How easy would it be to implement setting a range of motion the vehicle is allowed to move? This is particularly useful in a transverse deck bridge analyses where the vehicle can only move within the lanes.
Regards
Could we implement something like this? (sorry for not being able to implement the code myself)
` def run_vehicle( self, step: float, plot_env: bool = False, plot_all: bool = False, fist_axle_start_pos: float=0,fist_axle_end_pos: float=0 ):
self._check_objects()
self.pos = []
self.vResults = []
npts = round((self.ba.beam.length + self.veh.L) / step) + 1
if fist_axle_end_pos==0:
fist_axle_end_pos=(self.ba.beam.length + self.veh.L)
if plot_all:
fig, axs = plt.subplots(2, 1, sharex=True)
for i in range(npts):
# load position
pos = i * step
if (pos>=fist_axle_start_pos and pos<=fist_axle_end_pos):
self.pos.append(pos)
out = self._single_analysis(pos)
if out != 0:
raise ValueError("Bridge analysis did not succeed at {pos=}")
return
if plot_all:
self.plot_static(pos, axs)
plt.pause(0.01)
self.vResults.append(self.ba.beam_results)
env = Envelopes(self.vResults)
if plot_env:
self.plot_envelopes(env)
return env
`