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
Forum for Origin C
Simple problem
Note:
You must be registered in order to post a reply.
To register,
click here
. Registration is FREE!
Screensize:
640 x 480
800 x 600
1024 x 768
1280 x 1024
UserName:
Password:
Anti-Spam Code:
Format Mode:
Basic
Help
Prompt
Format:
Font
Andale Mono
Arial
Arial Black
Book Antiqua
Century Gothic
Comic Sans MS
Courier New
Georgia
Impact
Lucida Console
Script MT Bold
Stencil
Tahoma
Times New Roman
Trebuchet MS
Verdana
Size
1
2
3
4
5
6
Color
Black
Red
Yellow
Pink
Green
Orange
Purple
Blue
Beige
Brown
Teal
Navy
Maroon
LimeGreen
Message:
* HTML is OFF
*
Forum Code
is ON
Smilies
[quote][i]Originally posted by verrallr@a[/i] [br]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. [/quote]
Check here to include your profile signature.
Check here to subscribe to this topic.
T O P I C R E V I E W
verrallr@a
Posted - 06/05/2008 : 2:32:10 PM
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.
2 L A T E S T R E P L I E S (Newest First)
verrallr@a
Posted - 06/06/2008 : 1:32:25 PM
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.
rlewis
Posted - 06/06/2008 : 02:02:36 AM
I compiled and ran the Density function under OriginPro 7.5-SR6 and it gave the correct answer ...
The Origin Forum
© 2020 Originlab Corporation
Snitz Forums 2000