Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline ndtma  
#1 Posted : 02 September 2015 15:10:27(UTC)
ndtma


Rank: Advanced Member

Groups: Registered
Joined: 05/06/2014(UTC)
Posts: 348
Man
Sri Lanka
Location: Colombo

Was thanked: 127 time(s) in 82 post(s)
Hi All

A reservoir flood routing program in SMath is attached. This is based on an example in the "Design of Small Dams"-3rd Ed.-page 342.
The results closely tally with the given values in the text book. The text book calculations are manually done by trial & error method in each time step. The SMath program uses a while loop for iterations for each time step.

I will be pleased to have any comments, modifications or improvements please

Regards
ndtma
File Attachment(s):
Small Dams Flood Routing Ex-Program Method.sm (284kb) downloaded 202 time(s).
Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
thanks 2 users thanked ndtma for this useful post.
on 02/09/2015(UTC),  on 02/09/2015(UTC)

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Jean Giraud  
#2 Posted : 03 September 2015 07:38:03(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Most calculations turn red here, Why ? "Cases" keep saying "Undefined".
Will work on that tomorrow.
linterp, ainterp, cinterp don't take units.
A nice 3rd order polynomial fit will replace the Cd ,
Maybe Storage too

Just had a quick look.


Cheers Collab: Jean
Offline Jean Giraud  
#3 Posted : 03 September 2015 07:50:56(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)

Here is Cd 3rd order function fit

A bit of abstract would help and step explanations.

File Attachment(s):
Small Dams Flood Routing Ex-Program Method.sm (308kb) downloaded 59 time(s).
Offline ndtma  
#4 Posted : 03 September 2015 09:28:39(UTC)
ndtma


Rank: Advanced Member

Groups: Registered
Joined: 05/06/2014(UTC)
Posts: 348
Man
Sri Lanka
Location: Colombo

Was thanked: 127 time(s) in 82 post(s)
Dear Jean,

Thanks. I will study your suggestions and come back soon.
Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
Offline ndtma  
#5 Posted : 03 September 2015 14:30:54(UTC)
ndtma


Rank: Advanced Member

Groups: Registered
Joined: 05/06/2014(UTC)
Posts: 348
Man
Sri Lanka
Location: Colombo

Was thanked: 127 time(s) in 82 post(s)
Hi Jean,

1.The “cases” is part of the plugin “FunctionExtensions” by Davide Carpi. It is explained in SMath reference book under help menu. The “cases” handles piecewise Boolean expressions.
2.Cd is the coefficient of discharge over a spillway. It varies with the height of water (h ft) above the spillway crest. The values given in the reference text and the given example are applicable only when we use feet units. We have to use different set of values when we use SI units.
3.When h=0 Cd=0; h=1  Cd=3.2; h=2  Cd=3.4; h=3  Cd=3.6; h=4 Cd=3.7; h>4 Cd=3.7.
For any other h value between 0 & 4, the “cases” statement uses linterp function to interpolate.
For any h>4 Cd  3.8 (constant).
4.If we use 3rd order function fit(x), I don’t get the correct values for fit(0) & fit(>4).
Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
Offline ndtma  
#6 Posted : 03 September 2015 14:38:48(UTC)
ndtma


Rank: Advanced Member

Groups: Registered
Joined: 05/06/2014(UTC)
Posts: 348
Man
Sri Lanka
Location: Colombo

Was thanked: 127 time(s) in 82 post(s)
Hi Jean,

Ammended reply please.

1.The “cases” is part of the plugin “FunctionExtensions” by Davide Carpi. It is explained in SMath reference book under help menu. The “cases” handles piecewise Boolean expressions.
2.Cd is the coefficient of discharge over a spillway. It varies with the height of water (h ft) above the spillway crest. The values given in the reference text and the given example are applicable only when we use feet units. We have to use different set of values when we use SI units.
3.When h=0 ->Cd=0; h=1 -> Cd=3.2; h=2 -> Cd=3.4; h=3 -> Cd=3.6; h=4 -> Cd=3.7.
For any other h value between 0 & 4, the “cases” statement uses linterp function to interpolate.
For any h>4 Cd -> 3.8 (constant).
4.If we use the 3rd order function fit(x), I don’t get the correct values for fit(0) & fit(>4).
Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
Offline Jean Giraud  
#7 Posted : 03 September 2015 16:00:34(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Hi Jean,

Ammended reply please.

