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

verrallr@a

Canada
44 Posts

Posted - 06/05/2008 :  2:32:10 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version v7.5885 (B885)
Operating System:

I am trying to program Density into OriginC.

My OriginC program is :
#include <Origin.h>

double Density(double T)
{return (4956.4/(1.0+3.0*10E-6*(-0.78155+0.1177*T-3.0254E-6*T*T)*
(T-298.)));}

In my script window, I get this for 400 degrees:

bc=Density(400);
bc=;
BC=0.3535184

However this is wrong.

When I give the formula in the Script window for 400 degrees, I get this:

dd=(4956.4/(1.0+3.0*10E-6*(-0.78155+0.1177*400-3.0254E-6*400*400)*(400-298.)));
dd=;
DD=4346.987

That is right.

Why won't my Density give me the correct result in the OriginC program.

Thank you for your assistance.

rlewis

Canada
253 Posts

Posted - 06/06/2008 :  02:02:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I compiled and ran the Density function under OriginPro 7.5-SR6 and it gave the correct answer ...
Go to Top of Page

verrallr@a

Canada
44 Posts

Posted - 06/06/2008 :  1:32:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I exited Origin 7.5 (non-Pro) and then logged back in to see if that would help. It didn't.

However, I've figured out a new way to get the density.

Richard.
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