Treatment of Unknown Functions
- Functions and their derivatives are declared by user via a keyword
- Functions are *.m files or Matlab primitives or the the function is declared by the user but the derivative isn't provided we must call a numerical derivator
- these functions have an arbitrary number of arguments
- this can only be implemented for first or second order derivatives
- it is necessary to know if we are dealing with first or second derivatives to call the right numerical derivator
- the numerical derivator (jacobian or hessian) returns an array
- each derivative is function of the derivatives of the arguments and the derivatives of the function
- Example:
F(y_1,y_2,...,y_k) D(F,x_i) = D(F,y_1)*D(y_1,x_i)+D(F,y_2)*D(y_2,x_i)+...D(F,y_k)*D(y_k,x_i) D^2(F,x_i,x_j) = D^2(F,y_1,y_1)*D(y_1,x_i)*D(y_1,x_j)+...+D^2(F,y_1,y_k)*D(y_1,x_i)*D(y_k,x_j)+..+D^2(F,y_k,y_k)*D(y_k,x_i)*D(y_k,x_j) +D(F,y_1)*D^2(y_1,x_i,x_j)+...+D(F,y_k)*D^2(y_k,x_i,x_j)
- Example:
- because the number of arguments and derivatives are arbitrary, it is necessary to introduce some sort of array type in the parser