Sensitivity study: Difference between revisions

From ASCEND
Jump to navigation Jump to search
Restored page from Google Cache, uploaded by John Pye
 
No edit summary
Line 1: Line 1:
<div class="notice metadata" id="outdated" style="border:solid 2pt orange; width:70ex; background-color:#FFEEDD;padding:4px;margin-bottom:6px">''This article is '''outdated'''. You can help out by <span class="plainlinks">[http://ascendwiki.cheme.cmu.edu/index.php?title=Sensitivity_study&action=edit updating it]</span>. ''</div>
{{outdated}}
''This was tested Jun 2009 and an error was returned (<a href="https://ascendbugs.cheme.cmu.edu/view.php?id=409" class="external text" title="https://ascendbugs.cheme.cmu.edu/view.php?id=409" rel="nofollow">bug 409</a>). Needs more testing.''
''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 {{src|models/sensitivity/sensitivity.c}}.
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 {{src|models/sensitivity/sensitivity.c}}.
Line 6: Line 6:
To perform a sensitivity analysis on your model, add the following lines in your MODEL:
To perform a sensitivity analysis on your model, add the following lines in your MODEL:
<source lang="a4c">(* add at the start: *)
<source lang="a4c">(* add at the start: *)
IMPORT &quot;sensitivity/sensitivity&quot;;
IMPORT "sensitivity/sensitivity";


(* add the following into your MODEL declaration: *)
(* add the following into your MODEL declaration: *)
Line 32: Line 32:
Proposed parametric model to help with the above:
Proposed parametric model to help with the above:


<source lang="a4c">IMPORT &quot;sensitivity/sensitivity&quot;;
<source lang="a4c">IMPORT "sensitivity/sensitivity";


MODEL sensitivity_study(
MODEL sensitivity_study(
Line 50: Line 50:
END sensitivity;
END sensitivity;
END sensitivity_study;</source>
END sensitivity_study;</source>
'''Problem:''' inputs for a sensitivity study are often [[FIX|FIXed]], causing problems with this functionality in its present form.
'''Problem:''' inputs for a sensitivity study are often [[FIX|FIXed]], causing problems with this functionality in its present form.


[[Category:Outdated]]
[[Category:Documentation]]
[[Category:Documentation]]

Revision as of 05:00, 2 November 2010

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 *)

METHODS
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.