Re: Simple but long proof...

No idea what you mean by "turning into code"; or by "proof".

Noticed that the .75*RHK*? has a right bracket ")" missing.

What are you looking for? Ways to shorten? Ways to "keypunch it in"?

Re: Simple but long proof...

I am actually just trying to verify that this equation does indeed solve to the expected result. My math is not strong enough for me to tell if there is a something wrong with how I am coding it, or if there is something wrong with the proof. I do see the missing closing bracket. I will follow up on that and verify its location. I really appreciate your help.

Re: Simple but long proof...

Also, the |_ _| brackets shown (beginning and end of equation) mean the "floor function"

(as example, if 3.746... then 3 is result), which makes no sense given your expected

results of HG= 0.112113426675006

I assume e = Euler number.

The "powers" are quite difficult to discern; can you show them in a clear way?

Other minor stuff is confusing, like why mutiply by T when T=1 ?!

Re: Simple but long proof...

Very helpful heads up on the floor function. I had only considered it as a grouping function.

e is Euler number.

T is for a duration variable. The objective of this equation is to calculate the amount a tree has grown for a single cycle and the duration of the cycle is specified by T.

Re: Simple but long proof...

OK. You have RHSX = 0. Is that ok? Means RHSX^(1 - RHB) = 0.

Finally, on powers:

the right portion of 2nd line of equation shows e^[-RHR / (1 - RHB)] * (another expression) :

is the "other expression" part of the "power", or is it just a subsequent multiplication?

AND the missing half-bracket?!

Re: Simple but long proof...

OK the flooring brackets are meant to be parenthesis.

The missing half bracket is supposed to include the rest of the line. .75*RHK*(...(1/1-RHM))

e^[-RHR / (1 - RHB)] * (another expression) - this is part of the power

You have been a tremendous help on this. I really appreciate it, I had no idea there were this many anomalies in this equation.

Re: Simple but long proof...

Quote:

Originally Posted by

**cwigley** T is for a duration variable. The objective of this equation is to calculate the amount a tree has grown for a single cycle and the duration of the cycle is specified by T.

HOKAY!! Now I see why parts of your equation are a bit like Future Value of money formulas...

The using of e^(.....) is obviously for continuous compounding.

Well, I entered your formula along with the values of the variables (I use UBasic programming)

but cannot come anywhere near .112113.... as solution: I get 0.006953....

You got that formula from "WHO"?

Again, I'll tell you that I don't understand what you mean by needing "help in coding".

Let's take something simple:

A = u + v + w^x

u=4, v=5, w=2, x=3

Much smaller/simpler than your problem, but works same way.

To "code" that in UBasic:

u=4, v=5, w=2, x=3

A = u + v + w^x

Print A

output: 17

If it helps, I renamed your variables this way:

u=C1=1.1557, v=C2=1.0031, w=C3=-0.0408, x=C4=0.9807, y=C5=0.0314, z=CR=0.475

p=SI=60, q=RELHT=0.806719650456935, r=AGET=76.4073801204541

f=RHB=-1.6, g=RHK=1, h=RHM=1.1, i=RHR=13, j=RHXS=0, k=RHYXS=0.05

So, as example, the left side of the 1st line of your formula becomes:

u * p^v * (1 - e^(w * (r - 1)))^(x * p^y)

Re: Simple but long proof...

Man after many rounds with the provider of that #$@! equation I finally got it worked out. I started off assuming the equation was right and my math was wrong. Turns out there were several errors in there that were a result of him not knowing how to specify his needs in an equation. Below is the working C# code that produces the desired result. You will notice a couple of bounding statements that weren't in the original equation!!

You have no idea how much you helped me man, truely appreciate it. I was losing my mind!

private double getHeightGrowth(){

double condition1 = (100*Math.Pow(CR, 3.0)*Math.Exp(-5.0*CR)) > 1.0 ? 0.99 : (100*Math.Pow(CR, 3.0)*Math.Exp(-5.0*CR));

double condition2 = (RHK)*Math.Pow((1.0+((Math.Pow((RHK/RHYXS), (RHM-1.0)))-1.0)*Math.Exp(((-1.0*RHR)/(1.0-RHB))*((Math.Pow(RelativeHeight, (1.0-RHB)))-(Math.Pow(RHXS, (1.0-RHB)))))),(1.0/(1.0-RHM))) > 1.0

? 0.99

: (RHK)*Math.Pow((1.0+((Math.Pow((RHK/RHYXS), (RHM-1.0)))-1.0)*Math.Exp(((-1.0*RHR)/(1.0-RHB))*((Math.Pow(RelativeHeight, (1.0-RHB)))-(Math.Pow(RHXS, (1.0-RHB)))))),(1.0/(1.0-RHM)));

double result = DurationOfCycle*

(((C1*(Math.Pow(SiteIndex, C2)))*Math.Pow((1.0-Math.Exp(C3*((AGET)+5.0))), (Math.Pow((C4*SiteIndex), C5))))-

((C1*(Math.Pow(SiteIndex, C2)))*Math.Pow((1.0-Math.Exp(C3*(AGET))), (Math.Pow((C4*SiteIndex), C5)))))*(0.25*condition1+0.75*condition2);

return result/5.0;

}

Re: Simple but long proof...

Quote:

Originally Posted by

**cwigley** I was losing my mind!

(100*Math.Pow(CR, 3.0)*Math.Exp(-5.0*CR))

Happy fer you, buddy; glad to see you're not playing basketball for Jack Nicholson's team!

Why use that messy C# language...YUK!

Above would be in Basic: (100 * CR^3 * e^(-5*CR))

In case you forgot: exp(x) is same as e^x

Re: Simple but long proof...

In that messy C# stuff ^ is an XOr operator. I am happy to code in about anything, do it long enough its all semantics. C# was just part of the requirement :)