LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Taylor expansion of e^x

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

0 Kudos
Message 11 of 13
(176 Views)

@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.

 

Message 12 of 13
(173 Views)

@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:

 

altenbach_0-1730217096958.png

 


beautiful!

0 Kudos
Message 13 of 13
(128 Views)