The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 set integration boundaries from values

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
ClemensObergfell Posted - 12/02/2014 : 04:52:31 AM
Origin Ver. and Service Release (Select Help-->About Origin): 9.0.0 G (32-Bit) SR1
Operating System: Windows 7 Enterprise

And another question.

I would like to get the maximum value of the derive function. But only in the section between the red lines of the plot.

Is it possible to automatically take the x-values of column C in the FindXY-Sheet as integration boundaries?



Thanks a lot in advance.

This is where I would like to set the boundaries automatically.
5   L A T E S T    R E P L I E S    (Newest First)
ClemensObergfell Posted - 12/04/2014 : 01:21:44 AM
Chris, Thank you so much for your help!

That works just fine and is exactly what I needed.

Thanks a lot!

cdrozdowski111 Posted - 12/03/2014 : 3:34:35 PM
Clemens,

See if the following works for you.

1) In the worksheet you show in the screenshot above, add 2 columns (cols 5 & 6) making them X and Y. Give them whatever long name you wish.
2) For col 5, open the Set Column Values dialog by right-clicking on the column header.
3) Add the script below to the "Before Formula Scripts" field.
4) Leave the other field empty.
5) Set Recalculate to "Auto".
6) Click OK to close the dialog.

Now, when values are added to both cells 1 & 2 of column 3 (your bounds), the data will be automatically differentiated into cols 5 & 6 and the maximum value will be put into the Comments for column 6.

You can now use this workbook as a template (the Set Column Value script will be saved).

// Make sure both cells in column 3 have values
if ( ISNA($(Col(3)[1])) || ISNA($(Col(3)[2])) )
{
	return;
}

// Now do the differenitate your data
differentiate iy:=(Col(1),Col(2))[x$(Col(3)[1]):$(Col(3)[2])] oy:=(Col(5),Col(6));

// Get max value of differentiated data
double dMax = Max(Col(6));

//Round the max value to the default system decimal digits and display maximum value in comments for column 6
dMax = round(dMax, system.numeric.numDecDigits);
Col(6)[C]$ = "Max: $(dMax)";

~Chris
ClemensObergfell Posted - 12/03/2014 : 11:29:28 AM
quote:
Originally posted by cdrozdowski111


differentiate iy:=(Col(1),Col(2))[x$(Col(3)[1]):$(Col(3)[2])] oy:=(Col(5),Col(6));

double dMax = Max(Col(6));

dMax=; // This line is just so you can see that it works




Thank you so much! That's awesome and it works!
Is it possible to make it automatically working through the labtalk script after I get new values into the columns I wish to derivate?
The problem is, that I have 5 workbooks where it should do the same task, but with other values.

To make things clear. I have built a template, where I can copy new values in Book1.
Then it automatically writes x and y values of 5 spline curves each in a new workbook. So I have 5 new workbooks where I have to derivate each spline in the specific range (the boundaries from column 3).

Is this possible to implement, using only this labtalk script?

Thanks in advance for your help.
cdrozdowski111 Posted - 12/03/2014 : 06:40:07 AM
Clemens,

If you wish to make the differentiation into a script, here you go.

The following LabTalk code calculates the derivative of the data in columns 1 & 2.
The calculation is bounded by the X values specified in column 3, rows 1 & 2.

It outputs the differentiated data to columns 5 & 6. If cols 5 & 6 don't exist, it will create them.
However, you can create the cols 5 & 6 ahead of time and it will put the differentiated data into the cols.
If there is already data in cols 5 & 6, it will replace it.

It then finds the maximum value of the differentiated data.

(Note: you can replace column numbers below with letters if you wish)

differentiate iy:=(Col(1),Col(2))[x$(Col(3)[1]):$(Col(3)[2])] oy:=(Col(5),Col(6));

double dMax = Max(Col(6));

dMax=; // This line is just so you can see that it works
Shirley_GZ Posted - 12/03/2014 : 12:20:36 AM
Please try to use the Differentiate gadget which can be open by "Gadget: Differentiate" from the main menu with the graph window active.

Originlab Technical Service Team

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000