Hello everyone,
i have an issue with the attached code. the idea is to run an optimization problem that minimize the absolute error between the piecewise-linear approximation of an exponential function and the function itsself (given, as input, the number of points). the program works with 3 points, but for a higher number, i obtain the “domain error in nonlinear function”.
can you help me to fix the problem?
optimization_prob.txt (2.3 KB)