All, I have now been trying to use the MatLab code in C++, I get a result, a subsequent iterations change the values, I believe the result is still in correct-- perhaps not, I will check.
...
Type: Posts; User: mcjeff
All, I have now been trying to use the MatLab code in C++, I get a result, a subsequent iterations change the values, I believe the result is still in correct-- perhaps not, I will check.
...
Changed the '<' sign as suggested and the result is the same: -1 for the friction coefficient.
//TURBULENT
if (rnum > 4000) {
do
{
...
I have tried your method and came up with:
do
{
tpfc = pow ( -2 * log10 (rrough / 3.7 + 2.51 / ( rnum * sqrt (tpfc2 + 1e - 300 ))), -2);
}
...
Indeed you are all correct.
I would prefer a tolerance of 1-E6. But am still unsure as to how to make that happen. The goal of the formula is to use iteration to solve for the factor (f) until...
So I would need to use a "Do" statement?
From MSDN:
do
{
tpfc = pow ( -2 * log10 (rrough / 3.7 + 2.51 / ( rnum * sqrt (tpfc2 + 1e - 300 ))), -2);;
} while (tpfc = tpfc2);
Interesting, it looks like I have done a bunch of defining variables when that was un-needed. Just another thing to put down for the ol'learning curve.
Now when you mention a big-loop, I am...
Howdy all,
I just started programming some 1 days ago, I have the program complete except for the following problem-- iteration. I consider myself pretty engineering savy when it comes to Excel...