This example shows how to use thehyperbolicPenalty
function to calculate the hyperbolic penalty for a given point with respect to a bounded region.
Calculate the penalty value for the point0.1
within the interval [-2
,2
], using default values for thelambda
andtau
parameters.
Calculate the penalty value for the point4
outside the interval [-2
,2
].
Calculate the penalty value for the point0.1
within the interval [-2
,2
], using alambda
parameter of5
.
Calculate the penalty value for the point4
outside the interval [-2
,2
], using alambda
parameter of5
.
Calculate the penalty value for the point4
outside the interval [-2
,2
], using atau
parameter of0.5
.
Calculate the penalty value for the point [-2
,0
,4
] with respect to the box defined by the intervals [0
,1
], [-1
,1
], and [-2
,2
] along the x, y, and z dimensions, respectively, using the default value forlambda
and atau
parameter of0
.
Visualize Penalty Values for an Interval
Create a vector of 1001 equidistant points distributed between -5
and5
.
Calculate penalties for all the points in the vector, using default values for thelambda
andtau
parameters.
Plot the points and add grid, labels and title.