Degradation Modelling

This rover shows how degradation modelling can be performed to model the resilience of an engineered system over its entire lifecycle.

import fmdtools.analyze as an
import fmdtools.sim.propagate as prop
import numpy as np
import matplotlib.pyplot as plt
import multiprocessing as mp
from examples.rover.rover_degradation import DriveDegradation, PSFDegradationLong, PSFDegradationShort

Degradation models are defined independently of the fault model, but have attributes (e.g., functions) which may correspond to it directly.

Because degradation may only occur in specific functions/flows (and may not have inter-functional dependencies), it is not necessary for the degradation model to have the same

deg_mdl = DriveDegradation()
deg_mdl
drivedegradation DriveDegradation
- t=Time(time=-0.1, timers={})
- s=DriveDegradationStates(wear=0.0, corrosion=0.0, friction=0.0, drift=0.0)
- r=DriveRand(seed=42, s=DriveRandStates(corrode_rate=0.01, wear_rate=0.02, yaw_load=0.01))
deg_mdl_hum_long = PSFDegradationLong()
deg_mdl_hum_long
psfdegradationlong PSFDegradationLong
- t=Time(time=-0.1, timers={})
- s=PSFDegradationLongStates(experience=1.0)
deg_mdl_hum_short = PSFDegradationShort()
deg_mdl_hum_short
psfdegradationshort PSFDegradationShort
- t=Time(time=-0.1, timers={})
- s=PSFDegradationShortStates(fatigue=0.0, stress=0.0, experience=1.0)
- r=PSFDegShortRand(seed=42, s=PSFDegShortRandStates(fatigue_param=1.0))
from examples.rover.rover_model import Rover, plot_map
fault_mdl = Rover(p={'ground':{'linetype': 'turn'}})
graph = fault_mdl.as_modelgraph()
fig, ax = graph.draw()
../../../_images/780b3c1229638c633b2c1e1738b5b829ede5d687300b1ecd9313fd75f0db83af.png
fig.savefig("func_model.pdf", format="pdf", bbox_inches = 'tight', pad_inches = 0)
endresults, mdlhist = prop.nominal(fault_mdl)
fig, ax = plot_map(fault_mdl, mdlhist)
../../../_images/ef607ea32501d29b249026b2c739075e79eb60a397e4b7ceee8e964d1fd1d05b.png
fig.savefig("sine_rover_environment.pdf", format="pdf", bbox_inches = 'tight', pad_inches = 0)

As shown, there are two degradation models here:

  • one which focusses solely on faults in the drive system, and

  • one which focusses on the human degradation of fatigue Below we simulate these to model to the degradation behaviors being modelled in this drive system.

Drive Degradation

deg_mdl = DriveDegradation()
endresults, mdlhist = prop.nominal(deg_mdl)
fig, ax = mdlhist.plot_line('s.wear', 's.corrosion', 's.friction', 's.drift', 'r.s.corrode_rate', 'r.s.wear_rate', 'r.s.yaw_load')
../../../_images/b189b2a446277e57d3fe6798f7e441ec15048d004edca535ca14b605a5777400.png

The major behaviors are:

  • wear

  • corrosion

  • friction

  • drift

These behaviors result from the accumulation of the following rates over each time-step:

  • yaw_load

  • corrode_rate

  • wear_rate

These degradation behaviors have additionally been defined to simulate stochastically if desired:

deg_mdl = DriveDegradation()
endresults, mdlhist = prop.nominal(deg_mdl, run_stochastic=True)
fig, ax = mdlhist.plot_line('s.wear', 's.corrosion', 's.friction', 's.drift', 'r.s.corrode_rate', 'r.s.wear_rate', 'r.s.yaw_load')
../../../_images/b189b2a446277e57d3fe6798f7e441ec15048d004edca535ca14b605a5777400.png

To get averages/percentages over a number of scenarios, we can view these behaviors over a given number of random seeds:

from fmdtools.sim.sample import ParameterSample
ps = ParameterSample()
ps.add_variable_replicates([], replicates=100, seed_comb='independent')
endclasses_deg, mdlhists_deg = prop.parameter_sample(deg_mdl, ps, run_stochastic=True)
SCENARIOS COMPLETE: 100%|██████████| 100/100 [00:01<00:00, 78.86it/s]
fig, ax = mdlhists_deg.plot_line('s.wear', 's.corrosion', 's.friction', 's.drift',
                                 'r.s.corrode_rate', 'r.s.wear_rate', 'r.s.yaw_load',
                                 title="", xlabel='lifecycle time (months)', aggregation = 'mean_bound')
../../../_images/1217a7def91501390516f6834e211d8a5391c369d81615dbbd9a1a9bd820fcb2.png
fig.savefig("drive_degradations.pdf", format="pdf", bbox_inches = 'tight', pad_inches = 0)

As shown, while wear and friction proceed monotonically, drift can go one way or another, meaning that whether the rover drifts left or right is basically up to chance. We can further look at slices of these distributions:

fig, axs = mdlhists_deg.plot_metric_dist([1, 10, 20, 25], 's.wear', 's.corrosion', 's.friction', 's.drift', bins=10, alpha=0.5)
../../../_images/e1f869ac0e87414848fec86ccfcf97a98abc2b2765c8c716e2e78410b99f56da.png
from IPython.display import HTML
ani = mdlhists_deg.animate('plot_metric_dist_from',
                           plot_values=( 's.wear', 's.corrosion', 's.friction', 's.drift'),
                                        bins=10, alpha=0.5)
HTML(ani.to_jshtml())
../../../_images/15514d0743419d17a14b7e8d26cc6cac27f4a9ae2a0f6bbe80cf767716a138cc.png

Given the parameter information (friction and drift) that the degradation model produced, we can now simulate the model with this information over time in the nominal scenarios.

from fmdtools.sim.sample import ParameterDomain, ParameterHistSample
from examples.rover.rover_model import RoverParam

We can do this using a ParameterHistSample to sample the histories of the various scenarios at different times.

First, by defining a ParameterDomain:

rpd = ParameterDomain(RoverParam)
rpd.add_variables('degradation.friction', 'degradation.drift')
rpd(1, 10).degradation
DegParam(friction=1.0, drift=10.0)

And then by defining the class:

phs = ParameterHistSample(mdlhists_deg, 's.friction', 's.drift', paramdomain=rpd)
phs._get_repname('default', 1)
phs.add_hist_groups(reps= 10, ts = [1, 2, 5, 10])
len(phs.scenarios())
40

Simulating the nominal scenario for these parameters:

behave_endclasses, behave_mdlhists = prop.parameter_sample(fault_mdl, phs)
SCENARIOS COMPLETE: 100%|██████████| 40/40 [00:19<00:00,  2.06it/s]
mdl=Rover(p={'degradation': {'friction': 1.0, 'drift': 0.1}})
mdl.fxns['drive'].m.get_faults()
{'custom': Fault(prob=1.0, cost=0.0, phases=(('drive', 1.0), ('start', 1.0)), disturbances=(), units='sim'),
 'elec_open': Fault(prob=1.0, cost=0.0, phases=(('drive', 1.0), ('start', 1.0)), disturbances=(('s.transfer', 0.0),), units='sim'),
 'stuck': Fault(prob=1.0, cost=0.0, phases=(('drive', 1.0), ('start', 1.0)), disturbances=(('s.friction', 11.0),), units='sim'),
 'stuck_left': Fault(prob=1.0, cost=0.0, phases=(('drive', 1.0), ('start', 1.0)), disturbances=(('s.friction', 4.0), ('s.drift', -0.1)), units='sim'),
 'stuck_right': Fault(prob=1.0, cost=0.0, phases=(('drive', 1.0), ('start', 1.0)), disturbances=(('s.friction', 4.0), ('s.drift', 0.30000000000000004)), units='sim')}
