The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Help with while loop
Replies: 1   Last Post: Sep 12, 2013 4:54 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Yutthana Jeenjiu

Posts: 1
Registered: 9/12/13
Help with while loop
Posted: Sep 12, 2013 11:56 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Please help with trying to make the while loop work

e =0.0015;
D =50;
V =2;
Dm =0.05;
v =1.01*10^-6;
Re = V*Dm/v;
N =1000;
f = linspace(0.008,0.1,N);

i = 0;
f_abs = 1;
FF = 0.008;

while FF(end) < f_abs;
i = i + 1;
FF = log(e/D/3.7 + 2.51*Re*sqrt (f(i)))*sqrt(f(i))*-2;

My aim is to iterate through f until the equation or FF is equal to 1 or less than .001 away from 1.
Please note i am a beginner user and have no prior programming knowledge

Thanks Jimmy

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.