drabont

Stationeers - GasMixer setting Calculation

Feb 27th, 2020 (edited)
1,012
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # k - Gas Mixer setting Calculation
  2. # n - Gas Mixer target
  3. # t1, t2 - mixed gas temperatures
  4. #
  5. #           n*t1
  6. #        ---------- * 100
  7. #        (100-n)*t2
  8. # k = --------------------
  9. #           n*t1
  10. #        ---------- + 1
  11. #        (100-n)*t2
  12. # https://youtu.be/9oQBcfK4OiY
  13.  
  14. alias mem d0
  15. alias an1 d1
  16. alias an2 d2
  17. alias mix d3
  18. loop:
  19. l r0 mem Setting
  20. l r1 an1 Temperature
  21. l r2 an2 Temperature
  22. mul r1 r0 r1
  23. sub r0 100 r0
  24. mul r2 r0 r2
  25. div r0 r1 r2
  26. mul r1 r0 100
  27. add r2 r0 1
  28. div r0 r1 r2
  29. s db Setting r0
  30. s mix Setting r0
  31. yield
  32. j loop
Add Comment
Please, Sign In to add comment