fig, ax = plot_map(fault_mdl, behave_mdlhists)
../../../_images/a249d279e6ee96dbefc6949768fadbb1107fd217b963e4b6ecbda3e1f78c47e9.png
behave_endclasses.state_probabilities('prob')
{'nominal mission': 30.0, 'incomplete mission': 10.0}
from fmdtools.analyze.tabulate import NominalEnvelope
ne = NominalEnvelope(phs, behave_endclasses, 'classification',
                     'p.degradation.friction', 'p.degradation.drift',
                     func = lambda x: x == 'nominal mission')
ne.plot_scatter()
(<Figure size 600x400 with 1 Axes>,
 <Axes: xlabel='p.degradation.friction', ylabel='p.degradation.drift'>)
../../../_images/16123dfcbd70ca218e1bed68a510f7ef8b2e95c0ac6656a69f52e0be504d90d7.png
ne = NominalEnvelope(phs, behave_endclasses, 'classification',
                     'inputparams.t', 'inputparams.rep',
                     func = lambda x: x == 'nominal mission')
ne.plot_scatter()
(<Figure size 600x400 with 1 Axes>,
 <Axes: xlabel='inputparams.t', ylabel='inputparams.rep'>)
../../../_images/ed4c056e22e518f2479dba197334b8f83c3d5edf9aff00c8874665e6dd1632a3.png
fig.savefig("drive_deg_envelope.pdf", format="pdf", bbox_inches = 'tight', pad_inches = 0)

As shown, as the time (and thus degradation) increases, the rover becomes more likely to be unable to complete the mission. In this case, it results in the rover not completing the mission in time.

from fmdtools.sim.sample import SampleApproach
sa = SampleApproach(mdl)
sa.add_faultdomain('drive_faults', 'all_fxnclass_modes', 'Drive')
sa.add_faultsample('drive_faults', 'fault_phases', 'drive_faults',"start")
# sa.scenarios()

Note that faultdomains generated as a part of this model have fault parameters updated from the model parameters:

sa.faultdomains['drive_faults'].faults
{('drive',
  'custom'): Fault(prob=1.0, cost=0.0, phases=(('drive', 1.0), ('start', 1.0)), disturbances=(), units='sim'),
 ('drive',
  'elec_open'): Fault(prob=1.0, cost=0.0, phases=(('drive', 1.0), ('start', 1.0)), disturbances=(('s.transfer', 0.0),), units='sim'),
 ('drive',
  'stuck'): Fault(prob=1.0, cost=0.0, phases=(('drive', 1.0), ('start', 1.0)), disturbances=(('s.friction', 11.0),), units='sim'),
 ('drive',
  'stuck_left'): Fault(prob=1.0, cost=0.0, phases=(('drive', 1.0), ('start', 1.0)), disturbances=(('s.friction', 4.0), ('s.drift', -0.1)), units='sim'),
 ('drive',
  'stuck_right'): Fault(prob=1.0, cost=0.0, phases=(('drive', 1.0), ('start', 1.0)), disturbances=(('s.friction', 4.0), ('s.drift', 0.30000000000000004)), units='sim')}
sa.scenarios()
[SingleFaultScenario(sequence={15.0: Injection(faults={'drive': ['custom']}, disturbances={})}, times=(15.0,), function='drive', fault='custom', rate=1.0, name='drive_custom_t15p0', time=15.0, phase='start'),
 SingleFaultScenario(sequence={15.0: Injection(faults={'drive': ['elec_open']}, disturbances={})}, times=(15.0,), function='drive', fault='elec_open', rate=1.0, name='drive_elec_open_t15p0', time=15.0, phase='start'),
 SingleFaultScenario(sequence={15.0: Injection(faults={'drive': ['stuck']}, disturbances={})}, times=(15.0,), function='drive', fault='stuck', rate=1.0, name='drive_stuck_t15p0', time=15.0, phase='start'),
 SingleFaultScenario(sequence={15.0: Injection(faults={'drive': ['stuck_left']}, disturbances={})}, times=(15.0,), function='drive', fault='stuck_left', rate=1.0, name='drive_stuck_left_t15p0', time=15.0, phase='start'),
 SingleFaultScenario(sequence={15.0: Injection(faults={'drive': ['stuck_right']}, disturbances={})}, times=(15.0,), function='drive', fault='stuck_right', rate=1.0, name='drive_stuck_right_t15p0', time=15.0, phase='start')]
sa.mdl.fxns['drive'].m.get_fault_disturbances("elec_open")
{'s.transfer': 0.0}
fd = {'drive_faults':  (('faults', ('drive', 'elec_open'), ('drive', 'stuck'), ('drive', 'stuck_left'), ('drive', 'stuck_right')), {})}
fs = {'drive_faults': (('fault_phases', 'drive_faults', "start"), {})}
ec_nest, hist_nest, app_nest = prop.nested_sample(mdl, phs, faultdomains=fd, faultsamples=fs, pool=mp.Pool(5))
SCENARIOS COMPLETE: 100%|██████████| 40/40 [00:09<00:00,  4.26it/s]
app_nest
{'hist_0': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_1': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_2': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_3': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_4': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_5': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_6': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_7': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_8': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_9': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_10': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_11': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_12': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_13': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_14': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_15': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_16': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_17': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_18': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_19': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_20': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_21': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_22': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_23': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_24': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_25': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_26': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_27': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_28': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_29': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_30': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_31': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_32': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_33': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_34': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_35': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_36': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_37': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_38': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults,
 'hist_39': SampleApproach for rover with: 
  faultdomains: drive_faults
  faultsamples: drive_faults}
app_nest['hist_39'].faultdomains['drive_faults'].faults
{('drive',
  'elec_open'): Fault(prob=1.0, cost=0.0, phases=(('drive', 1.0), ('start', 1.0)), disturbances=(('s.transfer', 0.0),), units='sim'),
 ('drive',
  'stuck'): Fault(prob=1.0, cost=0.0, phases=(('drive', 1.0), ('start', 1.0)), disturbances=(('s.friction', 10.223606797749978),), units='sim'),
 ('drive',
  'stuck_left'): Fault(prob=1.0, cost=0.0, phases=(('drive', 1.0), ('start', 1.0)), disturbances=(('s.friction', 3.223606797749979), ('s.drift', -0.10990000000000001)), units='sim'),
 ('drive',
  'stuck_right'): Fault(prob=1.0, cost=0.0, phases=(('drive', 1.0), ('start', 1.0)), disturbances=(('s.friction', 3.223606797749979), ('s.drift', 0.2901)), units='sim')}

Finally, we can also visualize simulate and then view the effect of the degradation on average resilience…

