This example shows how to use the hyperbolicPenalty
function to calculate the hyperbolic penalty for a given point with respect to a bounded region.
Calculate the penalty value for the point 0.1
within the interval [-2
,2
], using default values for the lambda
and tau
parameters.
Calculate the penalty value for the point 4
outside the interval [-2
,2
].
Calculate the penalty value for the point 0.1
within the interval [-2
,2
], using a lambda
parameter of 5
.
Calculate the penalty value for the point 4
outside the interval [-2
,2
], using a lambda
parameter of 5
.
Calculate the penalty value for the point 4
outside the interval [-2
,2
], using a tau
parameter of 0.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 for lambda
and a tau
parameter of 0
.
Visualize Penalty Values for an Interval
Create a vector of 1001 equidistant points distributed between -5
and 5
.
Calculate penalties for all the points in the vector, using default values for the lambda
and tau
parameters.
Plot the points and add grid, labels and title.