CR4® - The Engineer's Place for News and Discussion®

 Previous in Forum: When Nature Takes Over Next in Forum: Local Building Codes
Member

Join Date: Mar 2016
Posts: 5

# Math Problem Channels

03/30/2016 3:18 PM
Pathfinder Tags: "Math"
Interested in this topic? By joining CR4 you can "subscribe" to

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, rate them!
Guru

Join Date: Mar 2007
Location: at the beach in Florida
Posts: 19731
#1

### Re: Math problem Channels

03/30/2016 3:22 PM
__________________
Life is like riding a bicycle. To keep your balance you must keep moving. A.E.
Member

Join Date: Mar 2016
Posts: 5
#2

### Re: Math problem Channels

03/30/2016 3:29 PM

Thanks for your reply . The key is not important I just need to know how the last sentence /bit was calculated.

Guru

Join Date: Apr 2010
Posts: 5902
#3

### Re: Math problem Channels

03/30/2016 4:17 PM

Iteration means plug in a value for h on the right side, solve for h on the left side, plug that in for h on the right, solve again for h on the left, ...

If it converges, you get the answer after a number of "iterations". If it doesn't converge, it won't work.

An example is to set your scientific calculator for radians, hit cos repeatedly. Eventually, you will have a solution for "h = cos(h)".

Member

Join Date: Mar 2016
Posts: 5
#4

### Re: Math problem Channels

03/30/2016 4:35 PM

i have tried to do this by excel and what i found ,that the looking number is 1.3797 in brackets because it will give me 3.094 m . My answer.

h= 2.242(1.3797)=3.0932874 so now what was my h then ? i know that my value in braket is 1.3797 thus i can write it down as

1.3797=(1+0.4h)^2/5

am i doing it right ? i found that value looking at the answer but i have no idea how to find the right one value without the answer . Thank you very much for your comments

Guru

Join Date: Apr 2010
Posts: 5902
#10

### Re: Math problem Channels

03/30/2016 6:17 PM

I doubt you can put your answer back into the same excel cell and calculate it over and over. Spreadsheets tend to get upset if you set up an infinite loop (which is what this would be). So you have to have an excel row for each iteration.

Set up two columns, hin and hout. Each row will be an iteration. Set up your formula for hout in terms of hin and copy the formula into each row in that column. For each row (about 20 rows) copy hout cell into hin cell in next row (or next iteration).

I programmed it in Matlab for 20 iterations and here is what I got:

As you can see, I don't get 3.094 either.

Guru

Join Date: Apr 2010
Posts: 5902
#11

### Re: Math problem Channels

03/30/2016 7:11 PM

Correction: Sorry, I had a parenthesis typo in my program:

Here is the correct result:

Here is the code:

h(1)=2.2442

for k=1:20

h(k+1)=2.2442*((1+0.4*h(k))^.4);

end

h'

Guru

Join Date: May 2009
Location: Richland, WA, USA
Posts: 20068
#12

### Re: Math problem Channels

03/30/2016 7:14 PM

When I plug 3.094 into the right side, I get 3.094 out on the left; hence stabilization. Your sequence shows convergence nicely, but I think there is a wrong number in it somewhere.

I did just that one calc. This computer doesn't have an Excel equivalent on it, and firing up my laptop is too much hassle.

__________________
In vino veritas; in cervisia carmen; in aqua E. coli.
Guru

Join Date: Jun 2010
Posts: 1301
#14

### Re: Math problem Channels

03/30/2016 7:45 PM

You used the wrong factor - your 2.2442 should be 2.242 if I'm not mistaken. Actually this reply is to Rixter.

Guru

Join Date: May 2009
Location: Richland, WA, USA
Posts: 20068
#15

### Re: Math problem Channels

03/30/2016 7:48 PM

Doesn't matter, especially as you got it to converge from just plain 2.

__________________
In vino veritas; in cervisia carmen; in aqua E. coli.
Guru

Join Date: Apr 2010
Posts: 5902
#17

### Re: Math problem Channels

03/30/2016 8:28 PM

You are correct. GA. Thanks! Sometimes it takes awhile to get all the bugs out!

Guru

Join Date: May 2009
Location: Richland, WA, USA
Posts: 20068
#18

### Re: Math problem Channels

03/30/2016 8:51 PM

Maybe, but the bug wasn't a 2.242 vs. 2.2442 bug; it was something else, such as the parentheses you already mentioned.

__________________
In vino veritas; in cervisia carmen; in aqua E. coli.
Guru

Join Date: May 2009
Location: Richland, WA, USA
Posts: 20068
#5

### Re: Math problem Channels

03/30/2016 5:00 PM

Start with h = 2.242 on the right side; calculate "new" h on the left.
Plug "new" h in on the right; calculate "newer" h on the left.
Repeat a few times to see if this succession of h's closes in on a value.

Sometimes the symbol <-- is used instead of =.

__________________
In vino veritas; in cervisia carmen; in aqua E. coli.
Guru

Join Date: Mar 2007
Location: Etherville
Posts: 12128
#6

### Re: Math Problem Channels

03/30/2016 5:08 PM