ec_nest.hist_10.drive_elec_open_t15p0.tend.classify
rate:                                1.0
cost:                                  0
prob:                                1.0
expected_cost:                         0
in_bound:                          False
at_finish:                         False
line_dist:                             1
num_modes:                             1
end_dist:             26.213811009563567
tot_deviation:       0.20481761713251767
faults:                         array(1)
classification: incomplete mission faulty
end_x:                2.7379087437090024
end_y:                0.6669691790460738
endpt:                          array(2)
phs.get_scen_groups(*['inputparams.t'])
{(1,): ['hist_0',
  'hist_4',
  'hist_8',
  'hist_12',
  'hist_16',
  'hist_20',
  'hist_24',
  'hist_28',
  'hist_32',
  'hist_36'],
 (2,): ['hist_1',
  'hist_5',
  'hist_9',
  'hist_13',
  'hist_17',
  'hist_21',
  'hist_25',
  'hist_29',
  'hist_33',
  'hist_37'],
 (10,): ['hist_3',
  'hist_7',
  'hist_11',
  'hist_15',
  'hist_19',
  'hist_23',
  'hist_27',
  'hist_31',
  'hist_35',
  'hist_39'],
 (5,): ['hist_2',
  'hist_6',
  'hist_10',
  'hist_14',
  'hist_18',
  'hist_22',
  'hist_26',
  'hist_30',
  'hist_34',
  'hist_38']}
from fmdtools.analyze.tabulate import NestedComparison
nc = NestedComparison(ec_nest, phs, ['inputparams.t'], app_nest, ['fault'], metrics=['tot_deviation', 'end_dist'], default_stat=np.mean, ci_metrics=['end_dist', 'tot_deviation'])
nc
{'tot_deviation': {(1, 'elec_open'): 0.12262736175952531, (1, 'stuck_right'): 0.2026461001180328, (1, 'stuck_left'): 0.22201476928364144, (1, 'stuck'): 0.12262736175952531, (2, 'elec_open'): 0.12896336453474716, (2, 'stuck_right'): 0.21212940954266948, (2, 'stuck_left'): 0.21127788133807784, (2, 'stuck'): 0.12896336453474716, (10, 'elec_open'): 0.21994777909679453, (10, 'stuck_right'): 0.21994777909679453, (10, 'stuck_left'): 0.21994777909679453, (10, 'stuck'): 0.21994777909679453, (5, 'elec_open'): 0.2048176171325177, (5, 'stuck_right'): 0.2048176171325177, (5, 'stuck_left'): 0.2048176171325177, (5, 'stuck'): 0.2048176171325177}, 'end_dist': {(1, 'elec_open'): 26.085343271027362, (1, 'stuck_right'): 25.588455717192563, (1, 'stuck_left'): 24.661299094564765, (1, 'stuck'): 25.99101372511243, (2, 'elec_open'): 26.03998681425502, (2, 'stuck_right'): 25.541116711500614, (2, 'stuck_left'): 24.600504389622348, (2, 'stuck'): 25.94384201363598, (10, 'elec_open'): 27.155010554428685, (10, 'stuck_right'): 27.155010554428685, (10, 'stuck_left'): 27.155010554428685, (10, 'stuck'): 27.155010554428685, (5, 'elec_open'): 26.213811009563567, (5, 'stuck_right'): 26.213811009563567, (5, 'stuck_left'): 26.213811009563567, (5, 'stuck'): 26.213811009563567}, 'end_dist_lb': {(1, 'elec_open'): 26.085343271027362, (1, 'stuck_right'): 25.588455717192563, (1, 'stuck_left'): 24.661299094564765, (1, 'stuck'): 25.99101372511243, (2, 'elec_open'): 26.03998681425502, (2, 'stuck_right'): 25.541116711500614, (2, 'stuck_left'): 24.600504389622348, (2, 'stuck'): 25.94384201363598, (10, 'elec_open'): 27.155010554428685, (10, 'stuck_right'): 27.155010554428685, (10, 'stuck_left'): 27.155010554428685, (10, 'stuck'): 27.155010554428685, (5, 'elec_open'): 26.213811009563567, (5, 'stuck_right'): 26.213811009563567, (5, 'stuck_left'): 26.213811009563567, (5, 'stuck'): 26.213811009563567}, 'tot_deviation_lb': {(1, 'elec_open'): 0.12262736175952531, (1, 'stuck_right'): 0.2026461001180328, (1, 'stuck_left'): 0.22201476928364144, (1, 'stuck'): 0.12262736175952531, (2, 'elec_open'): 0.12896336453474716, (2, 'stuck_right'): 0.21212940954266948, (2, 'stuck_left'): 0.21127788133807784, (2, 'stuck'): 0.12896336453474716, (10, 'elec_open'): 0.21994777909679453, (10, 'stuck_right'): 0.21994777909679453, (10, 'stuck_left'): 0.21994777909679453, (10, 'stuck'): 0.21994777909679453, (5, 'elec_open'): 0.2048176171325177, (5, 'stuck_right'): 0.2048176171325177, (5, 'stuck_left'): 0.2048176171325177, (5, 'stuck'): 0.2048176171325177}, 'end_dist_ub': {(1, 'elec_open'): 26.085343271027362, (1, 'stuck_right'): 25.588455717192563, (1, 'stuck_left'): 24.661299094564765, (1, 'stuck'): 25.99101372511243, (2, 'elec_open'): 26.03998681425502, (2, 'stuck_right'): 25.541116711500614, (2, 'stuck_left'): 24.600504389622348, (2, 'stuck'): 25.94384201363598, (10, 'elec_open'): 27.155010554428685, (10, 'stuck_right'): 27.155010554428685, (10, 'stuck_left'): 27.155010554428685, (10, 'stuck'): 27.155010554428685, (5, 'elec_open'): 26.213811009563567, (5, 'stuck_right'): 26.213811009563567, (5, 'stuck_left'): 26.213811009563567, (5, 'stuck'): 26.213811009563567}, 'tot_deviation_ub': {(1, 'elec_open'): 0.12262736175952531, (1, 'stuck_right'): 0.2026461001180328, (1, 'stuck_left'): 0.22201476928364144, (1, 'stuck'): 0.12262736175952531, (2, 'elec_open'): 0.12896336453474716, (2, 'stuck_right'): 0.21212940954266948, (2, 'stuck_left'): 0.21127788133807784, (2, 'stuck'): 0.12896336453474716, (10, 'elec_open'): 0.21994777909679453, (10, 'stuck_right'): 0.21994777909679453, (10, 'stuck_left'): 0.21994777909679453, (10, 'stuck'): 0.21994777909679453, (5, 'elec_open'): 0.2048176171325177, (5, 'stuck_right'): 0.2048176171325177, (5, 'stuck_left'): 0.2048176171325177, (5, 'stuck'): 0.2048176171325177}}
nc.sort_by_factor("fault")
nc.sort_by_factor("inputparams.t")
fig, ax = nc.as_plots('end_dist', 'tot_deviation', figsize=(8,4))
../../../_images/ae420b72498f4c965b3c49bf98725127ab74631650fef5461bcf0c7e3346cced.png
nc
{'tot_deviation': {(1, 'elec_open'): 0.12262736175952531, (1, 'stuck'): 0.12262736175952531, (1, 'stuck_left'): 0.22201476928364144, (1, 'stuck_right'): 0.2026461001180328, (2, 'elec_open'): 0.12896336453474716, (2, 'stuck'): 0.12896336453474716, (2, 'stuck_left'): 0.21127788133807784, (2, 'stuck_right'): 0.21212940954266948, (5, 'elec_open'): 0.2048176171325177, (5, 'stuck'): 0.2048176171325177, (5, 'stuck_left'): 0.2048176171325177, (5, 'stuck_right'): 0.2048176171325177, (10, 'elec_open'): 0.21994777909679453, (10, 'stuck'): 0.21994777909679453, (10, 'stuck_left'): 0.21994777909679453, (10, 'stuck_right'): 0.21994777909679453}, 'end_dist': {(1, 'elec_open'): 26.085343271027362, (1, 'stuck'): 25.99101372511243, (1, 'stuck_left'): 24.661299094564765, (1, 'stuck_right'): 25.588455717192563, (2, 'elec_open'): 26.03998681425502, (2, 'stuck'): 25.94384201363598, (2, 'stuck_left'): 24.600504389622348, (2, 'stuck_right'): 25.541116711500614, (5, 'elec_open'): 26.213811009563567, (5, 'stuck'): 26.213811009563567, (5, 'stuck_left'): 26.213811009563567, (5, 'stuck_right'): 26.213811009563567, (10, 'elec_open'): 27.155010554428685, (10, 'stuck'): 27.155010554428685, (10, 'stuck_left'): 27.155010554428685, (10, 'stuck_right'): 27.155010554428685}, 'end_dist_lb': {(1, 'elec_open'): 26.085343271027362, (1, 'stuck'): 25.99101372511243, (1, 'stuck_left'): 24.661299094564765, (1, 'stuck_right'): 25.588455717192563, (2, 'elec_open'): 26.03998681425502, (2, 'stuck'): 25.94384201363598, (2, 'stuck_left'): 24.600504389622348, (2, 'stuck_right'): 25.541116711500614, (5, 'elec_open'): 26.213811009563567, (5, 'stuck'): 26.213811009563567, (5, 'stuck_left'): 26.213811009563567, (5, 'stuck_right'): 26.213811009563567, (10, 'elec_open'): 27.155010554428685, (10, 'stuck'): 27.155010554428685, (10, 'stuck_left'): 27.155010554428685, (10, 'stuck_right'): 27.155010554428685}, 'tot_deviation_lb': {(1, 'elec_open'): 0.12262736175952531, (1, 'stuck'): 0.12262736175952531, (1, 'stuck_left'): 0.22201476928364144, (1, 'stuck_right'): 0.2026461001180328, (2, 'elec_open'): 0.12896336453474716, (2, 'stuck'): 0.12896336453474716, (2, 'stuck_left'): 0.21127788133807784, (2, 'stuck_right'): 0.21212940954266948, (5, 'elec_open'): 0.2048176171325177, (5, 'stuck'): 0.2048176171325177, (5, 'stuck_left'): 0.2048176171325177, (5, 'stuck_right'): 0.2048176171325177, (10, 'elec_open'): 0.21994777909679453, (10, 'stuck'): 0.21994777909679453, (10, 'stuck_left'): 0.21994777909679453, (10, 'stuck_right'): 0.21994777909679453}, 'end_dist_ub': {(1, 'elec_open'): 26.085343271027362, (1, 'stuck'): 25.99101372511243, (1, 'stuck_left'): 24.661299094564765, (1, 'stuck_right'): 25.588455717192563, (2, 'elec_open'): 26.03998681425502, (2, 'stuck'): 25.94384201363598, (2, 'stuck_left'): 24.600504389622348, (2, 'stuck_right'): 25.541116711500614, (5, 'elec_open'): 26.213811009563567, (5, 'stuck'): 26.213811009563567, (5, 'stuck_left'): 26.213811009563567, (5, 'stuck_right'): 26.213811009563567, (10, 'elec_open'): 27.155010554428685, (10, 'stuck'): 27.155010554428685, (10, 'stuck_left'): 27.155010554428685, (10, 'stuck_right'): 27.155010554428685}, 'tot_deviation_ub': {(1, 'elec_open'): 0.12262736175952531, (1, 'stuck'): 0.12262736175952531, (1, 'stuck_left'): 0.22201476928364144, (1, 'stuck_right'): 0.2026461001180328, (2, 'elec_open'): 0.12896336453474716, (2, 'stuck'): 0.12896336453474716, (2, 'stuck_left'): 0.21127788133807784, (2, 'stuck_right'): 0.21212940954266948, (5, 'elec_open'): 0.2048176171325177, (5, 'stuck'): 0.2048176171325177, (5, 'stuck_left'): 0.2048176171325177, (5, 'stuck_right'): 0.2048176171325177, (10, 'elec_open'): 0.21994777909679453, (10, 'stuck'): 0.21994777909679453, (10, 'stuck_left'): 0.21994777909679453, (10, 'stuck_right'): 0.21994777909679453}}
# fig.savefig("drive_resilience_degradation.pdf", format="pdf", bbox_inches = 'tight', pad_inches = 0)

