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
 math in worksheet
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

kychung72

S. Korea
Posts

Posted - 01/10/2007 :  12:35:26 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): OriginPro 7.5 SR6
Operating System: XP

Hi all,

I wrote a code below;

test(string wksname, double variable)
{
string original, target;
original=wksname+"_A";
target=wksname+"_B";
Dataset dsOriginal(original), dsTarget(target);
dsTarget=2*180/pi*asin(sin(0.5*pi/180*dsOriginal)*1.540562/variable);
}

The purpose of the code is to do a simple math on col(A) and fill the col(B) with the results. The "variable" ranges between 0.5 to 1.5. The col(A) is filled with the numbers ranging between -5~100.
But the funny thing is that the code fills the 1st row of the col(B) with the calculated result and fills other rows with "0". This happens only in the very first time of its execution after the Origin is launched. Once the code is executed malfunctionally, the code works fine afterwards.
Could anyone give me a comment or suggestion?
Thanks.

zachary_origin

China
Posts

Posted - 01/10/2007 :  02:20:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

There is a known bug for calculating the datasets multiplying double numbers. A workaround is changing
dsTarget=2*180/pi*asin(sin(0.5*pi/180*dsOriginal)*1.540562/variable);
to
dsTarget=asin(sin(0.5*pi/180*dsOriginal)*1.540562/variable)*2*180/pi;

Similar problem is met by another usr in the forum
http://www.originlab.com/forum/topic.asp?TOPIC_ID=5215

Zachary
OriginLab Technical Services.
Go to Top of Page

kychung72

S. Korea
Posts

Posted - 01/11/2007 :  01:08:50 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Zachary.
It works!

I hope you could fix the bug and release the update.
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