10-29-2024 11:50 AM
Thanks for all the support, but there seems to be a misunderstanding. I'm not taking a coding course—this is just an off-the-books assignment from the professor I’m doing research under. He only uses LabVIEW and apparently gives this assignment to students doing research under him every now and then.
P.S. He instructed me to try implementing this using a stacked sequence structure and local variables. I’m getting outputs, but they’re slightly off. For example, I’m seeing outputs like 1, 2.5, 7, 19.08, which are close but clearly not accurate enough. I think it might have to do with how I’m adding my terms. I’ll post pictures of my work once I can get back to the computer that has it
10-29-2024 12:08 PM - edited 10-29-2024 12:26 PM
@GradTA wrote:
P.S. He instructed me to try implementing this using a stacked sequence structure and local variables.
Really bad advice! Don't do it!!!!!!
(I can only imaging a stacked sequence with e.g. 50 near identical frames (for 50 terms), bouncing the data across frames with local variables or even sequence locals (yuk!!!). That is pure madness! Done right, the code will fit on a postage stamp!
@GradTA wrote:
I’m seeing outputs like 1, 2.5, 7, 19.08, which are close but clearly not accurate enough. I think it might have to do with how I’m adding my terms. I’ll post pictures of my work once I can get back to the computer that has it
These outputs are ***exactly right*** for very specific inputs. We cannot tell how good they are unless you tell us the inputs. Also, how many terms are you using? The precision will increase with the number of terms.
10-29-2024 02:33 PM
@altenbach wrote:
I would think that the "power of x" function should not be allowed here. Just basic primitives (add, multiply, divide).
You immediately get problems for "large'ish" absolute inputs where the division approaches Inf/Inf
Here's what I might do:
beautiful!