As shown, while there is some resilience early in the lifecycle (resulting in a small proportion of faults being recovered), this resilience goes away with degradation.

Human Degradation

We can also perform this assessment for the human error model, which is split up into two parts:

  • long term “degradation” of experience over months

  • short term “degradation” of stress and fatigue over a day

psf_long = PSFDegradationLong()
endresults,  hist_psf_long = prop.nominal(psf_long)
hist_psf_long.plot_line('s.experience')
(<Figure size 300x200 with 1 Axes>,
 [<Axes: title={'center': 's.experience'}, xlabel='time'>])
../../../_images/b0f69fc585c91124ec2073c2279aeded31efcc565928ef99f12115900d1564f8.png
hist_psf_long.plot_line('s.experience')
(<Figure size 300x200 with 1 Axes>,
 [<Axes: title={'center': 's.experience'}, xlabel='time'>])
../../../_images/b0f69fc585c91124ec2073c2279aeded31efcc565928ef99f12115900d1564f8.png
from examples.rover.rover_degradation import LongParams
pd_hl = ParameterDomain(LongParams)
pd_hl.add_variable("experience_param", var_lim=())
pd_hl
ParameterDomain with:
 - variables: {'experience_param': ()}
 - constants: {}
 - parameter_initializer: LongParams
pd_hl(10)
LongParams(experience_param=10.0, training_frequency=8.0, experience_scale_max=10.0)
ps_hl = ParameterSample(pd_hl)
xs = np.random.default_rng(seed=101).gamma(1,1.9,101)
# round so that dist is 0-10
xs = [min(x, 9.9) for x in xs]
weight = 1/len(xs)
for x in xs:
    ps_hl.add_variable_scenario(x, weight=weight)
ps_hl
ParameterSample of scenarios:
 - var_0
 - var_1
 - var_2
 - var_3
 - var_4
 - var_5
 - var_6
 - var_7
 - var_8
 - var_9
 - ... (101 total)
ec_psf_long, hist_psf_long= prop.parameter_sample(psf_long, ps_hl, run_stochastic=True)
SCENARIOS COMPLETE: 100%|██████████| 101/101 [00:00<00:00, 111.47it/s]
hist_psf_long.plot_line('s.experience')
(<Figure size 300x200 with 1 Axes>,
 [<Axes: title={'center': 's.experience'}, xlabel='time'>])
../../../_images/4b3e6bd6e2beb9c0323e408e1de9d2fac1322dab478199cf677cb60994fd5c3c.png
fig, axs = hist_psf_long.plot_metric_dist([0, 40, 50, 60, 100], 's.experience', bins=20, alpha=0.5, figsize=(8,4))
../../../_images/77289aa994cc5eec968fa19e8b663810fb0a71c21c435905f68d1620ef83cae0.png
# fig.savefig("experience_degradation.pdf", format="pdf", bbox_inches = 'tight', pad_inches = 0)

