This equation format aims at simplifying the way to write oscillation equations. With this format equation are written in there mathematical expression after projection on the spherical harmonics.
Here is an example of such equation if the 1D case:
lh*(lh+1) * Et =
avg(r/Gamma1) * dP_P +
avg(r) * Er' +
2 * Er
with (r=1)
dr(Er, -1) = lh * dr(Et, -1)
at r = 0
Note
TOP solves eigenvalue problems. Therefore equations written for TOP must be linear.
At the beginning of an equation file, one is able to define several parameter that can be used within the definition of equation. These parameters can be defined with the input keyword, followed by its type (double, int or string) ant its name:
Example: |
---|
input double mass
input double rota
In order to understand the meaning of the equation to appear, TOP’s compiler need to know what are the variables of the problem, and what are the field of the model.
In order to define variables of the problem, one has to define them using the var keyword followed by a comma separated list of names.
Note
2 or 3 variables surrounded by parenthesis means that they are component of vector.
Example: |
---|
var Phi, PhiP, (Er, Et), dP_P
Will define 5 variables, Er and Et being first and second component of a vector.
In the same way variables can be defined, fields and scalar defined from the stellar model can be defined with field or scalar keywords:
Example: |
---|
field pm, g_m, r, rhom, dg_m, rhom_z
scalar Gamma1, Lambda
After the definition/declaration section, we can start defining the equation after the in keyword.
In order to add an equation in the system, one can use the equation keyword, followed by the name of the equation, followed by a : (colon) and the expression of the equation.
Example: |
---|
equation eqdP_P:
lh*(lh+1) * Et =
avg(r/Gamma1) * dP_P +
avg(r) * Er' +
2 * Er
Note
Every identifier (i.e., name) involved in an equation need to be defined (either as a variable, a field or a scalar or a parameter).
In order to define boundary condition, one simply need to define of after the equation with the following syntax:
Syntax: | with (r=numerical_location) epxression at r = location where:
|
||||||||
---|---|---|---|---|---|---|---|---|---|
Example: |
equation eqdP_P:
lh*(lh+1) * Et =
avg(r/Gamma1) * dP_P +
avg(r) * Er' +
2 * Er
with (r=1)
dr(Er, -1) = lh * dr(Et, -1)
at r = 0
A few functions and variables are already defined with TOP and can be used without prior declarations, here is a list of such symbols:
fp: |
|
---|
dr: |
Note Radial derivatives can also be expressed with the ' (apostrophe) post-fixed operator: dr(Phi, 2) and Phi'' are two notations strictly equivalent. |
||||||
---|---|---|---|---|---|---|---|
avg: |
|
Comments can be added in equation file using a pound sign (#), the remaining of the line will be ignored.
Example: |
---|
# define the first equation
equation eqdP_P:
lh*(lh+1) * Et = # this is the LHS of the equation
avg(r/Gamma1) * dP_P + # this the RHS
avg(r) * Er'