The error “Stack size exceeded limit of 10000 calls” means you have a logical error in your model. E.g. if you model a function and the function calls itself (recursive function). And now the stop criteria is wrong and so the recursion never stops (call itself more than 10000 times).
Perhaps you can analyze the model with the interactive debugger to find the problem.