Sensitivity study

Jump to: navigation, search

This was tested Jun 2009 and an error was returned (bug 409). Needs more testing.

ASCEND provides the ability to perform sensitivity studies on your model. The approach currently implemented requires you to make some minor changes to your model, and then utilises and external method to perform the calculation. The implementation is in models/sensitivity/sensitivity.c.

To perform a sensitivity analysis on your model, add the following lines in your MODEL:

(* add at the start: *)
IMPORT "sensitivity/sensitivity";

(* add the following into your MODEL declaration: *)
m, n IS_A integer_constant;
m := (* number of output parameters you want to study *)

n := (* number of input parameters you want to study *)
X[1..m] IS_A solver_var; (* outputs *)

U[1..n] IS_A solver_var; (* inputs *)
dX_dU[1..m][1..n] IS_A solver_var; (* data space *)

Then, you must ARE_THE_SAME the input parameters X[1], X[2], etc with variables already present in your model. Do the same with the output parameters, also.

Finally, add the following METHOD to your model:

METHOD sensitivity;

    EXTERNAL do_sensitivity(SELF,U[1..n],X[1..m],dx_du[1..m][1..n]);

END sensitivity;

Now, once you have loaded your model and solved it, you can run the 'sensitivity' method on your model. You will then be able to inspect the sensitivities of your 'output' variables to your 'input' variables, by examining the values in the calculated matrix dX_dU.

Proposed parametric model to help with the above:

IMPORT "sensitivity/sensitivity";

MODEL sensitivity_study(
	n_in WILL_BE integer_constant;
	n_out WILL_BE integer_constant;

	out[1..n_out] IS_A solver_var; (* outputs *)

	in[1..n_in] IS_A solver_var; (* inputs *)
	deriv[1..n_out][1..n_in] IS_A solver_var; (* data space *)

METHOD sensitivity;
    EXTERNAL do_sensitivity(SELF,in[1..n_in],out[1..n_out],deriv[1..n_out][1..n_in]);

END sensitivity;
END sensitivity_study;

Problem: inputs for a sensitivity study are often FIXed, causing problems with this functionality in its present form.