I would like to be able to monitor the standard deviation of a certain variable or variables as monitor
points from the Solver Manager during a run on either 2D or 3D locators.
How can I do this?
The following approach will work for a nodal based standard deviation calculation on either 2D or 3D mesh regions, domains, or boundaries:
1. Define an algebraic additional variable used to help calculate the number of nodes on the desired region
(necessary since count ()@ isn't available for the solver):
i.e. unity (dimensionless) = 1.0
2. Define an expression for the number of nodes on the desired region:
For a 3D mesh region, this could be something like:
Ntotal = sum(unity)@REGION: B3.P4
or for a 2D boundary named out, it could be:
Ntotal = sum(unity)@out
3. Define an expression for the mean value of the desired variable (T in this example):
Tmean = sum(T)@REGION: B3.P4/Ntotal or:
Tmean = sum(T)@out/Ntotal
4. Define another algebraic additional variable to represent the squared difference between the variable for
which the SD is desired and the mean value. This will have units of the variable^2. For example, for T, define
this variable using the expression:
Tdiff2 = (T - Tmean)^2
5. Define the variance for the variable as the expression:
Variance = sum(Tdiff2)@REGION: B4.P3/(Ntotal -1) or
Variance = sum(Tdiff2)@out/(Ntotal - 1)
6. Define an expression for the SD as:
SD = sqrt(Variance)
You can now create monitor points for the variance and standard deviation expressions. The values will be based on the nodal counts and nodal averages of the variables on the locators.
See attached files for an example.