Text this: Optimal control of cast molding at casting under regulated pressure