This is a script file.
0001 classdef matRad_MinMaxEUD < DoseConstraints.matRad_DoseConstraint
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 properties (Constant)
0022 name = 'EUD constraint';
0023 parameterNames = {'k','EUD^{min}', 'EUD^{max}'};
0024
0025 parameterTypes = {'numeric','dose','dose'};
0026 end
0027
0028 properties
0029 parameters = {5,0,30};
0030 end
0031
0032 methods
0033 function obj = matRad_MinMaxEUD(exponent,eudMin,eudMax)
0034
0035 if nargin == 1 && isstruct(exponent)
0036 inputStruct = exponent;
0037 initFromStruct = true;
0038 else
0039 initFromStruct = false;
0040 inputStruct = [];
0041 end
0042
0043
0044 obj@DoseConstraints.matRad_DoseConstraint(inputStruct);
0045
0046
0047 if ~initFromStruct
0048
0049 if nargin == 3 && isscalar(eudMax)
0050 obj.parameters{3} = eudMax;
0051 end
0052
0053 if nargin >= 1 && isscalar(exponent)
0054 obj.parameters{1} = exponent;
0055 end
0056
0057 if nargin >= 2 && isscalar(eudMin)
0058 obj.parameters{2} = eudMin;
0059 end
0060 end
0061 end
0062
0063
0064
0065 function s = struct(obj)
0066 s = struct@DoseConstraints.matRad_DoseConstraint(obj);
0067
0068 end
0069
0070 function cu = upperBounds(obj,n)
0071 cu = obj.parameters{3};
0072 end
0073 function cl = lowerBounds(obj,n)
0074 cl = obj.parameters{2};
0075 end
0076
0077 function cDose = computeDoseConstraintFunction(obj,dose)
0078 k = obj.parameters{1};
0079 cDose = mean(dose.^k)^(1/k);
0080 end
0081
0082
0083 function cDoseJacob = computeDoseConstraintJacobian(obj,dose)
0084 k = obj.parameters{1};
0085 cDoseJacob = nthroot(1/numel(dose),k) * sum(dose.^k)^((1-k)/k) * (dose.^(k-1));
0086 end
0087 end
0088
0089 end
0090
0091