Fit Basic Operations
This guide explains how to use the current Fit module implementation.
Before You Start
Prepare the following items first:
- A function-value entity, such as
y. - One or more variable entities, such as
xandz. - Reasonable ranges, default values, and units for each variable.
- Coefficients with initial values and bounds.
Recommended naming:
- Use ASCII identifiers for variables and coefficients, for example
x,temp,a1,k_abs. - Do not reuse the same name as both a variable and a coefficient in one expression.
Screen Layout
The Fit workspace has four main areas:
- Expression editor.
- Coefficient and variable configuration area.
- Data table and chart area.
- Right-side action buttons.
Step 1: Define the Main Expression
Enter the expression in the editor, for example:
a * x + b
After you type, the module validates automatically and shows:
- Whether the expression is valid.
- Referenced variables.
- Referenced coefficients.
- Unknown identifiers.
- The normalized expression.
If validation fails, fix the expression before continuing.
Step 2: Configure Coefficients
For each coefficient set:
- Symbol.
- Current value.
- Minimum value.
- Maximum value.
- Whether it should be fitted.
Best practices:
- Use an initial value close to the expected solution.
- Avoid overly wide bounds unless you truly need them.
Step 3: Bind Variables
Add the variables used by the expression and bind them to variable entities.
The module uses the bound entity metadata during inversion and optimization, including:
- Default value.
- Lower bound.
- Upper bound.
- Scale.
- Unit.
Step 4: Fill the Data Table
The data table contains:
- A calculated-value column.
- An actual-value column.
- One column per variable.
Common usage patterns:
- For forward calculation, fill the variable columns.
- For coefficient fitting, fill the variable columns and actual-value column.
- For target inversion, fill the actual-value column; the variable columns can optionally hold initial guesses.
Right-Side Actions
Calculate
Use Calculate to evaluate the current expression against the current coefficients and variable samples.
Result:
- The calculated-value column is updated.
- The result window shows a summary and predicted-value preview.
Fit
Use Fit to estimate coefficients from the observed values.
Result:
- The coefficient panel is updated with fitted values.
- The result window shows fitting diagnostics.
Target Inversion
Use Target Inversion to solve variables from target function values.
Result:
- Variable columns are written back row by row.
- Both single-variable and multi-variable models are supported in the current implementation.
Multi-Target Optimization
Use Multi-Target Optimization when you want to solve variables against several weighted objectives.
The target editor below the main expression supports:
- Target expression.
- Target value.
- Weight.
You can also use the button to copy the current main expression into empty targets.
Before solving, check the optimization-target validation messages. Every target must be valid and every weight must be greater than zero.