Slider
A Slider is a form object for choosing numerical input using a slider control.
Using a Slider to Change the Properties of a Tubular Reactor
The following example is from the Tubular Reactor Surrogate Model app, available in the Application Libraries under COMSOL Multiphysics.
The figure below shows the user interface of the app where three slider objects are used to control the Activation energy, Thermal conductivity, and Heat of reaction, respectively, of the embedded tubular reactor model.
The Settings window of the first slider is shown in the figure below.
In this example, the slider uses a global parameter E, representing the Activation energy, as its source. You can select any parameter, variable, or declared scalar variable as a source. Select from the application tree and click Use as Source.
You determine the range of values for the data source by defining the Minimum value, Maximum value, and Number of steps for the slider. The Orientation can be Horizontal or Vertical. You can also set a Tooltip that is shown when hovering over the slider. The Append unit to number option lets you associate a unit with the slider. This unit is appended to the number using the standard bracket notation, such as [N], before being passed as a value to the source variable. As an alternative to Append unit to number, you can choose Append unit from unit set. See Unit Set for more information.
In the Initial value list, select From data source or Custom value for the initial value for the slider.
In the Events section, in addition to specifying which method to call for an On data change event, you can select the Trigger while dragging checkbox. This setting determines if the event method should be called continuously while the slider is being dragged or only upon its release.
This checkbox can be cleared if the method that is called by the On data change event is computationally heavy, so that there is a lag when dragging the slider.