07-22-2012 02:30 AM
Hi, I asked this question a few days ago. I was not sure if I made myself clear, so I'm posting this again with my quesiton phrased differently.
Essentially I have a RC circut (two resistors, one capacitor) that represents the circulation. My input is blood pressure and my calculated output is blood flow. I also have recorded blood flow and want to fit the recorded blood flow to the calcuated blood flow to determine which values of R and C give the best fit.
The step I am unsure about (new to the control design and simulation toolkit) is how to write the tranfer function as a VI that I can wire to the nonlinear curve fit VI.
07-22-2012 02:34 AM
Hi Tzeng,
so why do you create a new thread? Why not just write a new message to your old thread to bump it up?
07-22-2012 02:49 AM
this is my first time on these forums so did not know you could do that! thanks.
07-25-2012 07:29 AM
07-25-2012 07:40 AM - edited 07-25-2012 07:40 AM
07-25-2012 04:56 PM
Hi GerdW thanks for the prompt.
So it turns out there had been a couple of threads related to this in the past but none that specifically stated how to do the fitting.
First thing is you need the Control and Simulation toolkit. The fitting can be done using the SI Estimate User-Defined Model.vi (you can find this under NI_SysID.lvlib).
You simply wire your recorded input and output (for an SISO system) and call your user defined model, which has to be written as a seperate vi. For my application I found it easiest to just rewrite the tranfser function model (a simple RC circut) as an ordinary differential equation using the formula node (for an example see http://www.ni.com/white-paper/13763/en) within a control and simulation loop. the error minimisation works well and I'm getting very good fits.