babylon.formulas.trpf

Tendency of the Rate of Profit to Fall (TRPF) formulas.

Marx’s TRPF from Capital Volume 3 describes capitalism’s central contradiction: as organic composition of capital (c/v) rises, the rate of profit falls.

Epoch 1 Implementation:

TRPF Surrogate - time-based decay of extraction efficiency. Models effect without full OCC tracking.

Epoch 2 Implementation (Planned):

Full OCC tracking with constant_capital/variable_capital on entities. See ai-docs/epoch2-trpf.yaml for specification.

See also

/reference/trpf for full theoretical background ai-docs/theory.md for Marx’s original formulation

Functions

calculate_organic_composition(...)

Calculate organic composition of capital: OCC = c / v.

calculate_rate_of_profit(surplus_value, ...)

Calculate Marx's rate of profit: p' = s / (c + v).

calculate_rent_pool_decay(current_pool, ...)

Apply TRPF rent pool decay (background evaporation).

calculate_trpf_multiplier(tick, trpf_coefficient)

Calculate TRPF efficiency multiplier (Epoch 1 Surrogate).

babylon.formulas.trpf.calculate_trpf_multiplier(tick, trpf_coefficient, floor=0.1)[source]

Calculate TRPF efficiency multiplier (Epoch 1 Surrogate).

Models Marx’s Tendency of the Rate of Profit to Fall as a time-dependent decay of extraction efficiency. This is a surrogate for proper organic composition tracking.

The multiplier declines linearly from 1.0 at tick 0, representing how rising organic composition of capital reduces profit rates over time under capitalist accumulation.

Parameters:
  • tick (int) – Current simulation tick (0-indexed)

  • trpf_coefficient (float) – Decay rate per tick (default 0.0005)

  • floor (float) – Minimum multiplier (default 0.1 = 10% efficiency floor)

Return type:

float

Returns:

Multiplier in range [floor, 1.0]

Example

>>> calculate_trpf_multiplier(0, 0.0005)
1.0
>>> calculate_trpf_multiplier(1000, 0.0005)
0.5
>>> calculate_trpf_multiplier(2000, 0.0005)
0.1

Note

At default coefficient 0.0005: - tick 0: 100% efficiency - tick 520 (10 years): 74% efficiency - tick 1040 (20 years): 48% efficiency - tick 1800+: floors at 10% efficiency

Full OCC-based TRPF calculation planned for Epoch 2. See ai-docs/epoch2-trpf.yaml for specification.

Theoretical Basis:

Marx, Capital Vol. 3, Chapters 13-15: Rate of Profit p’ = s / (c + v) As OCC (c/v) rises, p’ falls even with constant exploitation rate (s/v).

babylon.formulas.trpf.calculate_rent_pool_decay(current_pool, decay_rate)[source]

Apply TRPF rent pool decay (background evaporation).

Models the tendency of accumulated surplus to erode over time, representing the contradiction between the tendency to accumulate and the tendency of profit rates to fall.

Parameters:
  • current_pool (float) – Current imperial rent pool value

  • decay_rate (float) – Per-tick decay rate (default 0.002 = 0.2%)

Return type:

float

Returns:

Decayed pool value (always >= 0)

Example

>>> calculate_rent_pool_decay(100.0, 0.002)
99.8
>>> calculate_rent_pool_decay(100.0, 0.0)
100.0

Note

At default decay 0.002: - After 52 ticks (1 year): ~90% remaining - After 520 ticks (10 years): ~35% remaining - After 1040 ticks (20 years): ~12% remaining

babylon.formulas.trpf.calculate_rate_of_profit(surplus_value, constant_capital, variable_capital)[source]

Calculate Marx’s rate of profit: p’ = s / (c + v).

This is the Epoch 2 formula for proper OCC-based TRPF calculation. Currently a placeholder - full implementation in Epoch 2.

Parameters:
  • surplus_value (float) – Value extracted beyond wages (s)

  • constant_capital (float) – Investment in machinery, materials (c)

  • variable_capital (float) – Wages paid to labor (v)

Return type:

float

