My function is not reading my inputs from the main script. When i run the main script, I get the problems. The common problems are; 'Not enough input arguments', 'too many input arguments' and the third thing is that it is not reading some inputs from the main script when the main script calls the function.
My original intention is for the functions to read every input from the main script but as this was giving me too may problems, I decided to copy all the constants to all the scripts and reduce the inputs to the functions to only the ones that changes. This makes the functions look so lengthy though.
I am uplading five files (a script and 4 functions). When I run the script, the above error message appears. What is really the problem?
main_NMPC_tal_AGL is the main script, Integer_S computes the DAE systems, cfunNMPC computes the nonlinear constraints for the fmincon, CostNMPC computes the cost function and sstate computes the system steady state at each point (kept fixed here).
The file are attached in the link here.
Thanks