LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fitting real data to a transfer function model

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.  

0 Kudos
Message 1 of 6
(2,756 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,753 Views)

this is my first time on these forums so did not know you could do that! thanks.

0 Kudos
Message 3 of 6
(2,751 Views)
I have come up with a solution that works well. Problem solved !
0 Kudos
Message 4 of 6
(2,711 Views)

Hi Tzeng,

 

this forum is for "live and let live"...

 

Do you mind to present your solution, so others may benefit?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 6
(2,709 Views)

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. 

0 Kudos
Message 6 of 6
(2,698 Views)