Could you supply Questions 1 -9 so I can get up to speed.

The answer is 3.068. I need to see the pevious questions to confirm.

word.

__________________
For sale - Signature space. Apply on self addressed postcard..
Guru

Join Date: Aug 2007
Posts: 19306
#7

### Re: Math Problem Channels

03/30/2016 5:12 PM

The more iterations you have, the closer to the actually answer you get

__________________
phoenix911
Guru

Join Date: Mar 2007
Location: Etherville
Posts: 12128
#8

### Re: Math Problem Channels

03/30/2016 5:18 PM
__________________
For sale - Signature space. Apply on self addressed postcard..
Member

Join Date: Mar 2016
Posts: 5
#9

### Re: Math Problem Channels

03/30/2016 5:41 PM

Ok, guys, i think that I have the answer the correct final Hn is =3.08987

i have done that by excel so as someone written the post with advice i was trying different h . till 2 columns where the same like thIS :

the left column this is guessed h and right column it is value calculated from h=2.242(1+0.4*3.094)

Many Thanks !

Guru

Join Date: Jun 2010
Posts: 1301
#13

### Re: Math Problem Channels

03/30/2016 7:42 PM

Check the way you have the parentheses. Starting with an initial trial of 2, my Excel (2000 so it may not be the most accurate ), converges to 3.094259 in 11 iterations.

2
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 3923
#19

### Re: Math Problem Channels

03/31/2016 6:41 AM

There's something wrong there. That's one way to get an iterative answer, but there's an easier way, using less of your XL worksheet!

If you type in

h = (n*Q/b/S^0.5)^0.6*(1 + 2*h/b)^0.4

(using cell refs, obviously) you're likely to get a circular reference message. Click on the top LH corner button, and choose Excel Options/Formulas. Top right, click Allow Iterative Calculation, and play with the other options if you want. Gives you the result directly. Also did it your way, and both gave the same answer,

3.09392139

I think one of your inputs must be slightly out.

__________________
Give masochists a fair crack of the whip
Member

Join Date: Mar 2016
Posts: 5
#20

### Re: Math Problem Channels

03/31/2016 10:17 AM

Hi Codemaster

Can you explain me how did u get this formula :

h = (n*Q/b/S^0.5)^0.6*(1 + 2*h/b)^0.4

how did u find dependence ?

Many thanks , good to see that there is easier and faster way to get more accurate answer !

Score 1 for Off Topic
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 3923
#21

### Re: Math Problem Channels

03/31/2016 12:35 PM

Yes, it's just the formula in your original post, 4th = sign up from the bottom. Come back if you need more.

__________________
Give masochists a fair crack of the whip
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 3923
#26

### Re: Math Problem Channels

04/25/2016 7:29 AM

If anybody's still interested - I was on XL 2010 the other day and Excel Options/Allow Iterative Calculation has been moved from my 2007 version. Took me a few minutes to find it, but it's now in File/Options. Seems a odd place for it but there you are!

__________________
Give masochists a fair crack of the whip
Guru

Join Date: Mar 2007
Location: Etherville
Posts: 12128
#22

### Re: Math Problem Channels

03/31/2016 10:49 PM

Somebody voted you Off Topic. No Idea who or why, but I've just negated that with a positive vote. Newcomers to CR4 often get a rough ride, but I see no Justification for that. I'm giving myself a -5 since this comment adds no value to the question. Hopefully you'll not be put off. CR4 can be a bit quirky until you understand the mix of technical stuff and banter.

__________________
For sale - Signature space. Apply on self addressed postcard..
Off Topic (Score 6)
Guru

Join Date: Aug 2007
Posts: 19306
#23

### Re: Math Problem Channels

04/01/2016 7:25 AM

Actually, I think this is one of the better problem solving posts... A lot of positive responses

__________________
phoenix911
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 3923
#24

### Re: Math Problem Channels

04/02/2016 7:13 AM

That's right, shows how we help each other.

For solving the Moody equation for friction factor F in pipe flow, with XL I've always used iteration, 10 steps is usually plenty. But when this question came up, made me wonder why I don't use the method in #19. I tried it and got a #DIV/0!, because the F is on the bottom, and it starts the iteration at zero. It was easy enough to fix, define 1/F, find that and then take the reciprocal, and it works fine. A neater solution which I'll use in future. So benefit all round!

__________________
Give masochists a fair crack of the whip
Guru

Join Date: Aug 2007
Posts: 19306
#25

### Re: Math Problem Channels

04/02/2016 9:59 AM

Back in the 90's I've written programs to size heat exchangers that they fabricated (which I also designed for them), my boss wanted me to write one in excel... It was quite a task using iterations..., I give up on it, and hard harder it 4 times.

He's still using that program to size heat exchanger.

__________________
phoenix911
Anonymous Poster #1
#16

### Re: Math Problem Channels

03/30/2016 7:58 PM

If it takes a hen and a half a day and a half to lay an egg and a half, how many iterations will it take to get her to drink a thimble full of water?

Score 2 for Off Topic
Interested in this topic? By joining CR4 you can "subscribe" to