June 16, 2016

Parameter Fit as a Run-Ready Workflow

Updated 20.12.2018

Every day we strive to simplify working in pSeven for our users. No matter how complex the task is, pSeven enables workflow experts to prepare some frequently used computation in the form of a run-ready workflow, simplifying the problem for their colleagues by creating a user-friendly pSeven-based application for this specific task. Of course, this approach requires a lot of flexibility from the system, both in run-time computation (which is achieved by generic blocks like PythonScript or Program block) and in visualization (see Custom visualization with PageViewer). Our goal is to give experts the opportunity to capture their knowledge in an easily reusable form.

Let us see how you can create a run-ready workflow for a generic computation problem. Suppose you have a 1D sample that must be fit by some function (curve) with several parameters. For maximum flexibility, we will treat this function as a custom expression y=f(x, A, B, C, ...) with an unknown number of parameters to tune. Fitting is performed using a non-linear least squares method that requires solving a potentially non-trivial optimization problem depending on the fit expression.

The workflow solving this problem contains 3 main parts. The first one is input validation, so incorrect parameter input will produce clear diagnostic messages. Then we go into an optimization loop that actually performs fitting, using pSeven's capabilities for global optimization. The final part consists of a few visualization blocks that generate images to be shown on the Analyze screen.

Figure 1. Workflow on the Run screen

As it is a run-ready workflow, you can configure it directly from the Run screen without editing the workflow itself. Not only this simplifies the configuration as you see only the relevant parameters (selected by the expert), but also enables using the workflow in pSeven Runner. On the Run screen, you can select a sample file and specify the fitting function (Figure 1, [1]). Then you run the workflow and see found parameter values in the Outputs pane (Figure 1, [2]). For more details, you can also switch to the Analyze screen to see how the solution evolved over time (Figure 1, [3]).

Figure 2. Visualization using Page Viewer

In Analyze you find the full process history including the fit visualization, the current fit expression and parameter values (Figure 2, [1]). You can browse through optimization steps using the page selector (Figure 2, [2]). Note that just like the workflow, the report is also pre-configured by an expert to immediately show the most important aspects of the solution.

This workflow can be found in the example projects bundled with the recent pSeven 6.7 release. Like every other run-ready workflow, it can be used both as a ready problem-solving tool and as a starting point for your own run-ready workflows.

Figure 3. Parameter fit solution 

Interested in the solution?

Click to request a free 30-day demo.

Request demo