LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting a formula to labview

Hi

 

I hope this is in the right place. I'm a student that is bad at math and trying to make a simulator in Labview.

Dynamic_Dino_0-1643549997326.png

This is what i'm trying to put into a  formula node , First part is fine ,but how do i input the part below inn, how does that look in labview?

Dynamic_Dino_1-1643550047088.png

 

I'm making a simple heat exchanger simulation so this is change in temperature over time of the pipe inside of the heat exchanger.

 

This is how fare i got.

Dynamic_Dino_2-1643550241287.png

 

 

Thank you so much in advance.

0 Kudos
Message 1 of 7
(1,513 Views)

I would not recommend formula node, you can achieve this with LabVIEW primitives.

 

Now, you do understand that the tau is time and differentiation is the rate of change, in this case, rate of change over time. You need to bring in the concept of time into the simulation. This time can come in the form of an actual system clock, compute the difference between the last data time and current data time.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 7
(1,499 Views)

I'd avoid the formula node entirely. 

 

First.  You are going to need some type of loop and a way to pass a value from one iteration to the next so you can find dTr and dt.

 

Look into the help for Shift Registers and Feedback Nodes for getting to dTr. Take a look at the primitives on the timing pallet for dt.  Then post your next try.


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 7
(1,495 Views)

I do like the formula node, and i can't have loops becouse there a lot of formulas going into each other , I don't mean to ask for help and then disagree with the answer i'm just not sure how i'd do it with out the use of formula node,

Dynamic_Dino_1-1643564104996.png

 

This is my solution , how fare off am i ?

0 Kudos
Message 4 of 7
(1,473 Views)

@Dynamic_Dino wrote:

I do like the formula node, and i can't have loops becouse there a lot of formulas going into each other , I don't mean to ask for help and then disagree with the answer i'm just not sure how i'd do it with out the use of formula node,


That statement makes absolutely no sense!

 

This seems to be a subVI, so most likely you need an uninitialized shift register and do special treatment on first call. Tr needs to be an input and you need to calculate dTr based on current and previous value. You only initialize the feedback node once and after that, the Tr input is ignored.

 

Where are the other terms of your formula? Which ones are constant? Which ones can vary with each call?

 

Can you tell us a little bit more about your entire project. What happens in the toplevel VI and how are you calling this? Attach that too!

 

Don't label a control "t" if you use it as "dt". Big difference!

 


@Dynamic_Dino wrote:

This is my solution , how fare off am i ?


This is not a solution, so you are 100% off. I strongly recommend to start with the learning resources listed at the top of the forum. Since you love formula nodes so much, it probably means that you are a text programmer. Forget all that! 

 

In your first post you admitted that you are bad at math, so you need to sort this out first. For example notice the dot over the mr? That typically also means that it is a derivate with time. Right?

Is "t" the same as "tau", i.e. are both just "time"?

You need to fully figure out the math first! After that, implementing it in code should be trivial, independent of graphical code, text code, formula node, paper&pencil pseudocode, or whatever.

 

Make a list:

 

  • What are all the inputs to the calculation?
  • What is the output?
  • What are the initial conditions?
  • Over what time range should the calculation be carried out? (I assume you want an output vs time., i.e. an array of values)
  • Now make controls for all the inputs and label them as in the formula (long foreign language labels that nobody understands just confuse the relation between inputs and the actual formula as written!). You can use the legend for the verbal description. Do you know how to do that?

See how far you get!

0 Kudos
Message 5 of 7
(1,464 Views)

I will try remaking it , i see it's difficult to answer one question when i'm probebly asking the wrong thing.

 

thank you so fare.

0 Kudos
Message 6 of 7
(1,390 Views)

 

You're probably right, i think the main issue here is i don't fully understand how the math works. I need to think of a way to proceed, to ask the right questions.

 

There are 11 different formulas and my inability too see how it all fits togather is also probebly the caouse of not seeing any solutions.

 

I see i have some work to do.

 

Again thank you. i'll repost if i figure somthing out.

 

0 Kudos
Message 7 of 7
(1,437 Views)