Sensitivity analysis
----------------
### Introduction
Artelys Crystal Super Grid can be used to perform sensitivity analysis, which involve assessing the influence of
variations in key input parameters on the results of a specific energy scenario.
### Duplicating the reference context
To perform a sensitivity analysis with ACSG, create a new study and import your reference context into it. Then,
duplicate your reference context by clicking  next to its name in
the home view:

Next, give your context a unique name and select the study that contains your reference context. It is not necessary to
duplicate results, so you may unselect this option:

You now have a copy of your context available for modifications.
.. warning::
Be careful not to have too many contexts within a single study, as this could significantly degrade the tool's
performance, especially if the contexts are large. To maintain optimal performance, it is recommended to
regularly delete outdated contexts and studies.
### Modifying the new context
Ensure both the reference and sensitivity contexts are selected and open the study.

You can now **modify some parameters of your context** by editing an asset in the [Map view](../views/map.md) or in the
[Parameter tables](../views/parameter_tables.md). Ensure that you've selected the sensitivity context and locked your study
before making any changes on either of these views. It is also possible to import a new timeseries.
.. warning::
A timeseries cannot be imported if it has the same name as an existing timeseries in the context. Ensure the name of
the relevant attribute in the corresponding asset is updated to match the new timeseries' name, or the new
timeseries will not be taken into account.
Then, **launch the optimization** of your sensitivity contexts (and your reference context as well, if optimization
results are not yet available) from the [Operations view](../views/operations.md).
### Analyzing the results
Use the KPIs from the [Indicators view](../views/indicators.md) to **compare the two contexts**.
To visualize the difference between the sensitivity and reference contexts for a given KPI, use the **Calculated
values** feature in the KPI view: in the right-hand side of the Indicators view, under "Data", click on "context" and
select "Calculated values".
Next, click on , choose your two
contexts, select the "Subtraction" operation, and confirm:

For instance, if "Operand #1" is the sensitivity context, and "Operand #2" is the reference context, the KPI
"Production" will now display the difference between the production in the sensitivity context and the production in the
reference context:

For further information about the Indicators view, please refer to the [Indicators view documentation](../views/indicators.md).