Team Updates

Team Stream Item
rd-coutinhoRenato Domingues Coutinho
Team Stream Item
rd-coutinhoRenato Domingues Coutinho
Team Stream Item
rd-coutinhoRenato Domingues Coutinho
Team Stream Item
rd-coutinhoRenato Domingues Coutinho
Team Stream Item
rd-coutinhoRenato Domingues Coutinho
Our logo!
Our logo!
rd-coutinhoRenato Domingues Coutinho
Team Stream Item
rd-coutinhoRenato Domingues Coutinho
importnumpyasnp
importmatplotlib.pyplotasplt
importpandasaspd
# Training the model
dataset_train=pd.read_excel("DADOS CLIMÁTICOS APP-2.xlsx")
training_set=dataset_train.iloc[:,1:2].values
fromsklearn.preprocessingimportMinMaxScaler
sc=MinMaxScaler(feature_range= (0,1))
training_set_scaled=sc.fit_transform(training_set)
x_train= []
y_train= []
foriinrange(12, 669):
x_train.append(training_set_scaled[i-12:i,0])
y_train.append(training_set_scaled[i,0])
x_train, y_train=np.array(x_train), np.array(y_train)
x_train=np.reshape(x_train, (x_train.shape[0], x_train.shape[1], 1))
fromkeras.modelsimportSequential
fromkeras.layersimportDense
fromkeras.layersimportLSTM
fromkeras.layersimportDropout
fromkeras.callbacksimportModelCheckpoint
data_path="C:\\Users\\renat\\OneDrive\\Área de Trabalho\\NASA"
regressor=Sequential()
regressor.add(LSTM(units=80, return_sequences=True, input_shape= (x_train.shape[1], 1)))
regressor.add(Dropout(0.2))
regressor.add(LSTM(units=80, return_sequences=True))
regressor.add(Dropout(0.2))
regressor.add(LSTM(units=80, return_sequences=True))
regressor.add(Dropout(0.2))
regressor.add(LSTM(units=80, return_sequences=False))
regressor.add(Dropout(0.2))
regressor.add(Dense(units=1))
regressor.compile(optimizer="adam", loss="mean_squared_error")
#print(regressor.summary())
checkpointer=ModelCheckpoint(filepath=data_path+"\\regressor-{epoch:02d}.hdf5", verbose=1)
#regressor.fit(x_train, y_train, epochs = 20, batch_size = 32)
regressor.fit(x_train, y_train, epochs=50, batch_size=32, callbacks=[checkpointer])
regressor.save(data_path+"final_regressor.hdf5")
#regressor = regressor.load(data_path + "\\regressor-100.hdf5")
#regressor = load_model(data_path + "\model-100.hdf5")
regressor.load_weights(data_path+"\\regressor-28.hdf5")
# Testing the model
dataset_test=pd.read_excel("DADOS CLIMÁTICOS APP-2 test.xlsx")
real_precipitation_value=dataset_test.iloc[:,1:2].values
dataset_total=pd.concat((dataset_train["chuva (mm)"], dataset_test["chuva (mm)"]), axis=0)
inputs=dataset_total[len(dataset_total) -len(dataset_test) -12:].values
inputs=inputs.reshape(-1,1)
inputs=sc.transform(inputs)
x_test= []
foriinrange(12, 13):
x_test.append(inputs[i-12:i,0])
x_test=np.array(x_test)
x_test=np.reshape(x_test, (x_test.shape[0], x_test.shape[1], 1))
predicted_precipitation_value=regressor.predict(x_test)
predicted_precipitation_value=sc.inverse_transform(predicted_precipitation_value)
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!-->
<htmlclass="no-js" lang="en">
<!--<![endif]-->
<head>
<metacharset="utf-8">
<metahttp-equiv="X-UA-Compatible" content="IE=edge">
<metaname="viewport" content="width=device-width, initial-scale=1">
<metaname="google-site-verification" content="" />
<title>StartWater</title>
<metaname="description" content="">
<linkrel="icon" type=text/csshref="favicon.ico">
<linkrel="stylesheet" href="vendors/bootstrap/dist/css/bootstrap.min.css">
<linkrel="stylesheet" href="assets/css/style.css">
<linkrel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
<linkhref='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800' rel='stylesheet' type='text/css'>
<linkrel="stylesheet" href="vendors/bootstrap/dist/css/bootstrap.min.css">
<linkrel="stylesheet" href="vendors/font-awesome/css/font-awesome.min.css">
<linkrel="stylesheet" href="vendors/themify-icons/css/themify-icons.css">
<linkrel="stylesheet" href="vendors/flag-icon-css/css/flag-icon.min.css">
<linkrel="stylesheet" href="vendors/selectFX/css/cs-skin-elastic.css">
<style>
body {
/* background-color: #04a5f0; */
background-image:url("galaxy.jpeg");
}
</style>
<script>
functionchangeSelect(value){
varvalor=document.getElementById("valor");
if(value==0){
valor.value=0;
}else{
valor.value=150;
};
};
</script>
</head>
<body>
<!-- <div style="font-size: 4vw; font-family: Georgia, 'Times New Roman', Times, serif; width: 100%; text-align: center; color: white; margin-top: 1vw;">Start Water App</div> -->
<imgsrc="logo 2.png" alt="logo" height="400" width="400" style="margin: 0 0 0 40vw;">
<divstyle="width: 100%">
<divid="" style="display: block; width: 100%; height: auto; margin: 0 0 -2vw 0;">
<divclass="col-sm-5" style="margin: 0 0 0 2vw">
<divclass="card sombra" style="width: 94.5vw; height: 23vw;">
<divclass="card-header sombra" style="background-color: lightgray; color: black; border: none; text-align: center;">
<!-- <strong class="card-title">Cálculo de Economia de Água e Economia Financeira em Segundos</strong> -->
<strongclass="card-title">Calculation of Water and Money Savings in Seconds</strong>
</div>
<divclass="card-body">
<selectid="" onchange="changeSelect(this.value)" type="text" class="form-control col-lg-5" style="margin: 0 auto 0 auto; float: left;">
<optionvalue="0" selecteddisabled>Select your City</option>
<optionvalue="1">Ribeirão Preto</option>
<optionvalue="2">Cravinhos</option>
<optionvalue="3">São Paulo</option>
<optionvalue="4">Franca</option>
</select>
<selectid="" type="text" class="form-control col-lg-5" style="margin: 0 auto 0 auto; float: right;">
<optionselecteddisabled>Select how many males there are in your family</option>
<option>1</option>
<option>2</option>
<option>3 or more</option>
</select>
<divstyle="margin: 1vw auto 0 auto; width: 50vw; float: left;">
<!-- <div style="display: inline-block;">Nível de Precipitação para o Mês em Mililitros (Estimado):</div> -->
<divstyle="display: inline-block;">Precipitation for the Month in Mililiters (Estimated):</div>
<inputid="valor" type="number" class="form-control col-lg-3" style="margin: 1vw 0 0 1vw; width: 7vw; display: inline-block;" value="0">
</div>
<selectid="" type="text" class="form-control col-lg-5" style="margin: 2vw auto 0 auto; float: right;">
<optionselecteddisabled>Select how many females there are in your family</option>
<option>1</option>
<option>2</option>
<option>3 or more</option>
</select>
<divstyle="margin: 1vw auto 0 auto; width: 60vw; float: left">
<!-- <div style="display: inline-block;">Informe a largura e o comprimento do seu telhado em metros:</div> -->
<divstyle="display: inline-block;">Inform the width and length of your rooftop in meters:</div>
<divstyle="display: inline-block; margin-left: 1vw;">Width: </div>
<inputtype="number" class="form-control col-lg-3" style="margin: 1vw 0 0 1vw; width: 7vw; display: inline-block;" value="8">
<divstyle="display: inline-block; margin-left: 1vw;">Lenght: </div>
<inputtype="number" class="form-control col-lg-3" style="margin: 1vw 0 0 1vw; width: 7vw; display: inline-block;" value="12">
</div>
<!-- Botão Calcular -->
<buttontype="button" data-toggle="modal" data-target="#botaoCalculo" class="col-lg-3 sombra" style="margin: 2.5vw auto 1vw 35vw; padding: .6vw 0;
text-align: center; border-radius: .3vw; background: #04a5f0; color: #ffffff;
cursor:pointer; text-align: center; float: left;">
<iclass="fas fa-calculator" style="margin: 0 1vw 0 0; font-size: 1.5vw;"></i><b>Calculate</b>
</button>
</div>
</div>
</div>
</div>
</div>
<divclass="modal fade" id="botaoCalculo" tabindex="-1" role="dialog" aria-labelledby="largeModalLabel" aria-hidden="true">
<divclass="modal-dialog modal-sm" role="document">
<divclass="modal-content" style="width: 80vw; height: 40vw; margin: 0 0 0 -30vw; position: absolute;">
<divclass="modal-header">
<h5class="modal-title" id="largemodalLabel">Detailed Calculation for the Month of October of 2019:</h5>
<buttontype="button" class="close" data-dismiss="modal" aria-label="Close">
<spanaria-hidden="true">&times;</span>
</button>
</div>
<divclass="modal-body" style="text-align: left; list-style-type:none; padding: none; cursor: pointer">
<divid="" style="margin-left: 2vw; text-align: center;" data-dismiss="modal">Annual Water Savings: <spanstyle="font-size: 1.5vw; color: blue">71.3%.</span></div>
<divid="" style="margin: 2vw 0 0 2vw; text-align: center" data-dismiss="modal" style="margin-top: 2vw;">Water Costs Before the System: <spanstyle="font-size: 1.5vw">R$16.302,00.</span> Water Costs After the System: <spanstyle="font-size: 1.5vw">R$4.678,00.</span> Total Savings in your Pocket (In 1 Year): <spanstyle="font-size: 1.5vw; color: blue">R$11.623,00.</span></div>
<!-- <div id="" style="margin: 2vw 0 0 2vw; text-align: center" data-dismiss="modal" style="margin-top: 2vw;">Tempo para Recuperar o Investimento Financeiro: <span style="font-size: 1.5vw; color: blue">.</span></div> -->
<divid="" style="margin: 2vw 0 0 2vw; text-align: center" data-dismiss="modal" style="margin-top: 2vw;">Reservoir Size (in cubic meters): <spanstyle="font-size: 1.5vw; color: blue">200.</span></div>
<imgsrc="grafico 1.png" alt="Gráfico consumo de água potável" height="330" width="750" style="margin: 1.5vw 0 0 19vw;">
</div>
</div>
</div>
</div>
<scriptsrc="vendors/jquery/dist/jquery.min.js"></script>
<scriptsrc="vendors/popper.js/dist/umd/popper.min.js"></script>
<scriptsrc="vendors/bootstrap/dist/js/bootstrap.min.js"></script>
<scriptsrc="assets/js/main.js"></script>
</body>
# Variáveis e cálculos utilizados no aplicativo
# Meses
ano1= ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro',
'novembro', 'dezembro']
ano2= ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro',
'novembro', 'dezembro']
# Volume de chuva mensal (m3)
# Chuva média mensal (mm)
# Área (m2)
# Demanda mensal (m3)
# Volume da cisterna (m3)
# Nível do reservatório (antes)
# Nível do reservatório (depois)
# Uso de água potável
# Métodos para dimensionamento
# Método prático Azevedo Neto
V=0.042*'P'*'A'*'T'
# Método Rippl
# Para um exemplo hipotético usando P = 1477, A = 900, T = 3, no método Azevedo Neto V = 170 m3.
# No método Rippl V = 409 m3.
view raw variaveis.py hosted with ❤ by GitHub
rd-coutinhoRenato Domingues Coutinho
Start Water Calculations
Start Water Calculations
rd-coutinhoRenato Domingues Coutinho
Start Water
Start Water
rd-coutinhoRenato Domingues Coutinho