Short-term degradation

psf_short = PSFDegradationShort(sp={'run_stochastic': True})
er, hist_short = prop.nominal(psf_short)
fig, axs = hist_short.plot_line('s.fatigue', 's.stress')
../../../_images/1056e2371e9eb9bbd76b93f4715902ed96639b38854e4f1443984e0763e702a8.png

short-term degradation (over no external params)

ps_psf_short = ParameterSample()
ps_psf_short.add_variable_replicates([], replicates=25)
ps_psf_short.scenarios()
[ParameterScenario(sequence={}, times=(), p={}, r={'seed': 1762722873}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep0_var_0'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 1360301461}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep1_var_1'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 3055921884}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep2_var_2'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 2840778324}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep3_var_3'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 1272187404}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep4_var_4'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 1472482053}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep5_var_5'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 4078154410}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep6_var_6'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 1896735643}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep7_var_7'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 1153105458}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep8_var_8'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 2315090172}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep9_var_9'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 3042382574}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep10_var_10'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 1430382375}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep11_var_11'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 3259468799}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep12_var_12'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 3499482964}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep13_var_13'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 3091513149}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep14_var_14'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 2352338883}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep15_var_15'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 2283916105}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep16_var_16'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 1529838382}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep17_var_17'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 1304081347}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep18_var_18'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 4023875089}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep19_var_19'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 3179524763}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep20_var_20'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 746822850}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep21_var_21'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 3677701388}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep22_var_22'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 4168311077}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep23_var_23'),
 ParameterScenario(sequence={}, times=(), p={}, r={'seed': 1820563019}, sp={}, prob=0.04, inputparams={}, rangeid='', name='rep24_var_24')]
ec_psf_short, hist_psf_short = prop.parameter_sample(psf_short, ps_psf_short, run_stochastic=True)
fig, axs = hist_psf_short.plot_line('s.fatigue', 's.stress', 'r.s.fatigue_param', aggregation="percentile")
SCENARIOS COMPLETE: 100%|██████████| 25/25 [00:00<00:00, 373.42it/s]
../../../_images/55d054a9d6cc6d5fbcc2df24848b1de69c6eb7ed29812cd8387e80c0c32b8d2a.png

short-term degradation over long-term params

from examples.rover.rover_degradation import PSFShortParams
pd_short_long = ParameterDomain(PSFShortParams)
pd_short_long.add_variable("experience")
ps_short_long = ParameterHistSample(hist_psf_long, 's.experience', paramdomain=pd_short_long)
ps_short_long.add_hist_groups(reps= 10, ts = [0, 40, 50, 60, 100])

