Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Invalid Parenthensis in Formula


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-31-2008, 02:06 PM
MM2forever's Avatar
Junior Member
 
Join Date: Jun 2007
Location: Germany
Posts: 49
Send a message via ICQ to MM2forever Send a message via MSN to MM2forever Send a message via Skype™ to MM2forever
Default Invalid Parenthensis in Formula

Hi guys,
can you tell me what gives the invalid parenthensis with this formula?:

Quote:
(234.67*0.434292289*Ln(6.1*exp((7.45*temp.Value)/(234.67+temp.Value)*
2.3025851)*lf.Value/100/6.1))/(7.45-0.434292289*Ln(6.1*exp((7.45*
temp.Value)/(234.67+temp.Value)*2.3025851)*lf.Value/100/6.1))
is it the Ln function which recieves a value higher than a Double or just some wrong brackets?
__________________
Regards, Christian

>> My PPC Hardware <<


There are 10 kinds of people: Those who understand binary, and those who don't.
Reply With Quote
  #2 (permalink)  
Old 05-31-2008, 02:14 PM
dzt's Avatar
dzt dzt is offline
Basic4ppc Veteran
 
Join Date: May 2007
Location: Greece
Posts: 353
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by MM2forever View Post

Code:
 
(234.67*0.434292289*Ln(6.1*exp((7.45*temp.Value)/(234.67+temp.Value)*
2.3025851)*lf.Value/100/6.1))/(7.45-0.434292289*Ln(6.1*exp((7.45*
temp.Value)/(234.67+temp.Value)*2.3025851)*lf.Value/100/6.1))


Why don't you try to brake it in smaller parts?
__________________
Dimitris Zacharakis
http://www.terracom.gr
Reply With Quote
  #3 (permalink)  
Old 05-31-2008, 02:24 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 650
Default

Hi MM2forever,

there is no function exp() provided by basic4ppc. Is this a custon function implemented by you?


specci48
Reply With Quote
  #4 (permalink)  
Old 05-31-2008, 02:25 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 707
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

I suppose the exp(x) means e at the power of x.
Exp is NOT a keyword in B4PPC.
You must replace it with:
cE^(x) this works.

In the IDE Keywords are dispayed in blue, exp is in black so not a keyword.

Best regards
__________________
Klaus
Switzerland
Reply With Quote
  #5 (permalink)  
Old 05-31-2008, 04:57 PM
MM2forever's Avatar
Junior Member
 
Join Date: Jun 2007
Location: Germany
Posts: 49
Send a message via ICQ to MM2forever Send a message via MSN to MM2forever Send a message via Skype™ to MM2forever
Default

uppsss...

I thought replaced all exp's, but i forgot some as you see.
(it used to be an excel formula)

Thanks for the lead!

I've corrected it to this:

(234.67*0.434292289*Ln(6.1*cE^(7.45*temp.Value)/(234.67+temp.Value)*
2.3025851)* lf.Value/100/6.1))/(7.45-0.434292289*Ln(6.1*(cE^(7.45*
temp.Value)/(234.67+temp.Value)*2.3025851)*lf.Value/100/6.1))

but it still gives me the same error
__________________
Regards, Christian

>> My PPC Hardware <<


There are 10 kinds of people: Those who understand binary, and those who don't.
Reply With Quote
  #6 (permalink)  
Old 05-31-2008, 05:08 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

You should remove the bold parenthesis:
(234.67*0.434292289*Ln(6.1*cE^(7.45*temp.Value)/(234.67+temp.Value)*
2.3025851)* lf.Value/100/6.1))/(7.45-0.434292289*Ln(6.1*(cE^(7.45*
temp.Value)/(234.67+temp.Value)*2.3025851)*lf.Value/100/6.1))
Reply With Quote
  #7 (permalink)  
Old 05-31-2008, 05:42 PM
MM2forever's Avatar
Junior Member
 
Join Date: Jun 2007
Location: Germany
Posts: 49
Send a message via ICQ to MM2forever Send a message via MSN to MM2forever Send a message via Skype™ to MM2forever
Default

hi, i finally made it:

I've eased and split up the formula to this:

SDD=6.1078*10^((a*temp.Value)/(b+temp.Value))
DD=lf.Value/100*SDD
v=Log(DD/6.1078)
TD=b*v/(a-v)

(TD is the result)

now it works!

BTW: this formula calculates the 'dew point' from the given temperature and rel. humidity
__________________
Regards, Christian

>> My PPC Hardware <<


There are 10 kinds of people: Those who understand binary, and those who don't.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trignomic Cycle formula Cableguy Chit Chat 3 08-16-2008 05:13 PM
"OutlookDesktop in invalid" Berurier Questions & Help Needed 4 11-05-2007 09:43 AM
SQLDesktop.dll invalid magi6162 Questions & Help Needed 2 05-19-2007 04:00 PM
Format of file "SQLDesktop.dll" is invalid. Peter Bug Reports 2 05-03-2007 11:58 AM


All times are GMT. The time now is 03:43 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0