LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write formula_curve fit _Diffusion

Hello,

I normally fit the curves linearily with the help of a simple formula node with variables. I want to fit water absorption data curves using the attached equation, for example, with the help of mathscript node. I cannot give in the summation notation Σ from n=1 --> infinity, and I'm not sure if it would work that way. Is it possible? If not, how can I alternatively fit the curve. 

Thank you

S.S.

 

0 Kudos
Message 1 of 4
(2,440 Views)

Hi Sarah,

 

do you mind to attach some sample data?

A VI containing a data plot of your curve?

Best regards,
GerdW


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

sure, thank you!

0 Kudos
Message 3 of 4
(2,386 Views)

Hi Sarah,

 

The MathScript node uses the C++ syntax. In this regard, you can simulate the summation notation from n = 1 to +inf by using a for-loop in your code. Since LabVIEW can't interpret +inf as a reasonable parameter of the for-loop (basically your for-loop will never stop), I would suggest you to use a large enough number instead of +inf. 

 

I attached a VI Snippet to show you how to code a sigma notation. In this example, I used the reciprocals of square numbers, which produces a convergent series; also known as the Basel Problem. As you can see by using a "large enough number" (e.g. 9999), we can reach a very good approximation to the exact sum, which is "PI^2 / 6".

 

Hope this helps. Let me know if you have further questions 🙂

0 Kudos
Message 4 of 4
(2,190 Views)