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 for Programming
 LabTalk Forum
 Set Integration to Zero

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
grovi Posted - 10/25/2017 : 07:08:52 AM
Origin Ver. and Service Release (Select Help-->About Origin): Origin 2016G (64bit)
Operating System: Win 7 Enterprise

Hi Guys,

I want to integrate the Values in one column (e.g. Col(B); in Col(A) are the x-Data) and write the "Integral Curve Data" (as defined in the Integ1 Function). But if a Value in one row in Col(C) is greater than 1, the integration has to start from zero.

I tried this with the following code in the "before formula script" Window:

jj=1;
for (ii = 1; ii<50 ; ii++)
{
%W = col(C)[ii]$;

if(%W>1)
  {integ1 iy:=(col(A)[jj:ii],col(B)[jj:ii]) oy:=(Col(D)[jj:ii],Col(E)[jj:ii]);
   jj=ii+1;
  }
}


But sadly only the last integration is write into Col(E), the previous are delete.

Thanks
Steffi
1   L A T E S T    R E P L I E S    (Newest First)
yuki_wu Posted - 10/27/2017 : 01:57:45 AM
Hi Steffi,

You can type “integ1 -d” in the Script Window to open the Integrate dialog.

You will find that you can only specify the whole XY range in Integral Curve Data item (oy) instead of the column subrange. Thus, the new result of integration will cover on the old one. As a workaround, I think you could output the result to the separate columns and then combine the columns into one.

int nrows = wks.nrows; 
jj=1;
for (ii = 1; ii <= nrows ; ii++)
{
	if( col(C)[$(ii)] > 1 )
	{
		integ1 iy:=(col(A)[jj:ii-1],col(B)[jj:ii-1]);
		jj = ii;
	}
}
integ1 iy:=(col(A)[jj:nrows],col(B)[jj:nrows]);
int ncols = wks.ncols;
for(ii = 5; ii <= ncols; ii++)
{
	copy -a col($(ii)) col(4);
}
wreducerows irng:=col(4) method:=missing;

Hope it helps.

Regards,
Yuki
OriginLab

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