The slope of a graph

I'm trying to calculate the slope of a graph aquired by a daq device.
I have to find the part of the curve where it reaches the peak, not the
maximum. Can anybody point out a vi or function to find an
approximation to the peak?
Best Regards
Svavar Von Eisland
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

You need to incrementally measure the slope from point to point and keep
track of where the slope goes to zero (or a really small number) this could
be at several points depending on how many minimums and maximums there are,
to tell if it is a max or a min you will need to keep track of the sign
changes on either side of the zero slope point(s) (derivitive). Also
depending on how noisy your data is you may need to smooth it as you go -
maybe some type of running average. The end points of your data will have
to be excluded since the slope is undefined (ie you can't take a slope of a
single point).
Refer to your differential equations / calculaus book for futher info. :-)
Chris
[email protected] wrote in message <7o926e$3bo$[email protected]>...
>I'm trying to
calculate the slope of a graph aquired by a daq device.
>I have to find the part of the curve where it reaches the peak, not the
>maximum. Can anybody point out a vi or function to find an
>approximation to the peak?
>
>Best Regards
>Svavar Von Eisland
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.

Similar Messages

  • Finding the slope of a tangent to a curve

    Hello everyone,
    I would appreciate guidance to any specific built-in subVI or routine which I can use to draw a tangent to a curve and find its slope. Specifically, I will need to to able to draw this tangent at any user specifed y-value. In order to keep it very accurate, I will not like to use any arbitrary cursors. The curve itself is drawn from a text file data which is read and passed onto an xy-graph.
    Any guidance will be much appreciated.
    cheers,
    Navneet
    Solved!
    Go to Solution.

    Not really Mathan, going through it still.
    For argument sake, lets assume an exponential increasing function and i want to find the slope at the point where y = 0. what will be the most optimum approach for this?
    Thanks for your reply, kindly appreciated.

  • More than 4 places after the decimal for the slope of line equation?

    Hello
    I'm doing some graphing for chemistry class and I'm trying to find where in Numbers I can change the preference for the trendline equation.(y=mx+b) Currently m is only showing up to 0.xxxx . I need it to show at least 7 or 8 places. Or even better, is there a preference to set it to show x amount of significant figures?
    Much thanks,
    Ryan

    No preference that I am aware of. You can calculate the intercept and slope yourself using INTERCEPT and SLOPE functions, create a one-celled table with a formula that makes a string for y=mx+b, and place that one-cell table on top of the chart.
    If Table 1 cell B2 has the slope and C2 has the intercept, the one-cell new table formula would be
    ="="&Table 1::B2&"x+"&Table 1::C2
    The string will have the same number of decimal places as what it finds in B2 and C2.

  • What is the best way to graph CAN data?

    Hi All,
    Even after years of trying, I am still really lousy at using the LabVIEW graphing functions, so I hope you will be patient with me.
    I am currently writing code to monitor a CAN bus.  I have messages with five different arbitration IDs coming in at irregular time intervals.  Generally, there is between between 5ms and 100ms between packet arrival times.  My first currently captures the raw CAN data and parses it according to the format requirements for each arbitration ID and shows the corresponding values from the parsed data.   It also saves the raw data into a txt file.  Each entry saves a time stamp, Arb ID, message length and 8 CAN bytes, which is the length of each CAN packet.
    I have another program which takes the raw data from the original txt file and resaves it as formatted data, broken out into parsed values.  I use this two-step process to make my CAN capture program run faster.
    I have two graphing needs right now:
    1.  Graphing the ruasi-real-time values of the parsed CAN data as they are acquired in my CAN capture program.  This needs to happen in as little time as possible, giving me usable graphs or charts without bogging down the program.  If graphing the data takes up too much CPU time, I could graph data samples once every XXXms, instead of graphing everything that comes in.  If graphing the data proves too CPU intensive, I might just give up on this real time graphing.
    2.  Graphing the entire parsed data set in my second, post-capture program.  Speed is not as important in this program because I am not capturing real time data while it is running.  This graph needs to include each data point vs. its associated timestamp.
    Any recommendations on which graphing functions to use in these programs would be greatly appreciated.
    Thanks!

    I'm not sure what you mean by "graphing functions."  I have code running now that receives a CAN message every 1ms.  Every 100ms, all the data received in that period is added to a chart.  I'm using a less-expensive USB CAN card (so no on-board filtering) and my code has no problem filtering by arb id in software.  I'm doing this by grabbing all received messages from the buffer every 10ms and, in a for loop, checking the arbitration ID of each packet.  If the ID matches the one I want to graph, I convert the CAN packet to 4 16-bit values and put them in a queue.  In a separate loop, every 100ms I flush the queue and write the contents to the chart.  Here's the relevant bit of my code.  Does this help?

  • How can i dynamically vary the color of one graph line

    I was looking on the developer zone and noticed several people are looking for a way to change the color of one graph line. Simplest case I would like to know: a graph is running, then you press a button and from that point on the color of the graph changes, but doesnt change the old data line color. THis way the line will consist of different colors.
    The property node changes the whole line, and the line is always just one color. It should be possible to make the line consist of different color sections, anyone know how?

    The application is actually not as slow as it seemed, i had some settings set wrong (anti aliasing in plot, and some functions in advanced, when you right click on the graph)
    Especially unchecking the anti-aliasing makes it much faster
    Also, just plotting point and not a line, or alternatively, changing the interpolation makes it faster.
    Anyway, the attached files do not rely on processor so much anymore, see for yourself
    Attachments:
    multicolor_looking_plot.vi ‏99 KB
    multicolor_looking_plot_2.vi ‏105 KB
    multicolor_looking_plot_3_truncated_array.vi ‏99 KB

  • A problem about the compression of directed graphs

    Right now I encountered a problem in my research that is about graph compressing (or contraction, etc.). I've searched in various ways for existing techniques on this problem and found nothing. I've been trying to figure out this problem by myself. However I would also like to seek some advice from you guys.
    The description of this problem:
    Given a directed graph G = (V, E) where V is the set of vertices and E
    is the set of directed edges. These vertices and directed edges
    represent the events and the directional relationships between pairs of
    events. Each edge is associated with a weight (or confidence score)
    which indicates the degree of the relationship. Now I want to compress
    the graph by merging some of the vertices into one superior vertex,
    which implies that several lower-level events are merged into one
    high-level event (this is mainly because the extent of news events
    defined are usually flexible). After that we can reorganize the
    vertices and edges and repeat this process until the size of the graph
    reaches a certain limit. Purely looking from the point of graph theory,
    is there any existing graph algorithm that solves this problem? As far as I have searched, the answer seems to be negative.This seems to be an interesting novel problem which falls in the area of graph algorithms. Could you suggest anything? Attached is a sample directed graph of such a kind which may be interesting.
    Check this URL to find out more about this kind of DAG:
    http://ihome.cuhk.edu.hk/~s042162/2005-05-24.jpg
    Thank you very much for your time and help.
    Regards,
    Daniel

    Sounds like an interesting problem. The temporal aspect presents an interesting wrinkle. Graph models have been becoming popular for the standard clustering problem recently, but they are typically undirected formulations. The idea of compressing a graph reminded me of work done by G. Karypis and V. Kumar on graph partitioning, some of their papers are available here:
    http://www-users.cs.umn.edu/~karypis/publications/partitioning.html
    SImilar to the reference given by matfud, with the additional restriction that there may be a size restriction on the size of the partitions or there may be multiple partitions (both restrictions make the problem NP-complete, IIRC).
    There's also the area of spectral graph partitioning which may be of interest. Its a way of finding relatively dense areas in a graph by using the eigenvalues of the adjacency matrix. Most of the results in this area are dependent on the fact that adjacency matrices for graphs are symmetric and semi-definite, which wouldn't be the case for a directed graph, but could be worth some experimentation if you have MATLAB or something similar.
    There's something else this problem reminds me of, but I can't think of it right now. Maybe later something will come to me.
    Good luck.

  • How do I fix the format of plot lines for an arbitrary number of sets of data plotted on the same x-y graph?

    I have written a VI to control an LCR meter and perform sweep functions. I have two x-y graphs on my front panel (one for each of 2 measured parameters). The VI is designed with a button to take a measurement, plot the data, and then wait for another event (like write data, clear plot, or measure again). The user can take simultaneous measurements and these are plotted on top of the data already there in the same x-y graphs (using an array of clusters with shift registers). There is no limit on how many sets of data can be on the x-y graph. 
    Now, my issue is in formatting the plot lines (color, thickness, marker type). I can fix the first plot line by adjusting the parameters of the x-y graph. However, I also want to control the format of all consecutive plot lines. How can I do this for an arbitrary number of lines? The main thing I want to do is to have all of them show the square marker type (the default is no marker type, just a line). 
    Thanks!

    Hi maximum23,
    You can use properties of plot to format the plot lines. You just have to select Active plot using property and then select color and line width etc..
    You can define color and width etc parameter by asking user or you can just make them default.
    Gaurav k
    CLD Certified !!!!!
    Do not forget to Mark solution and to give Kudo if problem is solved.

  • Using DIAdem, how to get the slope of a signal (Linear or non-linear​)

    Rate of rise or rate of fall on a temperature signal, I'm trying to include the slope in my report using DIAdem,
    I couldn't find , Is there a slope function?
    or a way to do that
    Thanks
    Solved!
    Go to Solution.

    Hi amat,
    You can get the slope fit calculation from the built-in function "ANALYSIS >> Curve Fitting >> Calculate Regression".  If you want to fit only a subset of the data, you will need to extract that subset of data to a new data channel and then run the approximation calculation on the new channel.
    Here is a script I have created to do the range extraction and statistics/slope calculation automatically.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments
    Attachments:
    Selected Region Stats.zip ‏5 KB

  • How can I calculate the slope of an isometric torque curve with a trigger and time increments of 0-30ms, 0-50ms, 0-100ms etc....

    I am analyzing isometric muscle contractions of the quadriceps and want to calculate the rate of force development (not just peak torque) for the torque-time curve.  I want to set a trigger so that the slope of the torque curve is calculated when 7 newton-meters is reached.  From there I'm trying to calculate the slope in time increments of 0-30ms, 0-50ms, 0-100ms, etc....My data is sampled at 2000 Hz and written in text files.  Below is a copy of the VI I have developed so far.  I am very new to programming with LabVIEW but can definitely see its potential!  Any advice would be greatly appreciated. 
    Attachments:
    Dissertation Isometric RFD.vi ‏14 KB

    Fiddler918,
    When trying to implement something like this in LabVIEW, it is often helpful to think about how you would program this function in a traditional text-based language.  Try and break the problem down.  You need to locate the data point in your array that is 7 Nm or greater.  At this point, you will need to grab the data points that are 60 indices (for the 30ms gap, assuming your points are equally spaced 0.5 ms apart), 100 indices (for the 50 ms gap), and 200 indices (for the 100ms gap) ahead of this point in your data file, and calculate the slope using pairs of data points.  
    Here is a general description of a possible implementation of this code:
    You can wire the appropriate column of the data array into a For Loop on the block diagram and have it auto index through the points.  If you right click on the Use the Greater or Equal? function to generate a Boolean that will be true when you want to exit the For Loop.  Right-click on the border of the For Loop and select Conditional Terminal.  This will cause a small stop sign to appear.  If you wire the Boolean to the conditional terminal, the loop will stop at the value that is greater than or equal to 7 Nm.  If you wire the Loop Iteration terminal out of the For Loop to the right, this will give you the index of the value in the column that you’re interested in.  Having this value, you can then use the Array functions to grab the specific data points you need, and numeric functions to perform the necessary math.
    If any of this didn't make sense, the LabVIEW help files are a great resource to use.
    Here is a link to some video tutorials of the LabVIEW programming environment.  They may help you in the development of your code.
    http://www.ni.com/academic/students/learnlabview/
    Regards,
    Jared R.
    Precision DC Product Support Engineer
    National Instruments

  • How to calculate the slope of a signal to find its peak

    I have acquired a ECG signal through the DAQ. Actually I have to calculate the slope of the ECG signal in order to find the R-peak. By finding the slope of R- wave which will be greater than the slope of T-wave, I could differentiate between R-wave and T-wave as it looks similar for some patients. Can any one of you guide me in finding the slope of the incoming signal and then detect the R-wave.
    Thank you. 

    sorry, I do not have version 7.1, so I am attaching it in LV8.0 and a picture of the block diagram.  Maybe someone can convert it for you, or that you can see enough to recreate the code from my pics... not too much going on.  Hope this works for you.
    Message Edited by Stradis on 10-11-2007 04:21 AM
    Paul <--Always Learning!!!
    sense and simplicity.
    Browse my sample VIs?
    Attachments:
    trigger to sample.png ‏10 KB
    trigger to sampleWithSlope.vi ‏288 KB

  • Evaluation of the slope of part of a curve with cursors

    Good morning,
    I am trying to get the slope of part of a curve. The curve is a stress strain curve and the idea is simply to manually choose the X range to evaluate the slope and extract the Young modulus. The user would place the cursors and the slope parameters would be displayed in an area.
    I got some clues from various examples here in presenting au automatized calculation of the min, max, average and other parameters of the part of the curve contained between the two cursors, using the StatblockCalc command in the adequate range.
    However, I understand that the regression tool needs two new channels containing the values between cursors (flags and export manually).
    Then, the doubt is: Is there some way to bypass the creation of new channels each time the cursor is moved to get the linear regression parameters "live"? I am rather new using scripts with diadem and can´t find the apropriate way to code this. Do you have any clue?
    Thank you in advance,
    David

    Hi David,
    See if this application does what you want.  Note that it installs a new icon at the top of the VIEW icon bar, so that you can call the script easily from the VIEW panel after you've run it once in the SCRIPT panel.  There is no way around extracting the new X and Y channels from the desired X range in order to calculate the slope of that X region, but you don't have to use flags, which are designed for interactive use only.
    http://forums.ni.com/t5/DIAdem/Using-DIAdem-how-to​-get-the-slope-of-a-signal-Linear-or-non/td-p/2158​...
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Automatic Cursor Movement in one Graph, in accordance to the cursor in another graph

    I am using two XY graphs each with 4 cursors. I want to assign each cursor of graph A to each cursor of graph B such that the corresponding cursors in graph B moves in accordance to the cursors in graph A.
     I have used Active cursor, Cursor.PosX and it works for one cursor. However when I use the same concept to change the active cursor value and faciliate the automatic movement for all cursors they do not work.
    Message Edited by Chathuri on 08-13-2009 06:26 AM
    Solved!
    Go to Solution.

    Hi,
    As requested I would like to post the solution as to how I tacked the problem. It was actually small mistake on my part. When I connect the two property nodes for each XY graphs I should connect ActiveCursor to ActiveCursor and Cursor.PosX to Cursor.PosX. What I did was connect the Active cursor of A graph to the cursor.index of B graph. I have attached a small screen shot of connecting the first cursor of A graph to the 1st cursor of B graph so that the cursor in B graph follows the cursor in A graph.
    In order to connect more cursors as in my case, the only change to be made is the change in the Acitve cursor constant to, 1,2,......
    Chathuri
    Attachments:
    CursorMovement.JPG ‏7 KB

  • How to measure the slope of a triangle wave

    Hi everyone,
    I'm looking for a way to measure the slope of a triangle wave, which changes every half cycle of the wave. I have the triangle wave out of phase by 90 degrees so that it models the behavior of a cosine wave, and essentially all I want is a way to measure whether the slope is positive or negative. The idea is to use this information to stop another signal running at the same time at the halfway point of the cycle of the first signal, so the first wave can continue back to it's starting point and the second will start again at the completion of the first wave (as it begins the second cycle)
    I'm using LabVEIW 8.2.1 if it makes a difference
    Thanks,
    Ben
    PS. Is there a way to close threads you've previously posted on this forum? I started one yesterday (or possibly the day before) with a fairly vague question in it and it's now redundant after I made some headway on my own, and I don't want to clog the forums up

    I'm not sure how you're using this data to control anything, so I'm not sure what the best implementation would be.  You will not be able to get any data out of the loop until it finishes (gets a True value at the Stop If True terminal (sort of)), so if you want to have the loop running constantly, you need to put your control code in the loop with the generated data.  Otherwise, you could generate your boolean array, and then wire it and your control array into a for loop, and do a point by point comparison to see if you should be controlling.
    The new example.vi has two examples to give you a rough idea what I'm talking about.
    Message Edited by JeffOverton on 06-12-2008 12:19 PM
    =============
    XP SP2, LV 8.2
    CLAD
    Attachments:
    Example2.vi ‏18 KB

  • Get the slope (gradient - derivative) of a curve at a point

    hello
    does anyone know if it is possible to get the slope (also might be known as gradient, derivative), of a curve at some point?
    What i want to do, is draw a line that is vertical to a curve, so i need to have it's slope
    thanx

    The easiest way to do it would to be to get the point right before the point you're looking at and the point right after it and just find the slope between the two
    If you try this method, make sure they are double values. Simple ints will not give you the slope you want.
    I made a program once that animated a rocket flying through the air. The curve was found using a parametric equation (x and y in terms of time). To point the rocket, I had to find the dirivitive (a little bit of calc 1). Then, I just made a function that calculated the slope of the curve at any given time (t). It worked great, but it may not be what you're looking for. If you do need to find the dirivitive, post some code or the formula you are using, I'm sure there are people on this board that can help you.

  • Dynamically controlling the label of the series in Business Graph

    Hi All,
    I am using the Stacked Column type Graph in my application. For every stacked column in the graph i am displaying its corresponding value. if there was no value for a particular stack, 0 is getting displayed. is it possible to remove this 0? (i.e) label of the series need to displayed only if the value is greater than 0.
    Thanks,
    Mugu

    Hi Samir.......
    Name itself suggests that you can maintain the numbering series manually.
    Generally if you define the particular No. Series then it will take nos. sequentially but
    if you want the documents to take the no. randomly in such case you can define the
    Document No. of any sequence. But The nos. can not be repeated once you defined........
    Hope this clarified you more......
    Regards,
    Rahul

Maybe you are looking for