# note - need to add a way to combine replicates (seeds) over replicates (input times/groups/)
pd_short_long(10)
PSFShortParams(experience=10.0, stress_param=0.0, fatigue_param=1.0)
ps_short_long.scenarios()
[ParameterScenario(sequence={}, times=(), p={'experience': 1.0}, r={'seed': 4259381284}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_0', 't': 0}, rangeid='', name='hist_0'),
 ParameterScenario(sequence={}, times=(), p={'experience': 4.752119769698699}, r={'seed': 4259381284}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_0', 't': 40}, rangeid='', name='hist_1'),
 ParameterScenario(sequence={}, times=(), p={'experience': 8.176887775289359}, r={'seed': 4259381284}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_0', 't': 50}, rangeid='', name='hist_2'),
 ParameterScenario(sequence={}, times=(), p={'experience': 9.569243536865427}, r={'seed': 4259381284}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_0', 't': 60}, rangeid='', name='hist_3'),
 ParameterScenario(sequence={}, times=(), p={'experience': 9.999252111200697}, r={'seed': 4259381284}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_0', 't': 100}, rangeid='', name='hist_4'),
 ParameterScenario(sequence={}, times=(), p={'experience': 1.0}, r={'seed': 2431478980}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_1', 't': 0}, rangeid='', name='hist_5'),
 ParameterScenario(sequence={}, times=(), p={'experience': 1.8487832098989943}, r={'seed': 2431478980}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_1', 't': 40}, rangeid='', name='hist_6'),
 ParameterScenario(sequence={}, times=(), p={'experience': 5.290573423066754}, r={'seed': 2431478980}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_1', 't': 50}, rangeid='', name='hist_7'),
 ParameterScenario(sequence={}, times=(), p={'experience': 8.476594493466402}, r={'seed': 2431478980}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_1', 't': 60}, rangeid='', name='hist_8'),
 ParameterScenario(sequence={}, times=(), p={'experience': 9.997014756493453}, r={'seed': 2431478980}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_1', 't': 100}, rangeid='', name='hist_9'),
 ParameterScenario(sequence={}, times=(), p={'experience': 1.0}, r={'seed': 2021687991}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_2', 't': 0}, rangeid='', name='hist_10'),
 ParameterScenario(sequence={}, times=(), p={'experience': 1.9790063131755202}, r={'seed': 2021687991}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_2', 't': 40}, rangeid='', name='hist_11'),
 ParameterScenario(sequence={}, times=(), p={'experience': 5.499658066323243}, r={'seed': 2021687991}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_2', 't': 50}, rangeid='', name='hist_12'),
 ParameterScenario(sequence={}, times=(), p={'experience': 8.582137486488802}, r={'seed': 2021687991}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_2', 't': 60}, rangeid='', name='hist_13'),
 ParameterScenario(sequence={}, times=(), p={'experience': 9.997255679890868}, r={'seed': 2021687991}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_2', 't': 100}, rangeid='', name='hist_14'),
 ParameterScenario(sequence={}, times=(), p={'experience': 1.0}, r={'seed': 1433117823}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_3', 't': 0}, rangeid='', name='hist_15'),
 ParameterScenario(sequence={}, times=(), p={'experience': 2.0075750360910303}, r={'seed': 1433117823}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_3', 't': 40}, rangeid='', name='hist_16'),
 ParameterScenario(sequence={}, times=(), p={'experience': 5.543922357862813}, r={'seed': 1433117823}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_3', 't': 50}, rangeid='', name='hist_17'),
 ParameterScenario(sequence={}, times=(), p={'experience': 8.603780329023392}, r={'seed': 1433117823}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_3', 't': 60}, rangeid='', name='hist_18'),
 ParameterScenario(sequence={}, times=(), p={'experience': 9.997304355180853}, r={'seed': 1433117823}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_3', 't': 100}, rangeid='', name='hist_19'),
 ParameterScenario(sequence={}, times=(), p={'experience': 1.0}, r={'seed': 3088078357}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_4', 't': 0}, rangeid='', name='hist_20'),
 ParameterScenario(sequence={}, times=(), p={'experience': 1.8688998953097031}, r={'seed': 3088078357}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_4', 't': 40}, rangeid='', name='hist_21'),
 ParameterScenario(sequence={}, times=(), p={'experience': 5.323681045915271}, r={'seed': 3088078357}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_4', 't': 50}, rangeid='', name='hist_22'),
 ParameterScenario(sequence={}, times=(), p={'experience': 8.493681241699779}, r={'seed': 3088078357}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_4', 't': 60}, rangeid='', name='hist_23'),
 ParameterScenario(sequence={}, times=(), p={'experience': 9.997054165886697}, r={'seed': 3088078357}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_4', 't': 100}, rangeid='', name='hist_24'),
 ParameterScenario(sequence={}, times=(), p={'experience': 1.0}, r={'seed': 3498011446}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_5', 't': 0}, rangeid='', name='hist_25'),
 ParameterScenario(sequence={}, times=(), p={'experience': 1.787448965919563}, r={'seed': 3498011446}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_5', 't': 40}, rangeid='', name='hist_26'),
 ParameterScenario(sequence={}, times=(), p={'experience': 5.187726332671329}, r={'seed': 3498011446}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_5', 't': 50}, rangeid='', name='hist_27'),
 ParameterScenario(sequence={}, times=(), p={'experience': 8.422580336173807}, r={'seed': 3498011446}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_5', 't': 60}, rangeid='', name='hist_28'),
 ParameterScenario(sequence={}, times=(), p={'experience': 9.996889127014224}, r={'seed': 3498011446}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_5', 't': 100}, rangeid='', name='hist_29'),
 ParameterScenario(sequence={}, times=(), p={'experience': 1.0}, r={'seed': 1865609061}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_6', 't': 0}, rangeid='', name='hist_30'),
 ParameterScenario(sequence={}, times=(), p={'experience': 2.9513397960633663}, r={'seed': 1865609061}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_6', 't': 40}, rangeid='', name='hist_31'),
 ParameterScenario(sequence={}, times=(), p={'experience': 6.746783511124642}, r={'seed': 1865609061}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_6', 't': 50}, rangeid='', name='hist_32'),
 ParameterScenario(sequence={}, times=(), p={'experience': 9.11284593483782}, r={'seed': 1865609061}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_6', 't': 60}, rangeid='', name='hist_33'),
 ParameterScenario(sequence={}, times=(), p={'experience': 9.998382701846468}, r={'seed': 1865609061}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_6', 't': 100}, rangeid='', name='hist_34'),
 ParameterScenario(sequence={}, times=(), p={'experience': 1.0}, r={'seed': 458521712}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_7', 't': 0}, rangeid='', name='hist_35'),
 ParameterScenario(sequence={}, times=(), p={'experience': 1.8635297419250887}, r={'seed': 458521712}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_7', 't': 40}, rangeid='', name='hist_36'),
 ParameterScenario(sequence={}, times=(), p={'experience': 5.314872625395507}, r={'seed': 458521712}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_7', 't': 50}, rangeid='', name='hist_37'),
 ParameterScenario(sequence={}, times=(), p={'experience': 8.489149322988858}, r={'seed': 458521712}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_7', 't': 60}, rangeid='', name='hist_38'),
 ParameterScenario(sequence={}, times=(), p={'experience': 9.99704372876054}, r={'seed': 458521712}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_7', 't': 100}, rangeid='', name='hist_39'),
 ParameterScenario(sequence={}, times=(), p={'experience': 1.0}, r={'seed': 2160131781}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_8', 't': 0}, rangeid='', name='hist_40'),
 ParameterScenario(sequence={}, times=(), p={'experience': 4.713167988600875}, r={'seed': 2160131781}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_8', 't': 40}, rangeid='', name='hist_41'),
 ParameterScenario(sequence={}, times=(), p={'experience': 8.153478561734518}, r={'seed': 2160131781}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_8', 't': 50}, rangeid='', name='hist_42'),
 ParameterScenario(sequence={}, times=(), p={'experience': 9.56275651462149}, r={'seed': 2160131781}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_8', 't': 60}, rangeid='', name='hist_43'),
 ParameterScenario(sequence={}, times=(), p={'experience': 9.99924033420483}, r={'seed': 2160131781}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_8', 't': 100}, rangeid='', name='hist_44'),
 ParameterScenario(sequence={}, times=(), p={'experience': 1.0}, r={'seed': 3802610446}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_9', 't': 0}, rangeid='', name='hist_45'),
 ParameterScenario(sequence={}, times=(), p={'experience': 1.9334129001479297}, r={'seed': 3802610446}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_9', 't': 40}, rangeid='', name='hist_46'),
 ParameterScenario(sequence={}, times=(), p={'experience': 5.427841932470725}, r={'seed': 3802610446}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_9', 't': 50}, rangeid='', name='hist_47'),
 ParameterScenario(sequence={}, times=(), p={'experience': 8.54651105720937}, r={'seed': 3802610446}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_9', 't': 60}, rangeid='', name='hist_48'),
 ParameterScenario(sequence={}, times=(), p={'experience': 9.997175019303434}, r={'seed': 3802610446}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'var_9', 't': 100}, rangeid='', name='hist_49')]
ec, hist_short_long = prop.parameter_sample(psf_short, ps_short_long, run_stochastic=True)
SCENARIOS COMPLETE: 100%|██████████| 50/50 [00:00<00:00, 403.26it/s]
fig, axs = hist_short_long.plot_line('s.fatigue', 's.stress', 'r.s.fatigue_param', aggregation="percentile")
../../../_images/0e44cfb72dc274f6862ea6d62477b2bd2ab4236f8ea193309f4c63d0291313c7.png
# fig.savefig("stress_degradation.pdf", format="pdf", bbox_inches = 'tight', pad_inches = 0)

Now sample in the model:

from examples.rover.rover_model_human import RoverHuman, RoverHumanParam
pd_comb_mdl = ParameterDomain(RoverHumanParam)
# pd_comb_mdl.add_constant('drive_modes', {"mode_options": "manual"})
pd_comb_mdl.add_variable("psfs.fatigue")
pd_comb_mdl.add_variables("psfs.stress")
pd_comb_mdl(1,1)
RoverHumanParam(ground=GroundParam(linetype='sine', amp=1.0, period=6.283185307179586, radius=20.0, x_start=10.0, y_end=10.0, x_min=0.0, x_max=30.0, x_res=0.1, path_buffer_on=0.2, path_buffer_poor=0.3, path_buffer_near=0.4, dest_buffer_on=1.0, dest_buffer_near=2.0), correction=ResCorrection(ub_f=10.0, lb_f=-1.0, ub_t=10.0, lb_t=0.0, ub_d=2.0, lb_d=-2.0, cor_d=0.0, cor_t=0.0, cor_f=0.0), degradation=DegParam(friction=0.0, drift=0.0), drive_modes={'mode_options': 'set'}, psfs=PSFParam(fatigue=1.0, stress=1.0))
ps_comb_mdl = ParameterHistSample(hist_short_long, "s.fatigue", "s.stress", paramdomain=pd_comb_mdl)
ps_comb_mdl.add_hist_groups(reps= 10, ts = [0, 1, 3, 5, 6, 8])
ps_comb_mdl.scenarios()
[ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 0.0, 'stress': 0.0}}, r={'seed': 2815633213}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_0', 't': 0}, rangeid='', name='hist_0'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 2.699887197589733, 'stress': 2.0}}, r={'seed': 2815633213}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_0', 't': 1}, rangeid='', name='hist_1'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 6.458182201641172, 'stress': 14.0}}, r={'seed': 2815633213}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_0', 't': 3}, rangeid='', name='hist_2'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.1566303235265, 'stress': 62.0}}, r={'seed': 2815633213}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_0', 't': 5}, rangeid='', name='hist_3'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.620231221312247, 'stress': 100.0}}, r={'seed': 2815633213}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_0', 't': 6}, rangeid='', name='hist_4'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 10.0, 'stress': 100.0}}, r={'seed': 2815633213}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_0', 't': 8}, rangeid='', name='hist_5'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 0.0, 'stress': 0.0}}, r={'seed': 327432012}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_1', 't': 0}, rangeid='', name='hist_6'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 2.699887197589733, 'stress': 1.0}}, r={'seed': 327432012}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_1', 't': 1}, rangeid='', name='hist_7'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 6.458182201641172, 'stress': 3.0}}, r={'seed': 327432012}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_1', 't': 3}, rangeid='', name='hist_8'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.1566303235265, 'stress': 7.0}}, r={'seed': 327432012}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_1', 't': 5}, rangeid='', name='hist_9'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.620231221312247, 'stress': 10.0}}, r={'seed': 327432012}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_1', 't': 6}, rangeid='', name='hist_10'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 10.0, 'stress': 17.0}}, r={'seed': 327432012}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_1', 't': 8}, rangeid='', name='hist_11'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 0.0, 'stress': 0.0}}, r={'seed': 3210912978}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_2', 't': 0}, rangeid='', name='hist_12'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 2.699887197589733, 'stress': 1.0}}, r={'seed': 3210912978}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_2', 't': 1}, rangeid='', name='hist_13'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 6.458182201641172, 'stress': 3.0}}, r={'seed': 3210912978}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_2', 't': 3}, rangeid='', name='hist_14'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.1566303235265, 'stress': 5.0}}, r={'seed': 3210912978}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_2', 't': 5}, rangeid='', name='hist_15'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.620231221312247, 'stress': 6.0}}, r={'seed': 3210912978}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_2', 't': 6}, rangeid='', name='hist_16'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 10.0, 'stress': 10.0}}, r={'seed': 3210912978}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_2', 't': 8}, rangeid='', name='hist_17'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 0.0, 'stress': 0.0}}, r={'seed': 3839925038}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_3', 't': 0}, rangeid='', name='hist_18'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 2.699887197589733, 'stress': 1.0}}, r={'seed': 3839925038}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_3', 't': 1}, rangeid='', name='hist_19'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 6.458182201641172, 'stress': 3.0}}, r={'seed': 3839925038}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_3', 't': 3}, rangeid='', name='hist_20'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.1566303235265, 'stress': 5.0}}, r={'seed': 3839925038}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_3', 't': 5}, rangeid='', name='hist_21'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.620231221312247, 'stress': 6.0}}, r={'seed': 3839925038}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_3', 't': 6}, rangeid='', name='hist_22'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 10.0, 'stress': 10.0}}, r={'seed': 3839925038}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_3', 't': 8}, rangeid='', name='hist_23'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 0.0, 'stress': 0.0}}, r={'seed': 557787297}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_4', 't': 0}, rangeid='', name='hist_24'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 2.699887197589733, 'stress': 1.0}}, r={'seed': 557787297}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_4', 't': 1}, rangeid='', name='hist_25'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 6.458182201641172, 'stress': 3.0}}, r={'seed': 557787297}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_4', 't': 3}, rangeid='', name='hist_26'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.1566303235265, 'stress': 5.0}}, r={'seed': 557787297}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_4', 't': 5}, rangeid='', name='hist_27'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.620231221312247, 'stress': 6.0}}, r={'seed': 557787297}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_4', 't': 6}, rangeid='', name='hist_28'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 10.0, 'stress': 9.0}}, r={'seed': 557787297}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_4', 't': 8}, rangeid='', name='hist_29'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 0.0, 'stress': 0.0}}, r={'seed': 3836275152}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_5', 't': 0}, rangeid='', name='hist_30'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 2.521563435853052, 'stress': 2.0}}, r={'seed': 3836275152}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_5', 't': 1}, rangeid='', name='hist_31'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 6.633874217122714, 'stress': 14.0}}, r={'seed': 3836275152}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_5', 't': 3}, rangeid='', name='hist_32'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.732439125600926, 'stress': 62.0}}, r={'seed': 3836275152}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_5', 't': 5}, rangeid='', name='hist_33'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.990654189187206, 'stress': 100.0}}, r={'seed': 3836275152}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_5', 't': 6}, rangeid='', name='hist_34'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 10.0, 'stress': 100.0}}, r={'seed': 3836275152}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_5', 't': 8}, rangeid='', name='hist_35'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 0.0, 'stress': 0.0}}, r={'seed': 2507726744}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_6', 't': 0}, rangeid='', name='hist_36'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 2.521563435853052, 'stress': 1.0}}, r={'seed': 2507726744}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_6', 't': 1}, rangeid='', name='hist_37'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 6.633874217122714, 'stress': 6.0}}, r={'seed': 2507726744}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_6', 't': 3}, rangeid='', name='hist_38'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.732439125600926, 'stress': 19.0}}, r={'seed': 2507726744}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_6', 't': 5}, rangeid='', name='hist_39'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.990654189187206, 'stress': 32.0}}, r={'seed': 2507726744}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_6', 't': 6}, rangeid='', name='hist_40'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 10.0, 'stress': 83.0}}, r={'seed': 2507726744}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_6', 't': 8}, rangeid='', name='hist_41'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 0.0, 'stress': 0.0}}, r={'seed': 1443908462}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_7', 't': 0}, rangeid='', name='hist_42'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 2.521563435853052, 'stress': 1.0}}, r={'seed': 1443908462}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_7', 't': 1}, rangeid='', name='hist_43'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 6.633874217122714, 'stress': 3.0}}, r={'seed': 1443908462}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_7', 't': 3}, rangeid='', name='hist_44'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.732439125600926, 'stress': 6.0}}, r={'seed': 1443908462}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_7', 't': 5}, rangeid='', name='hist_45'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.990654189187206, 'stress': 8.0}}, r={'seed': 1443908462}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_7', 't': 6}, rangeid='', name='hist_46'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 10.0, 'stress': 14.0}}, r={'seed': 1443908462}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_7', 't': 8}, rangeid='', name='hist_47'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 0.0, 'stress': 0.0}}, r={'seed': 3076986921}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_8', 't': 0}, rangeid='', name='hist_48'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 2.521563435853052, 'stress': 1.0}}, r={'seed': 3076986921}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_8', 't': 1}, rangeid='', name='hist_49'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 6.633874217122714, 'stress': 3.0}}, r={'seed': 3076986921}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_8', 't': 3}, rangeid='', name='hist_50'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.732439125600926, 'stress': 5.0}}, r={'seed': 3076986921}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_8', 't': 5}, rangeid='', name='hist_51'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.990654189187206, 'stress': 6.0}}, r={'seed': 3076986921}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_8', 't': 6}, rangeid='', name='hist_52'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 10.0, 'stress': 10.0}}, r={'seed': 3076986921}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_8', 't': 8}, rangeid='', name='hist_53'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 0.0, 'stress': 0.0}}, r={'seed': 3808618538}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_9', 't': 0}, rangeid='', name='hist_54'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 2.521563435853052, 'stress': 1.0}}, r={'seed': 3808618538}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_9', 't': 1}, rangeid='', name='hist_55'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 6.633874217122714, 'stress': 3.0}}, r={'seed': 3808618538}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_9', 't': 3}, rangeid='', name='hist_56'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.732439125600926, 'stress': 5.0}}, r={'seed': 3808618538}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_9', 't': 5}, rangeid='', name='hist_57'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 9.990654189187206, 'stress': 6.0}}, r={'seed': 3808618538}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_9', 't': 6}, rangeid='', name='hist_58'),
 ParameterScenario(sequence={}, times=(), p={'psfs': {'fatigue': 10.0, 'stress': 9.0}}, r={'seed': 3808618538}, sp={}, prob=1.0, inputparams={'comp_group': 'default', 'rep': 'hist_9', 't': 8}, rangeid='', name='hist_59')]
