More › profiles

More

Profiles over time

A budget adds a number up once. A profile adds it up over time: a mission, an orbit, a working day, cut into phases. Each phase says what the system draws and gives while it lasts, and a stock keeps the running total: a battery, a tank, a data recorder, a cost.

Extension — not covered by the 1.0 stability promise (profile; the core)

A first profile#

profile mission "First hours" {
  phase launch 10min { power 40W }
  phase cruise 6h { power 12W; solar 18W }

  stock battery "Battery" {
    capacity 100Wh
    start 50%
    flow solar - power
  }
}

requirement REQ-BAT "Battery above 20 %" { limit mission.battery >= 20% }

A phase has a name and a duration (10min, 6h, 24h). What it writes is the value of a quantity during the phase, under any name: power 40W, solar 18W. A quantity a phase does not write is zero in it, unless the parts of the system give it (below).

A stock is a level that its flow fills and empties. The flow is a formula over the profile's quantities; in each phase the level moves by the flow times the phase's duration. With a capacity the level stays between empty and full, and start says where it begins (a level, or a share of the capacity; empty by default).

$ archec profile main.arche
profile mission — First hours: 6h 10min

  phase   lasts  power  solar  battery
  launch  10min  40W    0W     −6.667Wh
  cruise  6h     12W    18W    +36Wh

  power    12W … 40W, 12.757W on average
  solar    0W … 18W, 17.514W on average
  battery  50Wh (50%) at the start, 79.333Wh (79.333%) at the end — holds 100Wh
           lowest 43.333Wh (43.333%) at the end of launch, 10min in; highest 79.333Wh (79.333%) at the end of cruise, 6h 10min in

  ✓ REQ-BAT  mission.battery  lowest 43.333Wh (43.333%) at the end of launch, 10min in; the limit is >= 20%

archec profile main.arche --svg build/ also writes build/mission.svg: every stock and every quantity over the timeline, each on its own scale, with the capacity and the limits drawn.

The parts add up, mode by mode#

A quantity a phase does not write is added up over the parts of the system, the way a budget is: each part's power 4W, a repeated part once per copy. A number under a name of your own is a free property: prop solar = 28W.

A phase names the operating mode the system is in. Only the components active in that mode are counted, and the mode gives a part its number in that mode with set:

component Computer { power 4W }
component Radio { power 1W }
component Heater { power 0W }
component Panels { prop solar = 28W }

system Sat {
  part obc:    Computer
  part radio:  Radio
  part heater: Heater
  part panels: Panels
  budget power 20W
}

operating-mode SUNLIT { initial; set radio.power = 12W }
operating-mode ECLIPSE { set heater.power = 6W; set panels.solar = 0W }

profile orbit {
  of Sat
  repeat 15
  phase sunlit 60min { mode SUNLIT }
  phase eclipse 35min { mode ECLIPSE; set radio.power = 0.5W }
  stock battery { capacity 40Wh; start 100%; flow solar * 0.9 - power }
}
Diagram: Sat
What archec draws from this code: Sat
Try it
  • set part.name = value in an operating mode is the part's number in that mode. On a part that holds parts it stands for all of them. The mode's own budget is added up with it.
  • set in a phase does the same for that phase only, over what the mode says.
  • of names the system, when the model has several.
  • repeat 15 runs the timeline fifteen times, one after the other.
  • Each phase's total is checked against the budget of its mode and of the system (profile-over).

A phase can hold phases. It then lasts what they last, repeat times, and what it says (mode, set, a quantity) holds for all of them:

profile year {
  repeat 365
  phase night 10h { light 0W }
  phase day {
    repeat 7
    phase on 1h { light 120W; tariff 0.03EUR }
    phase off 1h { light 0W }
  }
  stock energy { unit kWh; flow light }
  stock cost { flow tariff; per h }
}

What a flow adds up to#

The one conversion a profile makes is a rate times a time.

The flow is The stock holds
a power: µW, mW, W, kW, MW an energy: J, kJ, Wh, kWh
a current: µA, mA, A a charge: C, mAh, Ah
a bitrate: bps, kbps, Mbps, Gbps data: bit … Mbit, B … TB, KiB … GiB
a volume flow: L/s, L/min, m³/s a volume: mL, L, m³, cm³, mm³
a speed: m/s, km/h a length: mm, cm, m, km

The stock's unit is its capacity's, or its start's; a stock with neither says it (unit kWh). For anything else, per says the time the flow is given for: with per h, a cost whose flow is 12EUR grows by 12 EUR an hour.

Nothing else is converted. Every value of one quantity is written in one unit across the profile; a part's power 300mW beside others in W is reported and not counted (profile-unit), as a budget does.

Limits, and what proves them#

A requirement bounds a profile with the limit it bounds geometry with:

Written Holds when
limit mission.battery >= 20% the stock never goes under 20 % of its capacity, over the whole profile
limit mission.battery >= 16Wh the same, as a level
limit mission.power <= 45W the quantity is at most 45 W in every phase
limit mission.eclipse.power <= 20W in that phase (orbit.eclipse for a phase inside a phase)
limit mission.eclipse.battery >= 30% the stock, during that phase

>= and > look at the lowest value, <= and < at the highest. archec check says when a limit is not held (profile-limit), with the value and the phase. archec profile records each limit as evidence, and archec status shows it under its requirement:

REQ-BATTERY   The battery stays above 30 %
  ✓ profile day.battery  the model  just now  lowest 33Wh (82.5%) at the end of eclipse, 1h 35min in; the limit is >= 30%

The record is out of date when a number the profile adds up has changed: a phase, a mode's set, a part's power. A limit never worked out reads never measured: archec profile.

A stock that runs empty is reported as information (profile-empty), with how much was drawn from it that was not there; one that is full says how much did not fit. Neither fails by itself: a limit says what the system needs.

examples/cubesat is a small satellite over a day in orbit: three modes, a battery and a recorder, three requirements.

Limits#

  • A profile is a coarse analysis: every number is constant within a phase. It is not a solver. A battery whose voltage sags, or a tank that drains faster when full, is an equation and archec physics.
  • A profile is not simulated: no behaviour runs, no state machine changes the mode. The phase says the mode.
  • The operating mode is the system's. A part has no mode of its own; a phase gives a part another number with set.
  • Quantities add up (sum). A quantity that is a maximum over the parts (budget temperature max 85°C) is not profiled.
  • The longest unit of time is the hour: a day is 24h, a year repeat 365.
  • Units declared by the project (unit) are not integrated: use per.
  • A profile runs through 200000 phases at most.
  • Arche has no profile: archec profile and the linter work it out; nothing is written to the Arche project.
  • A requirement's check min(battery) > 20% is not read here: write the bound as a limit.