"""CHEM128 finite-source tribology, exact path work and differential sensing.""" from pathlib import Path import copy,json,math,importlib.util import numpy as np PROTOCOL_VERSION='1.0.0';SLUG='antonpaar_trb';CATALOG_ID='CHEM-128';ASSET_TYPE_ID='instrument.'+SLUG ROOT=Path(__file__).resolve().parents[2];ASSET=ROOT/'assets/expansion_batch04/t1_thermal'/SLUG DT=.1;G=9.80665;OMEGA_MIN=.2*2*math.pi/60;OMEGA_MAX=2000*2*math.pi/60;TORQUE_MAX=.45;FRICTION_MAX=20. class ActionRejected(ValueError):pass def number(unit='1',lo=None,hi=None): s={'type':'number','x-unit':unit} if lo is not None:s['minimum']=lo if hi is not None:s['maximum']=hi return s def integer(lo=0,hi=1000000):return dict(type='integer',minimum=lo,maximum=hi,**{'x-unit':'1'}) def obj(properties):return dict(type='object',properties=properties,required=list(properties),additionalProperties=False) def array(items,minimum=0,maximum=10000):return dict(type='array',items=items,minItems=minimum,maxItems=maximum) def enum(items):return dict(type='string',enum=list(items)) def nullable(s):return {'anyOf':[s,{'type':'null'}]} BOOL={'type':'boolean'};TEXT={'type':'string'};PHASE=enum(['idle','running','succeeded','failed','cancelled']) def validate(s,v): if 'anyOf' in s: for option in s['anyOf']: try:validate(option,v);return except ActionRejected:pass raise ActionRejected('INVALID_ARGUMENT') kind=s.get('type') if kind in ('number','integer'): if isinstance(v,bool) or not isinstance(v,(int,float)) or not math.isfinite(v) or kind=='integer' and type(v) is not int or not s.get('minimum',-math.inf)<=v<=s.get('maximum',math.inf):raise ActionRejected('INVALID_ARGUMENT') elif kind=='boolean' and type(v) is not bool:raise ActionRejected('INVALID_ARGUMENT') elif kind=='string' and not isinstance(v,str):raise ActionRejected('INVALID_ARGUMENT') elif kind=='null' and v is not None:raise ActionRejected('INVALID_ARGUMENT') elif kind=='object': if not isinstance(v,dict) or set(v)!=set(s['properties']):raise ActionRejected('INVALID_ARGUMENT') for key,value in v.items():validate(s['properties'][key],value) elif kind=='array': if not isinstance(v,list) or not s.get('minItems',0)<=len(v)<=s.get('maxItems',math.inf):raise ActionRejected('INVALID_ARGUMENT') for value in v:validate(s['items'],value) if 'enum' in s and v not in s['enum']:raise ActionRejected('INVALID_ARGUMENT') def library(): p=ASSET/'tribology_library.json';return json.loads(p.read_text()) if p.exists() else {'substances':{}} def sine_variation(phase): """Exact integral0..phase |cos(u)|du for phase>=0, including arbitrary reversals.""" n=math.floor(phase/math.pi);r=phase-n*math.pi;return 2*n+(math.sin(r) if r<=math.pi/2 else 2-math.sin(r)) def motion(drive,radius,t): mode=drive['mode'] if mode=='rotary':return dict(angle_rad=drive['angular_speed_rad_s']*t,position_m=0.,signed_speed_m_s=radius*drive['angular_speed_rad_s'],distance_m=radius*drive['angular_speed_rad_s']*t) phase=2*math.pi*drive['frequency_hz']*t if mode=='linear':amplitude=drive['stroke_m']/2;return dict(angle_rad=0.,position_m=amplitude*math.sin(phase),signed_speed_m_s=amplitude*2*math.pi*drive['frequency_hz']*math.cos(phase),distance_m=amplitude*sine_variation(phase)) amplitude=drive['angular_amplitude_rad'];return dict(angle_rad=amplitude*math.sin(phase),position_m=0.,signed_speed_m_s=radius*amplitude*2*math.pi*drive['frequency_hz']*math.cos(phase),distance_m=radius*amplitude*sine_variation(phase)) SCALAR_BASIS='scalar_mean_friction';SPEED_BASIS='scalar_speed_series_friction';SCALAR_BASES=(SCALAR_BASIS,SPEED_BASIS) UNBOUNDED_DOMAIN_M=1e9 SCALAR_EVIDENCE='Published scalar friction coefficient of this material pair (mean as defined by the source: steady-state or test-duration average; speed-series values interpolated in log(speed) between source speeds) replayed as a CONSTANT mu over the source sliding-distance domain. No running-in transient, stick-slip, fluctuation or wear-driven drift is represented; this is not a measured friction curve. Source specific wear rates (if any) are reference data only; wear uses the declared Archard inputs.' def scalar_curve(reference,speed_m_s=None,accept_unknown=True,accept_transfer=True): """Constant-mu reference from a published scalar; returns (x,mu,info).""" try:rs=reference['runtime_scalars'] except (KeyError,TypeError):raise ActionRejected('INVALID_REFERENCE') if not reference.get('runtime_usable') or reference.get('runtime_basis') not in SCALAR_BASES or not isinstance(rs,dict):raise ActionRejected('INVALID_REFERENCE') domain=rs.get('sliding_distance_domain_m');info=dict(basis=reference['runtime_basis'],domain_known=domain is not None,speed_clamped=False) if domain is None: if not accept_unknown:raise ActionRejected('UNKNOWN_REFERENCE_CONDITIONS') domain=UNBOUNDED_DOMAIN_M if isinstance(domain,bool) or not isinstance(domain,(int,float)) or not math.isfinite(domain) or domain<=0:raise ActionRejected('INVALID_REFERENCE') if reference['runtime_basis']==SCALAR_BASIS:mu=rs.get('friction_coefficient') else: try:v=np.asarray(rs['speeds_m_s'],float);m=np.asarray(rs['friction_coefficients'],float) except (KeyError,TypeError,ValueError):raise ActionRejected('INVALID_REFERENCE') if v.ndim!=1 or v.shape!=m.shape or len(v)<2 or np.any(~np.isfinite(v)) or np.any(v<=0) or np.any(np.diff(v)<=0) or np.any(~np.isfinite(m)):raise ActionRejected('INVALID_REFERENCE') s=float(v[0]) if speed_m_s is None else float(speed_m_s) if s<=0:raise ActionRejected('REFERENCE_CONDITIONS') if not v[0]*(1-1e-9)<=s<=v[-1]*(1+1e-9): if not accept_transfer:raise ActionRejected('REFERENCE_CONDITIONS') info['speed_clamped']=True s=min(max(s,float(v[0])),float(v[-1]));mu=float(np.interp(math.log(s),np.log(v),m));info['speed_m_s']=s if isinstance(mu,bool) or not isinstance(mu,(int,float)) or not math.isfinite(mu) or not 0<=mu<=2:raise ActionRejected('INVALID_REFERENCE') info['friction_coefficient']=float(mu) return np.array([0.,float(domain)]),np.array([float(mu),float(mu)]),info def curve(reference,accept_unknown=True): if isinstance(reference,dict) and reference.get('runtime_basis') in SCALAR_BASES: x,mu,_=scalar_curve(reference,None,accept_unknown,True);return x,mu try:x=np.asarray(reference['values']['sliding_distance_m'],float);mu=np.asarray(reference['values']['friction_coefficient'],float) except (KeyError,TypeError,ValueError):raise ActionRejected('INVALID_REFERENCE') if not reference.get('runtime_usable') or len(x)<2 or x.shape!=mu.shape or np.any(~np.isfinite(x)) or np.any(~np.isfinite(mu)) or np.any(np.diff(x)<=0) or x[0]<0 or np.any(mu<0):raise ActionRejected('INVALID_REFERENCE') return x,mu def source_mu(reference,distance_m): x,mu=curve(reference) if distance_mx[-1]+1e-12:raise ActionRejected('REFERENCE_DISTANCE_RANGE') return float(np.interp(distance_m,x,mu)) def source_integral(reference,start_m,end_m): x,mu=curve(reference) if start_mx[-1]+1e-12 or end_mstart_m)&(x=0:loss+=v else:pile-=v return dict(loss_volume_m3=float(loss),pileup_volume_m3=float(pile),net_volume_m3=float(loss-pile),evidence='External user-supplied profile inputs and explicit uniform-track assumption. Baseline must be independently supplied; deficit and pile-up are integrated separately with exact zero crossings. Circular volume retains radial2pi(r+x) weight. Net signed volume can be negative; no automatic claim of true material loss.') def hertz_analysis(a): if not a['accept_elastic_homogeneous']:raise ActionRejected('MODEL_NOT_ACCEPTED') e=1/((1-a['poisson_sample']**2)/a['young_sample_pa']+(1-a['poisson_pin']**2)/a['young_pin_pa']);r=(3*a['normal_force_n']*a['radius_m']/(4*e))**(1/3) if r/a['radius_m']>.1:raise ActionRejected('HERTZ_MODEL_DOMAIN') return dict(effective_modulus_pa=e,contact_radius_m=r,indentation_m=r*r/a['radius_m'],peak_pressure_pa=3*a['normal_force_n']/(2*math.pi*r*r),evidence='Homogeneous nonadhesive elastic sphere-flat Hertz approximation; not a layered coating, plasticity or roughness solution.') class AntonpaarTrbRuntime: def __init__(self,instance_id='trb_01'): self.instance_id=instance_id;self.plant=None;self.specimen=None;self.pin=None;self.lubricant=None;self.reference=None;self.ref_x=np.array([]);self.ref_mu=np.array([]);self.specimen_volume=0.;self.pin_volume=0.;self.lubricant_volume=0.;self.specimen_loaded=0.;self.pin_loaded=0.;self.lubricant_loaded=0.;self.specimen_recovered=0.;self.pin_recovered=0.;self.lubricant_recovered=0.;self.specimen_debris=0.;self.pin_debris=0.;self.specimen_debris_recovered=0.;self.pin_debris_recovered=0.;self.lubricant_dragout=0.;self.specimen_wear=0.;self.pin_wear=0.;self.sample_distance=0.;self.source_origin=None;self.power=False;self.lid_open=True;self.contact=False;self.emergency=False;self.homing=False;self.radius=.01;self.normal_setting=0.;self.disk_angle=0.;self.linear_position=0.;self.signed_speed=0.;self.temperature=296.15;self.initial_temperature=296.15;self.temperature_target=296.15;self.heater_energy=0.;self.friction_energy=0.;self.ambient_loss=0.;self.left=0.;self.right=0.;self.calibration=copy.deepcopy(CAPS['sensor.calibrate']['example_arguments']);self.drive=copy.deepcopy(DRIVE_EXAMPLE);self.method=copy.deepcopy(METHOD_EXAMPLE);self.phase='idle';self.elapsed=0.;self.rows=[];self.observed_work=0.;self.operation_distance=0.;self.operation_start=0.;self.operation_id=None;self.angle_base=0.;self.source=None;self.result_reference=None;self.operation_method=None;self.result_evidence=None;self.error=None;self._counter=0;self.records={};self.time_s=0.;self._ticks=0;self._remainder=0.;self.revision=0;self._requests={};self._cancel_operations={};self._owners={};self._principals={'agent':'agent','evaluator':'evaluator'};self.scalar_info=None def register_principal(self,principal_id,visibility='agent'): if not isinstance(principal_id,str) or not principal_id or principal_id in self._principals or visibility not in ('agent','debug','evaluator'):raise ActionRejected('REQUEST_CONFLICT') self._principals[principal_id]=visibility def session(self,principal_id='agent'): if principal_id not in self._principals:raise ActionRejected('ACCESS_DENIED') return AntonpaarTrbSession(self,principal_id) def describe(self):return export_antonpaar_trb_contract_metadata() def _normal_true(self):return self.normal_setting*self.plant['normal_force_factor'] if self.contact and self.plant else 0. def _normal_observed(self): if not self.power or not self.contact:return None return (self.normal_setting*self.plant['normal_read_gain']+self.plant['normal_read_offset_n']-self.calibration['normal_zero_n'])/self.calibration['normal_gain_correction'] def _coordinate(self):return (self.source_origin if self.source_origin is not None else self.ref_x[0] if len(self.ref_x) else 0.)+self.sample_distance def _mu(self):return float(np.interp(self._coordinate(),self.ref_x,self.ref_mu)) if len(self.ref_x) else 0. def _sensing(self): if not self.power:return None,None,'POWER_OFF' if not self.contact or self.phase!='running':return None,None,'NO_SLIDING_CONTACT' f=(self.left-self.right-self.calibration['friction_zero_n'])/self.calibration['friction_gain_correction'];n=self._normal_observed() if abs(f)>FRICTION_MAX:return None,None,'FRICTION_SENSOR_OVER_RANGE' if abs(self.signed_speed)<1e-10:return None,None,'REVERSAL_ZERO_SPEED' if n is None or nself.plant['safe_access_temperature_k']:raise ActionRejected('HOT_SPECIMEN') def _check_drive(self,a): if a['mode']=='linear' and math.pi*a['stroke_m']*a['frequency_hz']>.370+1e-12:raise ActionRejected('LINEAR_SPEED_RANGE') if a['mode']=='angular' and (a['frequency_hz']>7 or not OMEGA_MIN<=2*math.pi*a['frequency_hz']*a['angular_amplitude_rad']<=OMEGA_MAX):raise ActionRejected('ANGULAR_COMBINATION_RANGE') if self.plant: if a['mode']=='linear' and self.plant['stage_mass_kg']*(2*math.pi*a['frequency_hz'])**2*a['stroke_m']/2>=self.plant['linear_drive_limit_n']:raise ActionRejected('DRIVE_INERTIA_RANGE') if a['mode']=='angular' and self.plant['rotational_inertia_kg_m2']*(2*math.pi*a['frequency_hz'])**2*a['angular_amplitude_rad']>=TORQUE_MAX:raise ActionRejected('DRIVE_INERTIA_RANGE') def _mu_limit(self): fn=self._normal_true() if fn<=0:return math.inf limit=FRICTION_MAX/fn if self.drive['mode']=='linear':limit=min(limit,(self.plant['linear_drive_limit_n']-self.plant['stage_mass_kg']*(2*math.pi*self.drive['frequency_hz'])**2*self.drive['stroke_m']/2)/fn) else: inertia=self.plant['rotational_inertia_kg_m2']*(2*math.pi*self.drive['frequency_hz'])**2*self.drive['angular_amplitude_rad'] if self.drive['mode']=='angular' else 0.;limit=min(limit,(TORQUE_MAX-inertia)/(fn*self.radius)) if self.radius>0 else limit return limit def _speed(self):return self.radius*self.drive['angular_speed_rad_s'] if self.drive['mode']=='rotary' else abs(motion(self.drive,self.radius,0.)['signed_speed_m_s']) def _check_conditions(self): s=self.specimen;c=self.reference.get('conditions',{});speed=self._speed();pairs=[('normal_force_n',self._normal_true()),('sliding_speed_m_s',speed),('temperature_k',self.temperature),('relative_humidity',self.plant['relative_humidity']),('track_radius_m',self.radius),('counterbody_radius_m',self.pin['radius_m'])] if self.reference.get('runtime_basis')==SPEED_BASIS:pairs=[x for x in pairs if x[0]!='sliding_speed_m_s'] if any(c.get(k) is None for k,_ in pairs) and not s['accept_unknown_conditions']:raise ActionRejected('UNKNOWN_REFERENCE_CONDITIONS') for k,v in pairs: if c.get(k) is not None and abs(float(c[k])-v)>(self.method['temperature_tolerance_k'] if k=='temperature_k' else max(1e-10,abs(v)*1e-6)) and not s['accept_condition_transfer']:raise ActionRejected('REFERENCE_CONDITIONS') if c.get('motion_mode') is not None and c['motion_mode']!=self.drive['mode'] and not s['accept_condition_transfer']:raise ActionRejected('REFERENCE_CONDITIONS') if self.lubricant and not s['accept_condition_transfer']:raise ActionRejected('REFERENCE_LUBRICATION') def _invoke(self,k,a): if k in UNSUPPORTED:raise ActionRejected('UNSUPPORTED') if k=='acquisition.result':return self._result() if k=='ledger.read':return self._ledger() if k=='analysis.wear_profile':return profile_analysis(a) if k=='analysis.hertz':return hertz_analysis(a) if k=='reference.query': rec=library()['substances'].get(a['reference_id']) if rec is None:raise ActionRejected('INVALID_REFERENCE') return dict(reference_json=json.dumps(rec,ensure_ascii=False),template_source=json.dumps(rec.get('source'),ensure_ascii=False),evidence=json.dumps(rec.get('evidence'),ensure_ascii=False)) if k=='plant.configure': if self.plant or self.time_s:raise ActionRejected('INITIALIZATION_ONLY') if not a['accept_engineering']:raise ActionRejected('MODEL_NOT_ACCEPTED') if a['temperature_max_k']0:raise ActionRejected('THERMAL_CONFIGURATION') self.plant=copy.deepcopy(a);self.temperature=self.initial_temperature=self.temperature_target=a['ambient_k'];return {'configured':True} if k=='power.set': self._stopped() if a['enabled'] and (not self.plant or self.emergency):raise ActionRejected('NOT_READY') self.power=a['enabled'];return a if k=='lid.set':self._stopped();self.lid_open=a['opened'];return a if k=='emergency.stop': self.emergency=True;self.homing=False if self.phase=='running':self._finish('failed','EMERGENCY_STOP') self.signed_speed=0.;return {'latched':True} if k=='emergency.reset':self._stopped();self.emergency=False;return {'latched':False} if k=='normal_load.set': self._access() if not self.plant:raise ActionRejected('NOT_READY') if a['force_n']*self.plant['normal_force_factor']>60:raise ActionRejected('NORMAL_FORCE_RANGE') self.normal_setting=a['force_n'];return a if k=='radius.set':self._access();self.radius=a['radius_m'];return a if k=='drive.configure':self._access();self._check_drive(a);self.drive=copy.deepcopy(a);return a if k=='motion.home': self._access() if not self.power or self.emergency:raise ActionRejected('NOT_READY') self.homing=True;return {'homing':True} if k=='contact.set': self._stopped() if not self.lid_open:raise ActionRejected('LID_CLOSED') if a['engaged'] and (not self.specimen or not self.pin):raise ActionRejected('NO_CONTACT_PAIR') self.contact=a['engaged'];return a if k in ('specimen.load','pin.load','lubricant.load'): self._access() if not self.plant:raise ActionRejected('NOT_READY') if not a['accept_engineering']:raise ActionRejected('MODEL_NOT_ACCEPTED') name=k.split('.')[0] if getattr(self,name) is not None:raise ActionRejected('ALREADY_LOADED') if name=='specimen': rec=copy.deepcopy(library()['substances'].get(a['reference_id'],{}));x,mu=curve(rec,a['accept_unknown_conditions']);self.reference=rec;self.ref_x=x;self.ref_mu=mu;self.specimen_wear=0.;self.sample_distance=0.;self.source_origin=None if name=='pin':self.pin_wear=0. if name=='lubricant' and (self.temperature>423.15 or self.temperature_target>423.15):raise ActionRejected('LIQUID_TEMPERATURE_RANGE') setattr(self,name,copy.deepcopy(a));setattr(self,name+'_volume',a['volume_m3']);setattr(self,name+'_loaded',getattr(self,name+'_loaded')+a['volume_m3']*a['density_kg_m3']);return {'loaded':True} if k in ('specimen.remove','pin.remove','lubricant.remove'): self._access();name=k.split('.')[0];item=getattr(self,name) if item is None:raise ActionRejected('NOT_LOADED') setattr(self,name+'_recovered',getattr(self,name+'_recovered')+getattr(self,name+'_volume')*item['density_kg_m3']);setattr(self,name+'_volume',0.);setattr(self,name,None) if name=='specimen':self.ref_x=np.array([]);self.ref_mu=np.array([]);self.reference=None;self.source_origin=None;self.sample_distance=0.;self.specimen_wear=0. if name=='pin':self.pin_wear=0. return {'removed':True} if k=='debris.collect': self._access();self.specimen_debris_recovered+=self.specimen_debris;self.pin_debris_recovered+=self.pin_debris;self.specimen_debris=0.;self.pin_debris=0.;return {'collected':True} if k=='thermal.set_temperature': self._stopped() if not self.plant:raise ActionRejected('NOT_READY') t=a['temperature_k'] if tself.plant['ambient_k'] and not self.plant['heater_installed']:raise ActionRejected('HEATER_NOT_INSTALLED') if t>self.plant['temperature_max_k']:raise ActionRejected('THERMAL_MODEL_RANGE') if self.lubricant and t>423.15:raise ActionRejected('LIQUID_TEMPERATURE_RANGE') self.temperature_target=t;return a if k=='sensor.calibrate':self._stopped();self.calibration=copy.deepcopy(a);return a if k=='sensor.zero': self._access() if not self.power:raise ActionRejected('NOT_READY') self.calibration['friction_zero_n']=self.left-self.right;return {'zeroed':True} if k=='method.configure': self._stopped() if abs(a['sample_interval_s']/DT-round(a['sample_interval_s']/DT))>1e-8:raise ActionRejected('SAMPLING_GRID') if self.source_origin is not None and a['source_start_distance_m']!=self.source_origin:raise ActionRejected('SOURCE_ORIGIN_LOCKED') self.method=copy.deepcopy(a);return a if k=='acquisition.start': self._stopped() if not self.power or self.emergency or self.lid_open or not self.contact or not self.specimen or not self.pin:raise ActionRejected('NOT_READY') if self.specimen_volume<=0 or self.pin_volume<=0:raise ActionRejected('SPECIMEN_EXHAUSTED') if self.drive['mode']=='linear' and abs(self.linear_position)>1e-12:raise ActionRejected('HOME_REQUIRED') if self.drive['mode']!='linear' and self.radius<=0:raise ActionRejected('ZERO_TRACK_RADIUS') self._check_drive(self.drive) if self.reference.get('runtime_basis') in SCALAR_BASES:self.ref_x,self.ref_mu,self.scalar_info=scalar_curve(self.reference,self._speed(),self.specimen['accept_unknown_conditions'],self.specimen['accept_condition_transfer']) self._check_conditions();coordinate=self.method['source_start_distance_m']+self.sample_distance if not self.ref_x[0]<=coordinateself._mu_limit():raise ActionRejected('DRIVE_FORCE_RANGE') if abs(self.temperature-self.temperature_target)>self.method['temperature_tolerance_k']:raise ActionRejected('TEMPERATURE_NOT_READY') self.source_origin=self.method['source_start_distance_m'];self._counter+=1;self.operation_id=self.instance_id+':'+str(self._counter);self.phase='running';self.elapsed=0.;self.rows=[];self.observed_work=0.;self.operation_distance=0.;self.operation_start=self.time_s;self.angle_base=self.disk_angle;self.error=None;self.result_reference=self.specimen['reference_id'];self.source=json.dumps(self.reference.get('source'),ensure_ascii=False);self.operation_method=json.dumps({'method':self.method,'drive':self.drive,'radius_m':self.radius,'nominal_deadweight_force_n':self.normal_setting},sort_keys=True);self.result_evidence=(SCALAR_EVIDENCE+' Scalar replay: '+json.dumps(self.scalar_info,sort_keys=True)+'. ' if self.reference.get('runtime_basis') in SCALAR_BASES else 'Original positive empirical mu(distance) response transplanted under explicitly accepted conditions; source CSV preserved and source-node subsampling is not native resolution. ')+'Deadweight not servo; prescribed waveform not validated motor/contact dynamics. Wear uses explicit Archard inputs; differential sensors, heating/cooling and online wear proxy are engineering assumptions, not measured accuracy/noise. True private coefficients and inventories remain evaluator-only. Sources: '+json.dumps(self.reference.get('evidence'),ensure_ascii=False);self._record();return {'operation_id':self.operation_id} if k=='acquisition.stop': if self.phase!='running':raise ActionRejected('NOT_RUNNING') self._finish('cancelled');return {'phase':'cancelled'} raise ActionRejected('UNKNOWN_CAPABILITY') def _heat(self,dt,friction_j=0.): if not self.plant or dt<=0:return p=self.plant;c=p['thermal_capacity_j_k'];g=p['heat_loss_w_k'];ambient=p['ambient_k'];q=friction_j/dt;gain=p['heater_gain_w_k'] if self.power and not self.emergency and p['heater_installed'] else 0.;maximum=p['heater_max_w'] if gain else 0.;target=self.temperature_target;remaining=dt;loops=0 while remaining>1e-14: loops+=1 if loops>10:raise RuntimeError('thermal event partition did not converge') t0=self.temperature;rate0=q-g*(t0-ambient);low=target-maximum/gain if gain else -math.inf if gain and maximum>0 and (t00 and (t00 else [] rate=(b-a*t0)/c if abs(rate)<1e-14:integral=t0*remaining;t1=t0;duration=remaining else: equilibrium=b/a if a else 0.;predict=equilibrium+(t0-equilibrium)*math.exp(-a*remaining/c) if a else t0+b*remaining/c;duration=remaining for boundary in bounds: if (boundary-t0)*rate>1e-10 and min(t0,predict)0: for item,volume,label in [(self.specimen,self.specimen_volume,'SPECIMEN_EXHAUSTED'),(self.pin,self.pin_volume,'PIN_EXHAUSTED')]: if item['archard_coefficient']>0:candidates.append((volume*item['hardness_pa']/(item['archard_coefficient']*fn),label)) if self.lubricant and self.lubricant['loss_per_distance_m2']>0:candidates.append((self.lubricant_volume/self.lubricant['loss_per_distance_m2'],'LUBRICANT_EXHAUSTED')) for distance,label in candidates: if distance<=limit:limit=max(0.,distance);reason=label start=self._coordinate();end=start+limit;lo=int(np.searchsorted(self.ref_x,start,side='right'));hi=int(np.searchsorted(self.ref_x,end,side='left'));x=np.r_[start,self.ref_x[lo:hi],end];mu=np.interp(x,self.ref_x,self.ref_mu);bound=self._mu_limit() for i in range(len(x)-1): if mu[i]>bound:limit=max(0.,x[i]-start);reason='DRIVE_FORCE_RANGE';break if mu[i+1]>bound: crossing=x[i]+(x[i+1]-x[i])*(bound-mu[i])/(mu[i+1]-mu[i]);limit=max(0.,crossing-start);reason='DRIVE_FORCE_RANGE';break return limit,reason def _sensors(self,dt,mean_force,ds_signed): p=self.plant;common=p['common_drift_n_s']*self.time_s+p['thermal_common_drift_n_k']*(self.temperature-p['ambient_k']);target1=.5*mean_force*p['friction_gain_left']+p['friction_offset_left_n']+common;target2=-.5*mean_force*p['friction_gain_right']+p['friction_offset_right_n']+common;tau=p['force_sensor_tau_s'];one=-math.expm1(-dt/tau) int1=target1*dt+(self.left-target1)*tau*one;int2=target2*dt+(self.right-target2)*tau*one;self.left+=one*(target1-self.left);self.right+=one*(target2-self.right) if dt>0:self.observed_work+=(int1-int2-self.calibration['friction_zero_n']*dt)/self.calibration['friction_gain_correction']*ds_signed/dt def _advance_motion(self,elapsed_end): elapsed_start=self.time_s-self.operation_start;begin=motion(self.drive,self.radius,elapsed_start);end=motion(self.drive,self.radius,elapsed_end);requested=max(0.,end['distance_m']-begin['distance_m']);ds,reason=self._allowed_distance(requested) if ds1e-14: energy=self._reference_work(ds);fn=self._normal_true();signed=math.copysign(ds,motion(self.drive,self.radius,(elapsed_start+elapsed_end)/2)['signed_speed_m_s']);mean_force=energy/ds*math.copysign(1.,signed) if ds>0 else 0.;self.friction_energy+=energy;self._heat(dt,energy) for name in ['specimen','pin']: item=getattr(self,name);old=getattr(self,name+'_volume');wear=min(old,item['archard_coefficient']*fn*ds/item['hardness_pa']);setattr(self,name+'_volume',old-wear);setattr(self,name+'_wear',getattr(self,name+'_wear')+wear);setattr(self,name+'_debris',getattr(self,name+'_debris')+wear*item['density_kg_m3']) if self.lubricant: loss=min(self.lubricant_volume,self.lubricant['loss_per_distance_m2']*ds);self.lubricant_volume-=loss;self.lubricant_dragout+=loss*self.lubricant['density_kg_m3'] self.sample_distance+=ds;self.operation_distance+=ds;self.time_s=self.operation_start+elapsed_end;self.elapsed=elapsed_end;self.disk_angle=(self.angle_base+end['angle_rad']+math.pi)%(2*math.pi)-math.pi;self.linear_position=end['position_m'];self.signed_speed=end['signed_speed_m_s'];self._sensors(dt,mean_force,signed) if self.temperature>self.plant['temperature_max_k']:reason='THERMAL_MODEL_RANGE' if self.lubricant and self.temperature>423.15:reason='LIQUID_TEMPERATURE_RANGE' if self._sensing()[2]=='FRICTION_SENSOR_OVER_RANGE':reason='FRICTION_SENSOR_OVER_RANGE' if not self.specimen['accept_condition_transfer']: try:self._check_conditions() except ActionRejected as exc:reason=str(exc) if reason:self._finish('succeeded' if reason=='STOP_DISTANCE' else 'failed',None if reason=='STOP_DISTANCE' else reason) def _record(self): if self.rows and abs(self.rows[-1]['time_s']-self.time_s)<=1e-12:return f,mu,reason=self._sensing();self.rows.append(dict(time_s=self.time_s,elapsed_s=self.time_s-self.operation_start,sliding_distance_m=self.operation_distance,signed_speed_m_s=self.signed_speed,disk_angle_rad=self.disk_angle,linear_position_m=self.linear_position,normal_force_n=self._normal_observed(),friction_force_n=f,friction_coefficient=mu,sensor_left_n=self.left if self.power else None,sensor_right_n=self.right if self.power else None,wear_depth_m=self._wear_read(),temperature_k=self.temperature+self.plant['temperature_sensor_offset_k']-self.calibration['temperature_zero_k'] if self.power else None,cumulative_observed_work_j=self.observed_work,unavailable_reason=reason)) def _finish(self,phase,error=None): self.elapsed=self.time_s-self.operation_start;self._record();self.phase=phase;self.error=error;self.signed_speed=0. if self.operation_id:self.records[self.operation_id]=self._result() def _tick(self): start=(self._ticks-1)*DT;end=self._ticks*DT;self.time_s=start while self.time_sphase_time+1e-12:interval=min(interval,next_turn-phase_time) endpoint=min(end-self.operation_start,phase_time+interval,self.method['duration_s']);before=self.time_s;self._advance_motion(endpoint) if self.phase=='running' and self.elapsed>=self.method['duration_s']-1e-10:self._finish('succeeded') if self.phase=='running' and self.time_s<=before+1e-14:raise RuntimeError('motion integration made no progress') else: dt=end-self.time_s;self._heat(dt) if self.plant and self.power:self._sensors(dt,0.,0.) if self.power and not self.emergency and self.homing: self.linear_position+=max(-.03*dt,min(.03*dt,-self.linear_position));self.disk_angle+=max(-1.*dt,min(1.*dt,-self.disk_angle));self.homing=abs(self.linear_position)>1e-12 or abs(self.disk_angle)>1e-12 self.time_s=end self.time_s=end if self.phase=='running' and (self._ticks-round(self.operation_start/DT))%round(self.method['sample_interval_s']/DT)==0:self._record() def step(self,dt_s): validate(number('s',0,3600),dt_s);total=self._remainder+dt_s;n=int((total+1e-12)/DT);self._remainder=total-n*DT for _ in range(n):self._ticks+=1;self._tick() self.revision+=n class AntonpaarTrbSession: def __init__(self,host,principal_id):self._host=host;self._principal=principal_id @property def _role(self):return self._host._principals[self._principal] def _target(self,instance_id): if instance_id!=self._host.instance_id:raise ActionRejected('UNKNOWN_INSTANCE') def describe(self,*,instance_id=None,asset_type_id=None): if (instance_id is None)==(asset_type_id is None):raise ActionRejected('INVALID_ARGUMENT') if instance_id is not None:self._target(instance_id) if asset_type_id is not None and asset_type_id!=ASSET_TYPE_ID:raise ActionRejected('UNKNOWN_INSTANCE') meta=export_antonpaar_trb_contract_metadata();return dict(protocol_version=PROTOCOL_VERSION,asset_type_id=ASSET_TYPE_ID,asset_version='1.1.0',capabilities={k:v for k,v in meta['capabilities'].items() if v['visibility']=='agent' or self._role!='agent'},state_slots={k:v for k,v in meta['state_slots'].items() if v['visibility']=='agent' or self._role!='agent'}) def read(self,*,instance_id,state_ids=None): self._target(instance_id);h=self._host;values=h.read(self._role);ids=list(values) if state_ids is None else state_ids if not isinstance(ids,list) or any(not isinstance(k,str) for k in ids):raise ActionRejected('INVALID_ARGUMENT') if any(k not in values for k in ids):raise ActionRejected('ACCESS_DENIED') return dict(instance_id=instance_id,status='succeeded',state_revision=h.revision,clock={'domain':'simulation','time_s':h.time_s},observations={k:dict(value=values[k],unit=SLOTS[k]['unit'],quality='unavailable' if values[k] is None else 'estimated' if SLOTS[k]['origin']=='derived' else 'valid',sample_time_s=h.time_s,sample_window_s=None) for k in ids}) def invoke(self,*,instance_id,capability_id,arguments,request_id): h=self._host try: self._target(instance_id) if not isinstance(capability_id,str) or capability_id not in CAPS:raise ActionRejected('UNKNOWN_CAPABILITY') if self._role=='agent' and CAPS[capability_id]['visibility']!='agent':raise ActionRejected('ACCESS_DENIED') if not isinstance(request_id,str) or not request_id:raise ActionRejected('INVALID_ARGUMENT') validate(CAPS[capability_id]['input_schema'],arguments);key=(self._principal,request_id);digest=json.dumps([capability_id,arguments],sort_keys=True,allow_nan=False) if key in h._requests: old,result=h._requests[key] if old!=digest:raise ActionRejected('REQUEST_CONFLICT') return copy.deepcopy(result) if capability_id in ('acquisition.stop','acquisition.result') and self._role=='agent' and h.operation_id is not None and h._owners.get(h.operation_id)!=self._principal:raise ActionRejected('ACCESS_DENIED') result=h.invoke(capability_id,**arguments);operation=result.get('operation_id') if capability_id=='acquisition.start' else None if operation:h._owners[operation]=self._principal response=dict(protocol_version=PROTOCOL_VERSION,instance_id=instance_id,request_id=request_id,operation_id=operation,status='accepted' if operation else 'succeeded',state_revision=h.revision,clock={'domain':'simulation','time_s':h.time_s},result=result,observations={},error=None);h._requests[key]=(digest,copy.deepcopy(response));return response except ActionRejected as exc:return dict(protocol_version=PROTOCOL_VERSION,instance_id=instance_id,request_id=request_id,operation_id=None,status='unsupported' if str(exc)=='UNSUPPORTED' else 'rejected',state_revision=h.revision,clock={'domain':'simulation','time_s':h.time_s},result={},observations={},error=dict(code=str(exc),message=str(exc),retryable=False,side_effects='none')) def write(self,*,instance_id,state_id,value,request_id): self._target(instance_id);entry=SLOTS.get(state_id) if not entry or not entry['write']:raise ActionRejected('ACCESS_DENIED') capability,argument=entry['write'];return self.invoke(instance_id=instance_id,capability_id=capability,arguments={argument:value},request_id=request_id) def poll(self,operation_id): h=self._host if h._owners.get(operation_id)!=self._principal:raise ActionRejected('ACCESS_DENIED') result=h._result() if operation_id==h.operation_id and h.phase=='running' else h.records.get(operation_id) if result is None:raise ActionRejected('UNKNOWN_OPERATION') return dict(operation_id=operation_id,status=result['phase'],result=copy.deepcopy(result)) def cancel(self,operation_id,request_id): self.poll(operation_id);h=self._host if not isinstance(request_id,str) or not request_id:raise ActionRejected('INVALID_ARGUMENT') key=(self._principal,request_id) if key in h._cancel_operations: if h._cancel_operations[key]!=operation_id:raise ActionRejected('REQUEST_CONFLICT') return copy.deepcopy(h._requests[key][1]) if key in h._requests:raise ActionRejected('REQUEST_CONFLICT') if operation_id!=h.operation_id:raise ActionRejected('NOT_RUNNING') result=self.invoke(instance_id=h.instance_id,capability_id='acquisition.stop',arguments={},request_id=request_id) if result['status']=='succeeded':h._cancel_operations[key]=operation_id return result slot('environment.relative_humidity',nullable(number('1',0,1)),'1','显式环境RH与校准偏置后的限幅读数;不声称湿度控制附件已实现',component='controller') EFFECTS={ 'plant.configure':['plant.configured','truth.temperature_k','thermal.target_k'], 'specimen.load':['specimen.present','truth.specimen_volume_m3','truth.friction_coefficient','wear.indicated_m'], 'specimen.remove':['specimen.present','truth.specimen_volume_m3','truth.friction_coefficient','wear.indicated_m'], 'pin.load':['pin.present','truth.pin_volume_m3'],'pin.remove':['pin.present','truth.pin_volume_m3'], 'lubricant.load':['lubricant.present','truth.lubricant_volume_m3'],'lubricant.remove':['lubricant.present','truth.lubricant_volume_m3'], 'debris.collect':['truth.debris_kg'], 'power.set':['power.enabled','power.angle_rad','normal.indicated_n','friction.indicated_n','friction.coefficient','friction.left_n','friction.right_n','wear.indicated_m','thermal.indicated_k','friction.unavailable_reason','environment.relative_humidity'], 'normal_load.set':['normal.setting_n'],'radius.set':['radius.position_m'],'drive.configure':['drive.mode'], 'contact.set':['contact.engaged','arm.angle_rad','normal.indicated_n','truth.normal_force_n','friction.unavailable_reason'], 'lid.set':['lid.open','lid.angle_rad'],'motion.home':['motion.homing'], 'emergency.stop':['emergency.latched','estop.press_m','motion.homing','acquisition.phase','acquisition.elapsed_s','acquisition.points','motion.signed_speed_m_s','friction.indicated_n','friction.coefficient','friction.unavailable_reason'], 'emergency.reset':['emergency.latched','estop.press_m'],'thermal.set_temperature':['thermal.target_k'], 'sensor.calibrate':['normal.indicated_n','friction.indicated_n','friction.coefficient','wear.indicated_m','thermal.indicated_k','friction.unavailable_reason'],'sensor.zero':[], 'acquisition.start':['acquisition.phase','acquisition.elapsed_s','acquisition.points','motion.distance_m','friction.indicated_n','friction.coefficient','friction.unavailable_reason','truth.friction_coefficient'], 'acquisition.stop':['acquisition.phase','acquisition.elapsed_s','acquisition.points','motion.signed_speed_m_s','friction.indicated_n','friction.coefficient','friction.unavailable_reason'], 'sim.step':list(SLOTS) } for k,v in EFFECTS.items():CAPS[k]['effects']=v PHYSICS_EFFECTS=['disk.angle_rad','linear.position_m','motion.homing','normal.indicated_n','friction.indicated_n','friction.coefficient','friction.left_n','friction.right_n','wear.indicated_m','thermal.indicated_k','motion.signed_speed_m_s','motion.distance_m','friction.unavailable_reason','truth.friction_coefficient','truth.specimen_volume_m3','truth.pin_volume_m3','truth.debris_kg','truth.lubricant_volume_m3','truth.temperature_k','truth.friction_work_j','clock.time_s','acquisition.phase','acquisition.elapsed_s','acquisition.points'] def export_antonpaar_trb_contract_metadata(): slots={};caps={} for k,v in SLOTS.items():slots[k]=dict(meaning_zh=v['meaning'],component_ids=[v['component']],value_schema=copy.deepcopy(v['schema']),unit=v['unit'],reference_conditions='SI. Positive prescribed direction; friction observation is signed, mu=absolute indicated friction/positive indicated load. Linear stage exists only in separate engineering variant. Normal load is manual deadweight. Inputs are explicitly declared engineering coefficients.',origin=v['origin'],visibility=v['visibility'],access='read_only',read_binding=dict(backend='host',artifact_id='runtime',accessor=f'AntonpaarTrbSession.read(state_ids=[{k!r}])'),write_via=None,sampling=dict(mode='instant',time_domain='simulation',window_description='Host0.1s ticks, internal<=10ms and64steps/reciprocation with exact reversal events. Instant sampled readings can alias; exact cumulative distance/work uses full path. No empirical noise claim.'),source_ids=['simulation_assumption']) errors=['UNKNOWN_CAPABILITY','UNKNOWN_INSTANCE','UNKNOWN_OPERATION','INVALID_ARGUMENT','UNSUPPORTED','ACCESS_DENIED','REQUEST_CONFLICT','BUSY','NOT_RUNNING','NOT_READY','INITIALIZATION_ONLY','MODEL_NOT_ACCEPTED','ARM_LOADED','LID_CLOSED','HOT_SPECIMEN','ALREADY_LOADED','NOT_LOADED','INVALID_REFERENCE','NO_CONTACT_PAIR','NORMAL_FORCE_RANGE','LINEAR_SPEED_RANGE','ANGULAR_COMBINATION_RANGE','DRIVE_INERTIA_RANGE','DRIVE_FORCE_RANGE','ZERO_TRACK_RADIUS','HOME_REQUIRED','REFERENCE_DISTANCE_RANGE','UNKNOWN_REFERENCE_CONDITIONS','REFERENCE_CONDITIONS','REFERENCE_LUBRICATION','SOURCE_ORIGIN_LOCKED','SPECIMEN_EXHAUSTED','PIN_EXHAUSTED','LUBRICANT_EXHAUSTED','FRICTION_SENSOR_OVER_RANGE','EMERGENCY_STOP','THERMAL_CONFIGURATION','THERMAL_MODEL_RANGE','LIQUID_TEMPERATURE_RANGE','NO_ACTIVE_COOLING','HEATER_NOT_INSTALLED','TEMPERATURE_NOT_READY','SAMPLING_GRID','PROFILE_GRID','PROFILE_RADIUS','HERTZ_MODEL_DOMAIN'] for k,c in CAPS.items(): un=k in UNSUPPORTED;async_=k=='acquisition.start';caps[k]={key:copy.deepcopy(c[key]) for key in ['input_schema','output_schema','component_ids','function_zh','kind','visibility','example_arguments']};caps[k].update(availability='unsupported' if un else 'implemented',implementation={layer:'absent' if un or layer in ['scene','robot','hardware'] else 'implemented' for layer in ['process','scene','robot','hardware','host']},binding=None if un else dict(backend='host',artifact_id='runtime',entrypoint='asset_runtime.antonpaar_trb.AntonpaarTrbSession.invoke',invocation=f'session.invoke(instance_id="trb_01",capability_id={k!r},arguments={c["example_arguments"]!r},request_id="unique")'),preconditions=[] if c['kind'] in ['query','analysis'] or un else [dict(description_zh='有限试片/销/润滑剂、源距离域、停机抬臂死重/半径/装卸、安全罩、驱动组合、温区前提;拒绝原子',state_ids=['power.enabled','lid.open','contact.engaged','emergency.latched','specimen.present','pin.present','acquisition.phase'],enforced_by='runtime',check='atomic invoke and registered Session')],state_effects=[dict(state_id=x,timing='immediate',description_zh='实际命令改变的状态') for x in c['effects']],observes=[],model_effects=dict(mode='none',description_zh='主旋转/角往复与独立linear附件几何另验证;此处不声称PhysX摩擦/磨耗接触求解',binding_ids=[]),execution=dict(mode='asynchronous' if async_ else 'synchronous',time_domain='simulation',completion_criterion='真实时间/累计路径达到方法终点;失败/取消保留部分物理效果' if async_ else '命令返回不隐式推进物理时间',completion_state_ids=['acquisition.phase'] if async_ else [],timeout_s=None,cancellation='supported' if async_ else 'unsupported',retry='same_request_id',resources=['host_clock','contact_pair','motion_module','differential_force_sensors'],partial_failure_zh='摩擦功、升温、磨耗和磨屑不回滚;取消冻结来源/曲线,停止运动;温度继续按宿主时间冷却'),errors=[dict(code=x,meaning_zh=x,side_effects='partial' if async_ and x in ['DRIVE_FORCE_RANGE','REFERENCE_DISTANCE_RANGE','SPECIMEN_EXHAUSTED','PIN_EXHAUSTED','LUBRICANT_EXHAUSTED','THERMAL_MODEL_RANGE','FRICTION_SENSOR_OVER_RANGE','EMERGENCY_STOP','REFERENCE_CONDITIONS'] else 'none') for x in errors],verification=[],limitations=['源经验摩擦响应与未知Archard/传感器/热参数分开','硬件范围不是已验证精度或全部上限可同时满足','主Matterix构型仅旋转/角往复;linear单独工程变体'],source_ids=['manufacturer_specs','simulation_assumption']) if k in ['acquisition.start','motion.home','thermal.set_temperature','power.set']:caps[k]['state_effects'] += [dict(state_id=x,timing='on_step',description_zh='宿主推进运动/热/观测/有限磨损') for x in PHYSICS_EFFECTS if x!='clock.time_s'] mechanism=dict(component_ids=['disk','linear_stage','specimen','pin','lever_arm','deadweight','friction_sensor_left','friction_sensor_right','sample_holder'],state_ids=list(slots),meaning_zh='有限材料对经验摩擦、精确滑程、差分观测及热/磨耗账本',implementation='lumped',equations=[ 'Rotary s=r*omega*t. Linear x=stroke/2*sin(2pi*f*t); angular theta=amplitude*sin(2pi*f*t). Exact s integrates |cos| across every reversal, not endpoint displacement. Linear vmax=pi*stroke*f<=.370m/s; angular peakomega in.2..2000rpm andf<=7Hz is an explicit peak-speed interpretation, allowing zero instantaneous speed at reversals.', 'Empirical positive mu(s) uses original source-node piecewise linear interpolation. Friction work=Fn*integral mu(s)ds exactly across source knots; original signal resolution and transfer of material-pair conditions are disclosed. Negative empirical coefficients are not silently made dissipative truth.', 'Records with runtime_basis=scalar_mean_friction (published mean mu of the pair) or scalar_speed_series_friction (published mu at several speeds, interpolated in log(speed) at the actual drive speed; outside the source range only with accepted condition transfer, clamped to the end value) are replayed as a CONSTANT mu(s) over [0, source sliding distance]; if the source does not report the distance the domain is unbounded and requires accept_unknown_conditions. Result evidence labels the scalar replay.', 'Deadweight nominal Fn set only at stopped raised arm. Actual Fn=nominal*explicit mechanical factor; indicated load uses separately supplied observation gain/offset. No active load servo.', 'Conservative combined envelope: Fn*mu*r + J*angular_acceleration_peak <=.45Nm; linear Fn*mu + moving_mass*acceleration_peak <=explicit engineering drive force. Friction force<=20N. First empirical threshold crossing/finite inventory/source endpoint stops with actual partial effects.', 'Dual sensing targets y1=+F/2*g1+offset1+common_drift(t,T), y2=-F/2*g2+offset2+common_drift(t,T). Identical first-order response cancels common component. ObservedF=(y1-y2-external_zero)/external_gain; observedmu=abs(Fobs)/Fn_obs. Low load, zero velocity and sensor overrange yield null with reason.', 'Internal sensor forcing uses distance-mean empirical friction on each monotonic segment. Exact exponential sensor update and its time integral times segment mean signed velocity estimate observed work. This is an explicit piecewise-constant observation approximation; true friction work is independently exact along source distance.', 'Archard dV=k*Fn*ds/H separately for specimen and pin, with explicit coefficients/hardness. Removed volumes times individual densities exactly enter separate debris reservoirs. Finite lubricant dragout=declared loss_per_distance*ds enters a catch inventory, not invented evaporation.', 'C*dT/dt=Pfriction_interval+clamp(K*(Ttarget-T),0,Pmax)-G*(T-Tambient). Piecewise exact exponential thermal regimes preserve heater+friction-ambient=stored heat. Heater characteristics are supplied engineering assumptions; not OEM power/ramp calibration. No active cooling or flash-contact-temperature prediction.', 'External wear profile integrates positive baseline-height deficit and negative pile-up separately. Circular track integrates2pi*(r+x)*depth(x), retaining radial weight and signed net. Uniform-track assumption is explicit. Hertz sphere-flat a=(3FnR/(4E*))^(1/3),1/E*=(1-v1^2)/E1+(1-v2^2)/E2,small-contact a/R<=.1.' ],parameters={},source_ids=['manufacturer_specs','simulation_assumption'],limitations=['Default curve is another tribometer material-pair experiment, not current TRB3native raw acquisition; scalar TRB3 and literature means are replayed only as labelled constant mu, never as synthetic transient curves.','Constant-mu scalar replay has no running-in, stick-slip, fluctuation, humidity/temperature or wear-driven drift; mean definitions (steady-state vs whole-test) follow each source.','Concentration/grade/load/speed/temperature variants do not count as50independent pure substances.','No empirical noise distribution, achieved.06mN force resolution, ASTM certification or true wear calibration.','The photographed red button is bound to a local engineering stop/reset interlock; original button function and certified emergency-stop behavior are not confirmed.','Predetermined motion has no acceleration ramp or motor/contact dynamics; peak-inertia envelope is conservative and explicitly engineering.','Online wear depth proxy derives declared uniform track from engineering Archard wear; original source wear data not fabricated frommu.','Strict source-condition mode terminates with partial effects if friction heating moves outside its explicitly configured source-temperature tolerance.','Thermal forcing uses exact interval work but interval-mean heat power; no flash-temperature, radiation/nonlinear property or insert/remove enthalpy model.','Linear geometry exists separately and is not silently overlaid on rotary main variant; actual scene tests determine availability there.']) caps['acquisition.start']['source_ids'].append('mendeley_leadbronze');caps['reference.query']['source_ids'].append('mendeley_leadbronze');mechanism['source_ids'].append('mendeley_leadbronze');caps['analysis.hertz']['source_ids'].append('nist_elastic_contact');caps['analysis.wear_profile']['source_ids'].append('nist_wear_method');mechanism['source_ids']+=['nist_elastic_contact','nist_wear_method'] spec=importlib.util.spec_from_file_location('_trb_local_annotations',ROOT/'scripts/asset_runtime/_annotations.py');ann=importlib.util.module_from_spec(spec);spec.loader.exec_module(ann);ann.KEY_ZH.update({k:v['meaning'] for k,v in SLOTS.items()});ann.annotate_export(SLUG,caps,slots,{'tribology':mechanism},inputs={'plant.configure':(PLANT,PLANT_EXAMPLE),'specimen.load':(SAMPLE,SAMPLE_EXAMPLE),'pin.load':(PIN,PIN_EXAMPLE),'lubricant.load':(LUBRICANT,LUBRICANT_EXAMPLE),'drive.configure':(DRIVE,DRIVE_EXAMPLE),'method.configure':(METHOD,METHOD_EXAMPLE)}) return dict(asset_type_id=ASSET_TYPE_ID,catalog_id=CATALOG_ID,capabilities=caps,state_slots=slots,mechanisms={'tribology':mechanism})