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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Plot dy/dx vs y for multiple columns
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

felixs

USA
5 Posts

Posted - 02/08/2020 :  3:58:56 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin 9.2, Win10 64

I measured voltage (y) over time (x) with time equally spaced yielding 5000 y-datapoints. I have 30 measurements yielding 30 y columns all with the same x column.
Now I want to plot the derivative (dy/dx)vs y. So, each previous y is now x and its derivative is the new y, yielding 30 x,y columns.
How can I do that without having to manually sort and reassign x/y values? I have about 100 datafiles that I want to do this on and doing it manually will 'kill me'
thanks for any advise
Felix

YimingChen

1665 Posts

Posted - 02/10/2020 :  12:30:39 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can make the operations into an analysis template and in the future either import data into this template or run batch processing.
1. Start a new workbook and import your data. (31 columns, 1 x and 30 y's).
2. Run differentiation tool on column 2, set recalculate mode to Auto in the dialog. It creates a new column in the worksheet.
3. click on the green lock on the resulting column header and select Repeat this for all y columns. Now 30 more columns are added with derivative data and worksheet has totally 61 columns.
4. From col 2 to col 31, we are going to plot with column (2,32), (3,33)... that is (i, i+30). Select menu Worksheet: Worksheet Script.., add following script:

wksname$ = page.name$;
win -t plot;	
gpname$ = page.name$;
for (int i = 2; i <= 31; i++)
{
	plotxy iy:=[wksname$]1!($(i),$(i+30)) plot:=202 o:=[gpname$]1!;
}
layer -g;


We can trigger the script when the derivative data in the worksheet is changed. Check Upon Changes in Range(s) and enter 32 in the entry. You can click the running man button to test the script.



5. Save the workbook as analysis template. You can use this analysis template to run batch processing to handle other data files.

If you need more help, please contact us at <tech@originlab.com>.

James

Edited by - YimingChen on 02/10/2020 12:33:34 PM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000