# investment

Optional investment case: the baseline scenario, horizon, discount rate, operating hours per year, margin per part and throughput KPI that `naga invest` compares every scenario with. Absent by default.

OPTIONAL investment case: `naga invest` and the Studies window report payback, NPV and ROI of every scenario against the baseline. Per replication the run's Total Cost less its capex fixed costs, and the throughput, are scaled from the observed window to operating_hours_per_year.

In the model file this key holds an object.

## Typical uses

These sections turn a model into a business case. `fixed_costs` are costs of the scenario rather than of the run, such as equipment capex. `investment` defines the case that `naga invest` reports: payback, NPV and return on investment against a baseline scenario. `dispatch` plans storage over a rolling horizon at the lowest grid cost.

## Behaviour and rules

Running costs are not set here. They come from the cost fields of resources, fleets, entity types, flows and RECORD blocks. A fixed cost flagged `capex` is the investment that the saving has to repay. The `investment` section needs a scenario to compare with, and a check warns when only one scenario exists.

The case scales the observed window to `operating_hours_per_year`. The saving over the baseline is counted for `horizon_years` and discounted at `discount_rate`. A `margin_per_part` adds the value of extra good parts to the saving. A value of 0 makes it a pure cost case.

The `dispatch` plan drives only the levels marked as storage. It prices grid flows with their own `price`. Without a `dispatch` section, those storage and grid settings do nothing. Both sections are absent by default.

## Fields

| Field | Type | Required | Default | Unit | Description |
|---|---|---|---|---|---|
| `baseline` | string |  | `""` |  | A scenario name; empty is the model as saved. |
| `horizon_years` | number |  | `5` |  | Years the saving is counted over; a fraction counts its last year pro rata. |
| `discount_rate` | number |  | `0.08` | ratio | Per year, for the NPV. |
| `operating_hours_per_year` | number |  | `4000` |  | The observed window is scaled to this. |
| `margin_per_part` | number |  | `0.0` | money | Money per extra good part; 0 is a pure cost case. |
| `throughput` | string |  | `""` |  | A KPI key counting good parts (a `flatten_kpis` key such as "user/Good parts"); empty is the system's completed entities. |

A field of a nested object is described in the JSON Schema (`naga schema`).

## Example

```json
{"investment": {"horizon_years": 10, "discount_rate": 0.08}}
```

In the Python builder the section is a keyword of `Model`:

```python
from nagasim import build as nb
m = nb.Model(investment={'horizon_years': 10, 'discount_rate': 0.08})
```

## Used in

Bundled models: [Berth: shore power](../../gallery/energy.md), [Hub day: electrifying the ground support equipment](../../gallery/logistics.md), [Container terminal: electrification](../../gallery/logistics.md), [Robot cell against manual assembly](../../gallery/manufacturing.md).

Guides: [Investment case](../../modelling-guide/investment.md).

## See also

- [All sections](index.md), [Model file keys](../schema.md), [Model file format](../../model-file-format.md)
