I'm working on a nonlinear optimization problem where I have a decision variable representing my product's price (P_m) and a constant representing my competitor's price (P_c). I want to introduce a penalty into my objective function when my price exceeds the competitor's price.
My goal is to penalize based on the percentage (I optimize a log(profit) function, hence removing a percentage is intuitive from a decision maker point of view) by which my price exceeds the competitor's, but have no penalty if my price is equal to or less than the competitor's. I don't want to solve it via a piecewise linear function as I want to use IPOPT solver. The idea is to similate this behavior if $$Penalty= \lambda* (P_m - P_c)/P_c \:if \: P_m > P_c \: else \: 0 $$
Is there a way to model this penalty in a continuous and differentiable manner suitable for IPOPT?