LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

slope of (dV/dt)/(dT/dt)

hi, I am measuring voltage vs time and temperature difference(Th-Tc) dT vs time. so what I need is the slope of dV vs dT. Mathematically it is easy but here in this vi I made something wrong but I don't know what is wrong

 

Could you please help me about it.

 

thanks

Download All
0 Kudos
Message 1 of 11
(5,373 Views)

Can you explain your thought process for the "derivative" subVI? It makes no sense!

 

What is the purpose of the FOR loop with 1 iteration? With every call of the subVI, you are initializing the shift register and all old data is lost anyway.

 

Also your main Vi makes very little sense? For example your time array is either empty or contains all identical elements. (you only get the time once at the start of the program and never again, always reading the same stale value from the input tunnel. getting the time needs to occur inside the loop, right?

 

As a first step, I would recommend to simplify the progrma. is it probaly 400% more complicated than needed.

0 Kudos
Message 2 of 11
(5,371 Views)

Isn't (dV/dt)/(dT/dt) just equal to dV/dT?  (The dts cancel out.)

 

I see that you have a Delta_T value and a Voltage value... for the current step, at least.

 

I think what you want is dV/dT== (V[i]-V[i-1])/(DeltaT[i]-DeltaT[i-1]).

 

In this case, i is the current iteration and i-1 is the value from the previous iteration.  (It should be noted that DeltaT is Th-Tc, not T[i]-T[i-1].

 

In that case, my suggestion is this: 

  1. delete the derivative vi.
  2. create two shift registers
  3. Put the value of delta_T into one shift register (at the right hand side)
  4. Put the value of voltage into the other shift register. (at the right hand side)
  5. Calculate dV/dt using the formula above where the [i-1] values are taken from the shift registers at the left.

This should give you what you want, except on the first iteration when the shift registers do not yet hold a previous value.  If that's a problem for you, you can either ignore the first iteration or pre-populate the shift registers before the loop starts.

0 Kudos
Message 3 of 11
(5,360 Views)

Also, you have your main program loop set to only run once.  That's not going to give you enough data to make a graph or calculate a derivative.

 

0 Kudos
Message 4 of 11
(5,354 Views)

@LandBelenky wrote:

Also, you have your main program loop set to only run once.  That's not going to give you enough data to make a graph or calculate a derivative.



LOL, did not notice this. I guess he's using "continuous run" and the purpose of the FOR loop is just to contain the uninitialized shift registers. 😄

 

In any case, calculate V/T and feed it to derivative ptbypt. Tha'ts all you need.

 

Is the loop rate constant? (you can laways ensure this!) In this case you can use plain charts for all your traces. Virtually no code needed.

0 Kudos
Message 5 of 11
(5,346 Views)

wait a second... does he want dV/dT or d(V/T)/dt?

 

these aren't the same thing, are they?

0 Kudos
Message 6 of 11
(5,343 Views)

You're right. (Instead use the ptbypt version on the two signals and divide later.)

0 Kudos
Message 7 of 11
(5,341 Views)

Smiley Happy

 

thank you guys, you are clever and funny. liked it.

 

yes, I want dV/dT.

 

one FOR LOOP is nedded because this is actually sub vi of main vi. There I am adjusting temperature and when the temperature is stable this vi is doing its job. I confused after your comments. I am using Master-Slave Structure. this structure will be slave structure. So, evey 10 min. I am taking a data coming from 300K to 1000K. this data are dV/dt and dT=Th-Tc. So seebeck coefficient is voltage created by creating gradient between two ends of a sample devided in to temperature gradient value. It is actually V/(Th-Tc) but it is adviced that this calculation is not correct complately,, thus dV/dT is needed.

 

In this case, time dependent Th-Tc=temperature gradient/difference and time dependence voltage=dV/dt should be measured. Then dV/dT need to be calculated.

So the problem is how to do that??

 

you explained but I confused with commends. But I will read again to understand. thank you guys:)

0 Kudos
Message 8 of 11
(5,323 Views)

I made some changes, T_EMF is needed. Other one is not sub anymore but I am not sure which way is considered as correct way. Could you please check it out. thanks

 

best.

Download All
0 Kudos
Message 9 of 11
(5,311 Views)

I guess that looks right... although a little different than how I would have done it.

 

The only little problem I see is that you're equation should be: V[x]-V[x-1], rather than dV[x]-dV[x-1].  But that's just a labeling issue, not a calculation issue.

 

I know some people are big fans of using uninitialized shift registers and loops of length 1... but I've never really liked it.  If you're comfortable with it, feel free.

 

Does it work?

0 Kudos
Message 10 of 11
(5,292 Views)