mdl_hum = RoverHuman()
ec, hist = prop.nominal(mdl_hum)
plot_map(mdl_hum, hist)
ec
tend.classify.rate:                  1.0
tend.classify.cost:                    0
tend.classify.prob:                  1.0
tend.classify.expected_cost:           0
tend.classify.in_bound:             True
tend.classify.at_finish:           False
tend.classify.line_dist:               1
tend.classify.num_modes:               0
tend.classify.end_dist: 28.91724385770989
tend.classify.tot_deviation:         0.0
tend.classify.faults:           array(0)
tend.classify.classification: incomplete mission
tend.classify.end_x:                 0.0
tend.classify.end_y:                 0.0
tend.classify.endpt:            array(2)
../../../_images/7f15243123d7a8edcf52d85ee1594900a76559e433b6704f5d124fd7f4bbdcd9.png
ec_comb, hist_comb = prop.parameter_sample(mdl_hum, ps_comb_mdl)
SCENARIOS COMPLETE: 100%|██████████| 60/60 [01:18<00:00,  1.30s/it]
fig, ax = plot_map(mdl_hum, hist_comb)
../../../_images/28fa55172c9f77dfec2a7cc328de988bff580324e6fe45874bf0f39c91772807.png
hist_comb.plot_line('flows.psfs.s.attention', 'flows.motor_control.s.rpower', 'flows.motor_control.s.lpower')
(<Figure size 600x400 with 4 Axes>,
 array([<Axes: title={'center': 'flows.psfs.s.attention'}, xlabel=' '>,
        <Axes: title={'center': 'flows.motor_control.s.rpower'}, xlabel='time'>,
        <Axes: title={'center': 'flows.motor_control.s.lpower'}, xlabel='time'>,
        <Axes: >], dtype=object))
