private void OnSolveClicked() { var funcModel = FunctionInputViewModel.GetModel(); var constraints = ConstraintsViewModel.GetModel(); var initial = InitialVariableViewModel.GetModel(); var solver = new PenaltyMethodSolver(funcModel, constraints, initial); var solutionModel = solver.Solve(); SolutionViewModel.ApplyModel(solutionModel); var problemModel = CreateProblemModel(funcModel, constraints, initial, solutionModel, ConstraintsViewModel.GreaterThanZero); HistoryViewModel.Add(problemModel); }