Hi Xuelang,
OK, I had a little bit more time to look into this.
First of all, I don't like it if you modify my subVIs and repost them without comments with my name on them. If you change something (e.g. the increment step for the numeric partial derivatives), you should indicate it in the diagram, possibly with your name.
If you would simply change the increment back to 1e-6, the fit actually works with your default parameters!
However, there are several issues:If you put a probe on the partial derivative, you'll notice that the partial derivative for B is always zero. Obviously, your parameters are not well balanced. B cannot be determined!
What is the story with your model functions? You test if one of the numbers is less than zero and then use a huge case structure where one of the wires is multiplied by -1 while the rest of the code is duplicated in the other case. You could just replace the "multiply by -1" with an "absolute value" and remove the case structure entirely. You can now even remove the entire FOR loop! 🙂
You should put the E and dE/dt display graph terminals inside event 1, else they get cleared by any other event.
As discussed before, you're surfing dangerously close to the numeric resolution. Your partial derivative for the various parameters differ by 20 orders of magnitude. As discussed before, you e.g. take the forth power of 1e6, then multiply it with 8e-12, etc. My suggestion is still to scale E and dE/dt to the range 0..1, fit it, then adjust the result AFTER the fit according to the scaling factors used. You have a full example implementation of this that I made for you long ago. It IS rock stable and there are no problems with it! 🙂Message Edited by altenbach on 05-28-2005 03:52 PM