Sim.md_thermo: def of bend-prot@0.1.0.0 Import: import bend-prot@0.1.0.0/sim.bend as Sim Lines 203-206 of bend-prot@0.1.0.0/sim.bend: https://jend.leeeet.dev/read.txt?path=bend-prot@0.1.0.0/sim.bend&start_line=203&end_line=206 import Base # Berendsen thermostat folded into the step (T == 0 keeps velocities). def md_thermo(+ds: List<&2, DynAtom>, +dt: F32, +tau: F32, +temp0: F32, +n: Nat) -> List<&2, DynAtom>: +now = temp_of_ds(ds, n) vv_scale(ds, Bool.pick(F32, F32.is_eq(now, 0.0), 1.0, F32.sqrt((1.0 + (dt / tau : F32) * ((temp0 / now : F32) - 1.0 : F32) : F32)))) Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.sqrt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=bend-prot@0.1.0.0/sim.bend&name=DynAtom https://jend.leeeet.dev/definition.txt?path=bend-prot@0.1.0.0/sim.bend&name=temp_of_ds https://jend.leeeet.dev/definition.txt?path=bend-prot@0.1.0.0/sim.bend&name=vv_scale