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 for Programming
 Forum for Origin C
 strange behaviour calculating dataset
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

bubbas

Germany
Posts

Posted - 10/16/2006 :  09:17:27 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5E
Operating System: Win XP

hello,

i found a strange behaviour. I import some data into a worksheet. then i run a origin c function, which creates a new worksheet, lets say wks2. There it copies some columns from the first worksheet and also creates some new ones which are calculated using different columns of the first wks. finally it does some plots.

One of the calculated columns is calculated as follows:

Dataset dsXRMRQz(wks2,1);
wks2.Columns(1).SetName("qz");
double faktor = 0.001013546246585;
dsXRMRQz=faktor*energy*sin(dsAbsTheta*Pi/180);


energy is set to a value before that call. dsAbsTheta is a Dataset from an column of the first worksheet.

If I run the function, it calculates well the value of the first row. But not the rest! if I run the function a second time it calculates all rows correct. I don't know why :(

The second worksheet is created as follows:
	//neues Worksheet zum Arbeiten
Worksheet wks2;
wks2.Create();
wks2.GetPage().Rename("XRMR");


Also if i want to plot a column manually from this second Worksheet it doesn't work. I think this is a different problem ...

Can someone help me??

Thanks in advance

greetings

bubbas

Edited by - bubbas on 10/16/2006 09:20:21 AM

easwar

USA
1965 Posts

Posted - 10/16/2006 :  11:08:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi bubbas,

We could reproduce the bug - thank you for reporting this.
For now, changing the order of the computation in your statement, such as:
dsXRMRQz=sin(dsAbsTheta*Pi/180)*faktor*energy;
seems to fix the problem.

Easwar
OriginLab


Go to Top of Page

bubbas

Germany
Posts

Posted - 10/17/2006 :  04:53:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
oh okey ;)

it works now changing the order!

Thanks!

greets

bubbas
Go to Top of Page

bubbas

Germany
Posts

Posted - 10/31/2006 :  12:30:56 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
now i have to calculate the following:

dsT2TSSAbs_AbsTheta=1.0/(sin(dsAbsTheta*Pi/180)*xi/mu+1);

dsT2TSSAbs_AbsTheta and dsAbsTheta Datasets. I have the same problem ...

thx

bubbas
Go to Top of Page

bubbas

Germany
Posts

Posted - 11/02/2006 :  05:25:23 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
no possibility ??
E
DIT:

okey, sorry seems this time it wasn't related to the problem above ..

fixed it creating a column containing sin(...) and then using the Dataset of this column.




Edited by - bubbas on 11/02/2006 07:35:22 AM
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