Returns:

Rate of profit as decimal (0.0 to 1.0+)

Example

>>> calculate_rate_of_profit(100, 50, 100)  # Marx's first example
0.6666666666666666
>>> calculate_rate_of_profit(100, 400, 100)  # Marx's third example
0.2
Epoch 2 Data Requirements:

QCEW field mappings for parameter derivation:

variable_capital (v):
  • QCEW field: total_wages_all_workers

  • Interpretation: Total wages paid = living labor cost

  • Aggregation: Sum by county FIPS + industry NAICS

constant_capital (c):
  • QCEW fields: Not directly available

  • Derivation: Cross-reference with BEA Fixed Assets tables

  • Proxy method: c = v * industry_occ_coefficient

  • Industry OCC coefficients from BLS capital-labor ratios by NAICS

surplus_value (s):
  • QCEW fields: Not directly available

  • Derivation: s = industry_output - c - v

  • Cross-reference: BEA GDP-by-industry for output values

  • Proxy method: s = v * exploitation_rate where exploitation rate varies by industry (manufacturing ~150%, services ~100%)

Transformation pipeline:

QCEW(county, naics) → QCEWRecord
BEA(naics) → industry_occ_coefficient, industry_output
v = qcew.total_wages_all_workers
c = v * industry_occ_coefficient
s = industry_output - c - v  # or v * exploitation_rate as proxy

Note

Full implementation requires: - constant_capital/variable_capital fields on Bourgeoisie entities - surplus_extracted tracking per tick - OCC dynamics (automation investments shifting c/v ratio)

See ai-docs/epochs/epoch3/epoch2-trpf.yaml for specification.

babylon.formulas.trpf.calculate_organic_composition(constant_capital, variable_capital)[source]

Calculate organic composition of capital: OCC = c / v.

The organic composition represents the ratio of “dead labor” (machinery, materials) to “living labor” (wages). As capitalism develops, OCC tends to rise.

This is the Epoch 2 formula. Currently a placeholder.

Parameters:
  • constant_capital (float) – Investment in machinery, materials (c)

  • variable_capital (float) – Wages paid to labor (v)

Return type:

float

Returns:

Organic composition ratio (0.0 to infinity)

Example

>>> calculate_organic_composition(50, 100)
0.5
>>> calculate_organic_composition(400, 100)
4.0
Epoch 2 Data Requirements:

OCC varies systematically by industry and occupation. QCEW/NAICS industry codes serve as proxy for capital-intensity.

Industry-to-OCC mapping (representative coefficients):

NAICS

Industry

Typical OCC

11

Agriculture

1.5 - 2.5

21

Mining/Extraction

4.0 - 8.0

22

Utilities

6.0 - 10.0

23

Construction

0.8 - 1.5

31-33

Manufacturing

2.0 - 5.0

42

Wholesale Trade

0.5 - 1.0

44-45

Retail Trade

0.3 - 0.8

51

Information

2.0 - 4.0

52

Finance/Insurance

0.2 - 0.5

54

Professional Services

0.2 - 0.5

62

Healthcare

1.0 - 2.0

72

Accommodation/Food

0.5 - 1.0

Occupation-to-class mapping (SOC codes):

QCEW provides employment by industry, which correlates with occupation mix. High-OCC industries employ more machine operators (SOC 51xxxx) and fewer service workers (SOC 35xxxx-39xxxx).

Data sources:
  • QCEW: total_wages_all_workers by county × NAICS → v

  • BLS Capital-Labor tables: industry OCC coefficients

  • BEA Fixed Assets: capital stock by industry → c baseline

Transformation:

QCEW(county, naics) → variable_capital = total_wages
BLS(naics) → occ_coefficient (industry average)
constant_capital = variable_capital * occ_coefficient
OCC = c / v = occ_coefficient

Note

Higher OCC means more capital-intensive production. In Marx’s examples: - OCC = 0.5: Early capitalism (labor-intensive) - OCC = 4.0: Advanced capitalism (capital-intensive)

See ai-docs/epochs/epoch3/epoch2-trpf.yaml for specification.