|
-
Jul 14th, 2014, 10:11 PM
#1
Thread Starter
Lively Member
How do I code this formula properly
I already know each variable and constant
-
Jul 14th, 2014, 11:02 PM
#2
Re: How do I code this formula properly
Addition in VB is `+`, subtraction is `-`, multiplication is `*` and division is `/`. Exponentiation is `^` and parentheses work exactly how you would expect. That's all that's used in that formula so where exactly is the difficulty? They teach you in primary school how to write formulas like that on a single line so pick up a pen and paper and do exactly that. The VB code will be pretty much exactly the same.
-
Jul 14th, 2014, 11:38 PM
#3
Thread Starter
Lively Member
Re: How do I code this formula properly
This is a college level math formula that calculates the wet adiabatic lapse rate in thermodynamics.
-
Jul 14th, 2014, 11:47 PM
#4
Re: How do I code this formula properly
 Originally Posted by supercell1970
This is a college level math formula that calculates the wet adiabatic lapse rate in thermodynamics.
It doesn't matter that the formula itself is used in college maths. It still only uses the four fundamental operators (+, -, *, /) as well as exponentiation and parentheses. You might have to be in college to know what it means but, if you've done primary school maths, you can write it out in one line. If you think you can't then you haven't really given it much thought. Let's take just the enumerator of the main fraction. That can be written as:
Code:
1 + ((Lv * rv) / (R * T))
or, with superfluous parentheses removed:
Code:
1 + Lv * rv / (R * T)
Are you really telling me that you have to be in college to do that? The rest is more of the same.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|