Add a custom calculation¶
A custom calculation derives a new value for every Attitude from its forces, monitors and parameters, for example a ratio or a combined coefficient. Bramble works it out on the server and shows it as a column in the Results table.
Before you start
- Select a Programme and a Project, and open the Results page.
- Calculations belong to the Project. Everyone with access to the Project can see and use them.
Create a calculation¶
- On the Table View card, click Edit Table, then go to the Calculations tab.
- Click Create New Calculation. The Create Calculation dialog opens.
- Enter a Column Name (see naming rules).
- Build the equation in the box on the left. Type it, or use the variable pickers and the keypad to insert variables and functions at the cursor.
- Decide whether to keep Require All Variables ticked (see missing values).
- Click Create.
- On the Calculations tab, tick the calculation's checkbox to add it to Selected Columns.
- Click Apply, then save the View.
While Bramble works out the values, the calculation's row shows "Evaluating".
Write the equation¶
Variables¶
Insert variables with the pickers on the right: Parameters, Forces, Moments, Balances, Areas, Monitors, Thermal, Probes, Zones and Other. Each picker has a filter box.
- Force and monitor variables use the mean value.
- Parameters, both Attitude parameters and Map parameters, are inserted with a
_paramsuffix, for exampleRide_Height_param. - Pick From switches between Standard and Baseline. With Baseline, the pickers insert the same
variables with a
Base_prefix. See baseline variables.
Using the pickers is the safest way to get variable names exactly right.
Operators and functions¶
Use +, -, * (or the keypad's x), / (÷), ^ for powers, and brackets. Numbers can use e notation,
for example 1.5e-3.
These 11 functions are supported:
| Function | Meaning | Keypad |
|---|---|---|
sin(x) |
Sine | sin |
cos(x) |
Cosine | cos |
tan(x) |
Tangent | tan |
asin(x) |
Inverse sine | sin⁻¹ |
acos(x) |
Inverse cosine | cos⁻¹ |
atan(x) |
Inverse tangent | tan⁻¹ |
log(x) |
Natural logarithm | ln |
log10(x) |
Base-10 logarithm | log10 |
exp(x) |
e to the power x | eˣ |
sqrt(x) |
Square root | √ |
pi |
π | pi |
Trigonometric functions work in radians.
Warning
Only these functions are evaluated. Others, such as abs, min, max or round, are accepted by the dialog,
but the result is always -.
The keypad also has x², x³, 1/x and ±, which wrap the current selection, plus DEL and C. The history icon shows equations from this session, and the copy icon copies the equation to the clipboard.
Syntax rules¶
- Don't start with an operator. Write
0-x, or use ±, which gives(-(x)). - Always write the multiplication sign:
2*(a+b), not2(a+b), and(a+b)*c, not(a+b)c. - Functions need brackets:
sqrt(x), notsqrt x. - No empty brackets
(). - The equation must use at least one variable, and can be up to 1,000 characters.
Create stays disabled until the calculation is valid. Hover over it to see why:
| Message | Fix |
|---|---|
| "At least one metric is required" | Add a variable |
| "Equation is invalid" | Check the syntax rules above |
| "Name is invalid" | Check the naming rules below |
Naming rules¶
The Column Name:
- is required, up to 64 characters
- can use letters, numbers, spaces,
_and these symbols:- / \ [ ] ( ) { } < > , . # ! @ % ^ & * ' " | ~ + = : - must be unique in the Project. A duplicate name fails with "Could not create calculation".
The name is also the column's default header in the table.
Missing values¶
Require All Variables decides what happens when a variable in the equation has no value for an Attitude, for example a monitor that one Run doesn't have.
| Require All Variables | Result |
|---|---|
| Ticked (the default) | The calculation shows - for that Attitude |
| Unticked | The missing variable counts as 0 |
Baseline variables¶
A Base_ variable takes the value from the Attitude's own Run baseline: the matching Attitude on the Baseline
Run chosen when the Run was created (see create a Run). For example, if
X is a force variable, X - Base_X is its change from the baseline.
If the Attitude has no baseline, a calculation that uses Base_ variables shows -.
Where the values appear¶
- Values appear in the calculation's column. Format it like any other column in Column Options: new calculation columns start with 3 decimal places. See format columns.
- Inline deltas work as for other columns. See compare against a baseline.
- Bramble works out the values for every Attitude in the Project whose results have been processed, and for new Attitudes as their results are processed. Calculations that only use parameters are worked out before solving.
- When you change the equation or Require All Variables, Bramble works out the values again.
- Re-process Calculation works out the values again for the whole Project.
- In a Sandbox or Load By Date results, rows from other Projects use the current Project's calculations.
Manage calculations¶
Each row on the Calculations tab has these actions:
| Action | Does |
|---|---|
| Edit Calculation | Opens Update Calculation. Click Update to save |
| Create Copy | Copies it in the same Project, named <name> (Copy 1) |
| Delete Calculation | Deletes it straight away |
| Re-process Calculation | Works out its values again |
Warning
- Delete Calculation has no confirmation. The calculation is deleted as soon as you click.
- Views find calculations by name. Renaming a calculation can break other saved Views that use it: their
column shows
-until you add the renamed calculation to them again.
Use calculations in other Projects¶
Because a View finds calculations by name, a View that uses a calculation only shows values in Projects that have a calculation with the same name. To bring calculations across:
- On the Calculations tab, click Copy From Another Project.
- Choose the Programme and Project to copy from.
- Tick the calculations to copy. Any that already exist in this Project are disabled ("This calculation already exists").
- Click Submit.
Related: Create a table view · Compare against a baseline · Results and post-processing