stationeers.de Mod workshop · Dominik1199
DE Sign in
  1. Home
  2. IC10 academy
  3. Day 194

Day 194 of 365 · Pro · Month 7: Power and energy

Energy balance

Add up generation and consumption, compute the batteries' range in minutes from it and see from the charge trend where things are heading.

Lesson 18 min Week 28

What you learn today

  • Sum generation and consumption
  • Battery range
  • Recognise the trend

“Will the power last until tomorrow?” is the most important question on every planet with a night. A chip can answer it if it knows three numbers: what is generated, what is consumed and what is in the battery.

Summing generation and consumption

WhatFrom whereBatch mode
SolarCharge of all panelsSum
GeneratorsPowerGenerationSum
Consumptioncable analyzer in the consumer network, PowerRequiredone device
Battery contentCharge of all batteriesSum

Here Sum is right: power and energy really add up. In the game the cable analyzer is called StructureCableAnalysizer (with the typo again) and reports PowerRequired (demand), PowerPotential (supply) and PowerActual (actual flow) for its network.

The unit “W”

The power system calculates in joules per tick, the game shows that as “W”. A consumer with 1000 “W” therefore takes 1000 J from the battery every tick. For the range that means:

Ticks = battery content ÷ deficit per tick, minutes = ticks ÷ 120

sub tmp use gen            # deficit per tick
div range stored tmp       # ticks
div range range TICKS_PER_MIN

If the deficit is zero or negative, the battery is not getting emptier – then the display shows −1 instead of a meaningless number.

Spotting the trend

A momentary value jumps when a printer starts. Comparing with earlier says more: every ten ticks the chip compares the battery content with the last state. sgn turns that into +1 (rising), 0 or −1 (falling).

Warning

Hang the cable analyzer in the consumer network behind the battery, not in the same network as the batteries. Game batteries request their whole remaining capacity and offer their whole content – in the same network PowerRequired and PowerPotential become huge and say nothing about the consumers any more.

Note

The chip reads the starting value for the trend once before the start label. Otherwise the first trend compares the battery with 0 and reports a false “rising”.

Exercise

Task

Solar panels and a solid fuel generator generate, the cable analyzer “Verbraucher” measures the demand, the batteries store.

  • Display “Bilanz”: generation − consumption
  • Display “Reichweite”: minutes until the batteries are empty; −1 when they are not getting emptier
  • Display “Trend”: every 10 ticks +1, 0 or −1 by battery content (starting value and counter are already there)
  • Analyzer gone: flashing light “Messfehler” on, stop writing balance and range

Hints

Hint 1

Consumption with lbn … PowerRequired, on NaN light on and jump over balance and range with bnan use trendcheck.

Hint 2

Range: deficit = use − gen, div by the deficit and by TICKS_PER_MIN, only with deficit > 0.

Hint 3

Trend: count up, blt counter TREND_TICKS start, otherwise sgn of the change.

Quiz

4 questions. You pass from 60 % – the server does the grading.

Complete the day

  • Passed the simulator exercise
  • Passed the quiz with at least 60 %

Without an account progress is saved in this browser only.

Report a mistake in this lesson

Please sign in to report. Sign in

Esc
↑ ↓ selectEnter open/ opens search anywhere