Stefan Kuntsche, Sanam Sabeti Adibpour

The following tutorial will show you how to describe and solve differential equation systems.

**ODE – The Van der Pol Oscillator**

First, the Van der Pol Oscillator will be implemented. The problem is stated as follows:

**Equation System Van der Pol**

**Notation Diff Eqs**

Base Names:

[table sort=”desc,asc”]

Name,Description

a,parameter a

t,differential variable t

x,value x

y,value y

[/table]

**Evaluation**

- Design value

- Differential variable and initial values for the state variables

in [0, 20]

**Requirements** It is assumed that you have basic knowledge about Notations, Equations, and Equation Systems in MOSAICmodeling. If you do not know how to create and modify these model elements, please work through ` Notations and Variables` first.

##### Creating the Notation

- Create a Notation and enter the names as
. If you need help, please follow**Base Names**in the tutorial**Creating the Notation**.**Notations and Variables** - Note that the differential variable
*t*is part of the notation as well. As far as the Notation is concerned, there is no difference between the identifiers*a*,*t*,*x*, and*y*.

##### Creating the equations

- In MosaicLatex there is a special command for the differential operator.To create
**\frac{dA}{dB}**please use the code:\diff{A}{B} - In the current version, MOSAICmodeling only allows first order ordinary differential equations. The differential operator must be on the left hand side.
- Enter the equations one by one as described in the tutorial
.**Notations and Variables** - If you had problems in entering the correct code, use the following

For Equation one:

\diff{x}{t} = y

For Equation two:

\diff{y}{t} = a \cdot (1-(x)^{2})\cdot y - x

##### Creating the equation system

- The equations can be added to an equation system in the usual way. If you need help, please refer to
in the tutorial**Creating the equations**.**Notations and Variables**

##### Evaluating the equation system

- Load the equation system in
and go the tab named**Evaluate**. If you need help, refer to the tutorial**Variable Specification**.**Notations and Variables** - You will note that
*x*and*y*are already sorted into the table namedwhile the differential variable**State Variables***t*is put correctly into a corresponding section on the right hand side of the user interface. - Enter the initial values for the state variables and the value for the design variable as stated above in the paragraph
of the problem description.**Evaluation** - Enter the limits of the interval of the differential variable
*t*in the fields namedand**Diff Var Start**.`Diff Var End` - Go to the tab named
and make sure that the language specificator**Evaluation**is activated in**C++ BzzMath ODE Stiff**dropdown list. Press**predefined Language Specification**and then**[Generate Code]**to solve the equation system on the modeling server.**[Evaluate]** - Select the tab
. In the now visible section select the tab**Results**. Here you find the trajectory list for the differential variable and the state variables.**DE Variable Values** - Select the tab
and tick the boxes for**DE Plot Results***x and*in the column*y*of the variables table.**Plot**