I'm sorry for the vagueness of the previous post. I'll try to explain my issue a little bit better.
The minimization algorithm seems to work correctly. If I simply try to plot the simulation obtained with the values returned by the minimization algorithm, the result looks very convincing.
My problem arises when I try to get a runtime visualization of the result of the simulation at the end of each iteration.
Written the way I posted the code is creating a tkinter window as expected, but it's empty and immediately close after the end of the execution. I've also tried not to use Tkinter, sticking to the only use of matplotlib. The code looks pretty much like this (just noticed in the last code there's a comment about '3 different sets of experimental data' that has no sense but comes from a wrong copy and paste):
https://gist.github.com/anonymous/4bc727d68872fb70a680In this case the line is not updated and remains as it is initialized. (I tryed also other combinations including the use of .draw() instead of .plot() but still nothing solved my problem).
A solution including Tkinter would be preferred since this way it will be easier in the future to move the implementation inside a GUI, but any other solution to my problem is fine.
Thanks again for the help.
Best Regards,
Fabio