Stefan Kuntsche, Sanam Sabeti Adibpour

The Rosenbrock Function is well suited as testing problem. For two variables it has the form

$latex f(x,y)=(1-x)^2+c\cdot (y-x^2)^2$

This function will now be used as a learning problem. To do this, the two dimensional optimisation problem in equation (\ref{eq.rosenbrock.one}) is transfered into a two dimensional root finding problem.

$latex a\cdot(1-x) = 0$

$latex b\cdot (y-x^2) = 0$

In the following section, a way to solve this problem in MOSAICmodeling is described. It is assumed that you are already logged in to MOSAICmodeling and see the modeling environment in your browser.

###### Creating the Notation

At first it is necessary to create a notation that contains descriptions for all symbols used for the names of the variables, i.e. **a**, **b**, **x** and **y**. To create the notation do the following

- Select the
in the Editor Bar on the top.`Notation Editor` - Choose the tab
and use the`Base Names`button to enter the letters one by one, giving a description for each of them.`[add]` - Click
to open a file selection dialog.`[save]` - In the dialog press
and create a new package named ‘example_rosenbrock’ and change into it afterwards.`[New package]` - Save the notation (e.g. ‘notation_rosenbrock’).

###### Creating the equations

- Make the
visible by choosing it in the Editor Bar on the top.`Equation Editor` - On the editor you find a field named
. Click on`Notation`and select the notation you just created in the upcoming dialog.`[Change]` - Now you have to enter a text into the field
.`Description` - In the field
you enter the mathematic formula for the equation. Please type the following into the field:`MosaicLatex`0=a \cdot (1-x)

- Click on
to create MathML code. The rendered MathML expression is shown in the`[Render]`area at the buttom of the Equation Editor.`MathML Preview` - Save the new equation in the package you just created for this example.
- Click
to clear the equation editor.`[New]` - Create a second equation, loading the same notation and using the latex code
0 = b\cdot ( y - (x)^{2} )

###### Creating the equation system

- Choose the
in the Editor Bar on the top.`EQSystem Editor` - First load the notation for this example in the same way it was done in the Equation Editor.
- Activate the tab
and click`Connected Elements`.`[add]` - In the appearing dialog, click on
next to the upmost field and select the first example for the Rosenbrock example.`[Change]` - Click
`[Submit]` - Add the second equation in the same way.
- Go to the tab “Description” and add an explanatory text for the equation system.
- Save the equation system in the package for this example.

**Evaluating the equation system **The evaluation of an equation system does two things: Firstly all necessary information is specified so that a complete simulation problem is formulated based on the equation system. Secondly code for the solution of the problem is generated and executed.

- Choose
in the Editor Bar.`Evaluation Editor` - In the tab
click on`Equation System`and select the equation system that has been created in the last steps.`[Change]` - In this example you can directly go to the tab
. There you see a list that contains all the variables of the equation system.`Variable Specification` - Move the variables
and`a`over into the list for the`b`by selecting them with the mouse and using the`Design Variables`button. You will note that the`[>>]`is automatically updated.`Degree of Freedom` - Set the design variables
and`a`by clicking into the value field.`b` - Go to the tab “Description” and add an explanatory text for the evaluation.
- Save the evaluation in the package for this example.
- Change to the
tab. If everything is ok, the`Evaluation`button should be activated. (Otherwise please have a look at the`[Generate Code]`in the middle of the editor where you find hints to solve the problem).`Status of Information` - In the drop down list
select the code generator`Code Gen`.`GSL Hybrid` - To create the problem solving code press
.`[Generate Code]` - Press
to have the code executed on the server.`[Evaluate]` - Select the tab
to have a look at the solution.`Results`