02-06-2017 05:30 AM - edited 02-06-2017 05:39 AM
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.
02-06-2017 05:41 AM
02-06-2017 09:17 AM
sure, thank you!
05-01-2017 04:36 AM
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 🙂