LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

inverse relationship plot

Im trying to plot resistance against 1/temperature can some please explain to me how divide one by the x axis values 

 

also i need to show the slope and intercept of the graph 

0 Kudos
Message 1 of 4
(2,522 Views)
If you are plotting two arrays against each other you should already have an array of temperature values, just use the reciprocal node on the numeric function palette. There is a linear fit VI that will return the slope & intercept.

Perhaps you could post some code?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 4
(2,496 Views)

Thanks for the reply mike 

 

I was in the middle of an open book exam and after about 45 mins of trying to get it too work i posted this, great craic being examed on techniques that havnt been taught 

 

the equation in the vi is being done in a for loop so the x axis is usually a plot of the amount of iterations the loop has been through, Im not too sure on how to set any other variable to the x axis as this hasnt been taught to us and being fairly honest i find the help info on labview to be either too obscure or non-applicable to my needs.  However with that being said im enjoying the module and can pick up on the ideas quick enough once i know about them

 

the brief of the exam was to calculate the resistance of a thermistor over a range of temps, 0 to the max which is input by the user, temp is input in degrees C but the equation requires Kelvin hence the +273 in the second part of the sequence, the first of two plots was resistance vs temp in degrees C, which was grand no prob.  Then we had to plot the natural log of the resistance, easily got, against 1/temp.  You'll see in the 3rd part of the sequence I tried getting the slope and intercept using my one over temp using a divide function and the putting that into the y variable of the function however I got the NaN reading on the indicator which i thought strange seeing as all the factors involved in the program are numerical

 

We hadnt been taught about the linear fit function or anything like it either, (we're 5 weeks into the module, thats 5 one hour tutorials and 5 two hour labs) however we were given the nice little hint of look at Mathematics Fittings palette, so i did find it and identify the right function to use but due to the lack of  experience with this function it was damn near impossible to figure out what was wrong with it, especially under the pressure of an exam 

 

So yer thats that, I know I sound like a whinny student but hey its only easy if you know it and this BS is going to affect my GPA.  Have a look at the vi if you dont mind tell me what you think, how would you of gone about it? Also any pointers on the UI would be nice, the lecturer has a hard on for pretty UI's and being fairly honest Im straight up rubbish at making things look nice

 

 

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

Your front panel looks clean and orderly.

 

I recommend using a flat sequence structure and not a stacked sequence.

Put a small wait function in the initial while loop that waits for you to press the Plot button so you don't eat up CPU cycles polling for the button press.

 

The reason you get the NaN's.  You are doing a 1 divided by the i iteration terminal in the for loop.  On the first iteration, i is zero.  1/zero is infinity or Not a Number.  Try adding a 1 to the i value.

Message 4 of 4
(2,482 Views)