1.The “cases” is part of the plugin “FunctionExtensions” by Davide Carpi. It is explained in SMath reference book under help menu. The “cases” handles piecewise Boolean expressions.
2.Cd is the coefficient of discharge over a spillway. It varies with the height of water (h ft) above the spillway crest. The values given in the reference text and the given example are applicable only when we use feet units. We have to use different set of values when we use SI units.
3.When h=0 ->Cd=0; h=1 -> Cd=3.2; h=2 -> Cd=3.4; h=3 -> Cd=3.6; h=4 -> Cd=3.7.
For any other h value between 0 & 4, the “cases” statement uses linterp function to interpolate.
For any h>4 Cd -> 3.8 (constant).
4.If we use the 3rd order function fit(x), I don’t get the correct values for fit(0) & fit(>4).
___________________________________________

I don't have "cases" plugin. I wouldn't use anyway because I only work with fitted model functions. I agree the 3rd order does not match Cd=0 and H=0. If you really want Cd in
that low range, then the model is a sigmoidal fit. I suspect I can manage a model function.

If you want a model fit for the Inflowgraph, by inspection the first segment poly order 2
would fit, but the 2nd segment [RHS] is a decay exponential.
Please confirm if you want a two segments fit for Inflowgraph.

The Inflowgraph does not look real unless the dam is an open vessel to rain.
More likely, it would be a bell shape.
File Attachment(s):
Small Dams Flood Routing Ex-Program Method.sm (322kb) downloaded 39 time(s).
Offline ndtma  
#8 Posted : 03 September 2015 18:50:57(UTC)
ndtma


Rank: Advanced Member

Groups: Registered
Joined: 05/06/2014(UTC)
Posts: 348
Man
Sri Lanka
Location: Colombo

Was thanked: 127 time(s) in 82 post(s)
Thanks for your valuable suggestions.
I am a practicing engineer and I do not have a deep knowledge in complex modelling.
The reservoir is an open vessel to rain, and the inflow hydrograph is real and usually bell shaped in all practical cases.

Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
Offline Jean Giraud  
#9 Posted : 04 September 2015 06:49:05(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Thanks for your valuable suggestions.
I am a practicing engineer and I do not have a deep knowledge in complex modelling.
The reservoir is an open vessel to rain, and the inflow hydrograph is real and usually bell shaped in all practical cases.
____________________________________

You are right: there are as many hydrographs as there are rain bassins [collecting regions].
As such, hydrographs are useless except for the look per year over years. But if you can establish
a typical hydrograph for your region or any specific region, then the most useful piece of
information you can extract is the "cumulative integral",,, in short: the accumulated rain fall.
Even with only 4 data points "Cd" does not ly, and it is not "Cd" in fluid mechanics where Cd is
strictly the SQRT Toricelli. Cd in your work sheet has only one possible relationship with the
cumulative integral. From the raw cumulative integral in the work sheet, you can populate at will
via "ainterp" with the bonus that the cumulative integral is a very powerful smoother.

Some well known bell shape PDF [Probabilty Distribution Function] have a cumulaive integral as a function. But for "odd bell shape", a function to validate their cumulative integral is an artist task. A typical use for a function is the "quantile", i.e: the inverse of the cumulative. There was such demand in the Mathsoft Collaboratory.

You must explain/explicit what is "Cd" from the reference book.
Cd = "Cumulative discharge" [Cumulative dischar"ged" from sky ?

Thanks for sharing your project, very interesting and educative.
File Attachment(s):
Small Dams Flood Routing Ex-Program Method.sm (344kb) downloaded 60 time(s).
Offline ndtma  
#10 Posted : 04 September 2015 07:51:10(UTC)
ndtma


Rank: Advanced Member

Groups: Registered
Joined: 05/06/2014(UTC)
Posts: 348
Man
Sri Lanka
Location: Colombo

Was thanked: 127 time(s) in 82 post(s)
Thanks for sharing your views and suggestions, and look forward to have further dialogue in future.
Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
Offline Jean Giraud  
#11 Posted : 15 September 2015 04:40:56(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Hello Collab,

Your "vlookup(value,table,col)" does not work in my Smath,
This one attached works fine for me except for the error message,
I can live with this as is, if there is no match it turns red.

Your last GVF wanted to update "dependencies" and it suggested
the list of updates, I did accept and updated ...
.... disaster !!!
it turned my Smath work sheets red [checked only few].
The updates suggested by your version of Smath are not
compatible with my installed Smath.

Sorry for that inconvenience.

Cheers Collab, wish you good.
File Attachment(s):
Untitled match.sm (7kb) downloaded 46 time(s).
Offline ndtma  
#12 Posted : 15 September 2015 06:22:30(UTC)
ndtma


Rank: Advanced Member

Groups: Registered
Joined: 05/06/2014(UTC)
Posts: 348
Man
Sri Lanka
Location: Colombo

Was thanked: 127 time(s) in 82 post(s)
Hi,

Thanks. I use Version 0.97(build 5581); Date 13-04-2015.
Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.