../../../_images/d98df8d35fb0d37235a8cce2dbb3b93e842dbf700bf827d497b4ed2355efbb02.png
ne = NominalEnvelope(ps_comb_mdl, ec_comb, 'at_finish',
                     'p.psfs.fatigue', 'p.psfs.stress',
                     func=lambda x: x == True)
ne.plot_scatter()
(<Figure size 600x400 with 1 Axes>,
 <Axes: xlabel='p.psfs.fatigue', ylabel='p.psfs.stress'>)
../../../_images/b165abe0a2baf83a0fccfe7bf13fb1795d0cc0f55429874a0ba09fd1edd9ca09.png

(note, this is different in the turn case because of the long straightaway)

mdl_hum = RoverHuman(p={'ground': {'linetype': 'turn'}})
ec, hist = prop.nominal(mdl_hum)
plot_map(mdl_hum, hist)
ec
tend.classify.rate:                  1.0
tend.classify.cost:                    0
tend.classify.prob:                  1.0
tend.classify.expected_cost:           0
tend.classify.in_bound:             True
tend.classify.at_finish:           False
tend.classify.line_dist:               1
tend.classify.num_modes:               0
tend.classify.end_dist: 33.902431650021136
tend.classify.tot_deviation:         0.0
tend.classify.faults:           array(0)
tend.classify.classification: incomplete mission
tend.classify.end_x:                 0.0
tend.classify.end_y:                 0.0
tend.classify.endpt:            array(2)
../../../_images/679c951c4f1931a70f8448bc2b306a63869beadaf72504c0c561ba34eb31a542.png
ec_comb, hist_comb = prop.parameter_sample(mdl_hum, ps_comb_mdl)
SCENARIOS COMPLETE: 100%|██████████| 60/60 [01:19<00:00,  1.32s/it]
fig, ax = plot_map(mdl_hum, hist_comb)
../../../_images/cf324a5da2f2d98648dc107243bcbf3e9785ded826af9243902a3ce378f986e3.png
hist_comb.plot_line('flows.psfs.s.attention', 'flows.motor_control.s.rpower', 'flows.motor_control.s.lpower')
(<Figure size 600x400 with 4 Axes>,
 array([<Axes: title={'center': 'flows.psfs.s.attention'}, xlabel=' '>,
        <Axes: title={'center': 'flows.motor_control.s.rpower'}, xlabel='time'>,
        <Axes: title={'center': 'flows.motor_control.s.lpower'}, xlabel='time'>,
        <Axes: >], dtype=object))
../../../_images/d98df8d35fb0d37235a8cce2dbb3b93e842dbf700bf827d497b4ed2355efbb02.png
ne = NominalEnvelope(ps_comb_mdl, ec_comb, 'at_finish',
                     'p.psfs.fatigue', 'p.psfs.stress',
                     func=lambda x: x == True)
ne.plot_scatter()
(<Figure size 600x400 with 1 Axes>,
 <Axes: xlabel='p.psfs.fatigue', ylabel='p.psfs.stress'>)
../../../_images/b165abe0a2baf83a0fccfe7bf13fb1795d0cc0f55429874a0ba09fd1edd9ca09.png

We can thus see how degradation time effects this:

ne = NominalEnvelope(ps_comb_mdl, ec_comb, 'at_finish',
                     'inputparams.t', 'inputparams.rep',
                     func=lambda x: x == True)
ne.plot_scatter()
(<Figure size 600x400 with 1 Axes>,
 <Axes: xlabel='inputparams.t', ylabel='inputparams.rep'>)
../../../_images/7287a7626baceacfa3a0ac30be6635070207fbff35c88e65a19616332903a7a5.png

To re-implement:

  • Need to be able to jointly plot/tabulate by single-day time + multi-day time

  • Combining approaches?

As for the human resilience:

ec_nest, hist_nest, app_nest = prop.nested_sample(mdl, phs, faultdomains=fd, faultsamples=fs, pool=mp.Pool(5))
SCENARIOS COMPLETE: 100%|██████████| 40/40 [00:08<00:00,  4.86it/s]
nc = NestedComparison(ec_nest, phs, ['inputparams.t'], app_nest, ['fault'], metrics=['tot_deviation', 'end_dist'], default_stat=np.mean, ci_metrics=['end_dist', 'tot_deviation'])
nc.sort_by_factor("fault")
nc.sort_by_factor("inputparams.t")
fig, ax = nc.as_plots('end_dist', 'tot_deviation', figsize=(8,4))
../../../_images/ae420b72498f4c965b3c49bf98725127ab74631650fef5461bcf0c7e3346cced.png
# fig.savefig("human_resilience_degradation.pdf", format="pdf", bbox_inches = 'tight', pad_inches = 0)

Combined Degradation

Idea: make same resilience plots as before but with degradation of resilience to drive faults at 0, 4, and 8 hours of fatigue.

Need method of doing this:

  • take params for one and replace with the other (kind of hacky and requires independence)

  • create composite of both? (how do you determine the merge between output params?)

  • use a combined method with both histories as input and sample over t_life and t_day (use this one)

Resilience assessment