Important References

Programming in Python If you love programming, you can visit here. Mandarin Lessons When i had joined mandarin class, i have compiled notes. Access it Here Optimization Different methods of optimization are shown. Feel easy to access it. Optimization MSHPE Semester 1 Study Materials Access this drive link using college account

July 4, 2024 · 1 min · Yogesh Sharma Neupane

Understanding Randomness and Hydropower Using Python

In this blog, we will explore how randomness and numpy can be used in a practical example related to water resource engineering and hydropower. We’ll create a program that simulates the operation of a reservoir and calculates hydropower generation. Importing Necessary Libraries import random import numpy as np random: This module helps us generate random numbers. numpy (imported as np): This library is used for numerical operations, especially with arrays and matrices. Defining the Reservoir Class A class in Python is a way to create complex data structures that can hold both data and functions. Here, we define a Reservoir class to model our reservoir. ...

May 31, 2024 · 5 min · Yogesh Sharma Neupane

Python Tutorial: Using random and numpy Libraries

Python Tutorial: Using random and numpy Libraries In this tutorial, we’ll learn how to use the random and numpy libraries in Python. These libraries are powerful tools for generating random numbers and performing numerical operations. We’ll cover everything step-by-step so it’s easy to understand. Importing Libraries import random import numpy as np import random: This imports the random module, which allows us to generate random numbers and make random choices. import numpy as np: This imports the numpy library, a powerful tool for numerical operations, and we use the alias np for convenience. Using the random Module Generating Random Numbers print("Random Integer between 1 and 10:", random.randint(1, 10)) random.randint(1, 10): Generates a random integer between 1 and 10 (inclusive). print("Random float between 0 and 1: {:.3f}".format(random.random())) random.random(): Generates a random float between 0.0 and 1.0. "{:.3f}".format(value): Formats the float to three decimal places. Choosing a Random Element from a List print("Random choice from list:", random.choice([ 'Nepal', 'India', 'China', 'Bhutan', 'Bangladesh', 'Pakistan', 'Afghanistan', 'Iran', 'Iraq', 'Turkey', 'Greece', 'Italy', 'France', 'Spain', 'Portugal', 'United Kingdom', 'Ireland', 'Iceland', 'Canada', 'United States' ])) random.choice(list): Selects a random element from the provided list. Shuffling a List print(f"Random shuffled list: {random.sample(range(8), 7)}") random.sample(range(8), 7): Returns a list of 7 unique elements randomly chosen from the range 0 to 7 (essentially a shuffled list). Setting a Seed for Reproducibility random.seed(42) print("Random Integer with seed 42:", random.randint(1, 10)) random.seed(42): Sets the seed for the random number generator to 42, ensuring that the sequence of random numbers can be reproduced. random.randint(1, 10): Generates a random integer between 1 and 10, which will be the same every time the seed is set to 42. Using numpy for Numerical Operations Generating Random Numbers with numpy random_int_array = np.random.randint(1, 10, size=(3, 3)) print("\nRandom Integer Array:\n", random_int_array) np.random.randint(1, 10, size=(3, 3)): Creates a 3x3 array with random integers between 1 and 9. random_float_array = np.random.rand(3, 3) print("\nRandom Float Array:\n", random_float_array) np.random.rand(3, 3): Creates a 3x3 array with random floats between 0.0 and 1.0. Generating Numbers from a Normal Distribution normal_dist_array = np.random.normal(0, 1, size=(3, 3)) print("\nNormal Distribution Array:\n", normal_dist_array) np.random.normal(0, 1, size=(3, 3)): Creates a 3x3 array with random numbers from a normal (Gaussian) distribution with mean 0 and standard deviation 1. Setting a Seed for Reproducibility in numpy np.random.seed(42) print("\nRandom Float with seed 42:\n", np.random.rand(3, 3)) np.random.seed(42): Sets the seed for NumPy’s random number generator to 42. np.random.rand(3, 3): Creates a 3x3 array with random floats between 0.0 and 1.0, which will be the same every time the seed is set to 42. Array Operations with numpy Basic Array Operations array1 = np.array([1, 2, 3]) array2 = np.array([4, 5, 6]) print("\nArray1:", array1) print("Array2:", array2) np.array([1, 2, 3]): Creates a NumPy array from the list [1, 2, 3]. np.array([4, 5, 6]): Creates a NumPy array from the list [4, 5, 6]. print("Sum of Arrays:", np.add(array1, array2)) np.add(array1, array2): Adds array1 and array2 element-wise. print("Element-wise Multiplication:", np.multiply(array1, array2)) np.multiply(array1, array2): Multiplies array1 and array2 element-wise. print("Dot Product:", np.dot(array1, array2)) np.dot(array1, array2): Computes the dot product of array1 and array2. Statistical Operations data = np.random.rand(1000) print(f"\nData Mean: {np.mean(data):.3f}") print(f"\nData Standard Deviation: {np.std(data):.3f}") print(f"\nData Variance: {np.var(data):.3f}") np.random.rand(1000): Creates an array of 1000 random floats between 0.0 and 1.0. np.mean(data): Calculates the mean (average) of the data. np.std(data): Calculates the standard deviation of the data. np.var(data): Calculates the variance of the data. Reshaping Arrays reshaped_array = np.arange(12).reshape((3, 4)) print("\nReshaped Array:\n", reshaped_array) np.arange(12): Creates an array with values from 0 to 11. reshape((3, 4)): Reshapes the array into a 3x4 array. Slicing Arrays print("\nSliced Array:\n", reshaped_array[:, 1:3]) reshaped_array[:, 1:3]: Slices the array to extract all rows and columns 1 and 2 (excluding column 3). This tutorial covers the basics of using the random and numpy libraries in Python. By following these examples, you’ll gain a solid understanding of how to generate random numbers, perform numerical operations, and manipulate arrays. Happy coding! ...

May 31, 2024 · 4 min · Yogesh Sharma Neupane

Exploring the Use of self in Python with Reservoir Planning

Exploring the Use of self in Python with Reservoir Planning In this blog, we will explore how to use the self function in Python by taking an example from reservoir planning. By the end of this post, we will learn to create a class, define its behavior, and operate it using simple Python code. What is a Class in Python? A class in Python helps us create complex data structures that can contain both data and functions (also called methods) that work on that data. Think of a class as a blueprint for creating objects. Learn more on w3schools ...

May 31, 2024 · 4 min · Yogesh Sharma Neupane

Introduction to SciPy and Linear Programming

SciPy is an open-source Python library that provides various mathematical algorithms and functions for tasks such as numerical integration, optimization, interpolation, and linear algebra. One of its key modules, scipy.optimize, offers optimization routines including linear programming. Linear programming (LP) is a mathematical method used to determine the best possible outcome, typically defined by an objective function, given a set of linear constraints. It has applications in various fields such as economics, engineering, and operations research. ...

February 10, 2024 · 5 min · Yogesh Sharma Neupane

HEC HMS Part One Tutorial

Tutorial on HEC-HMS: Hydrologic Engineering Center Hydrologic Modelling System Introduction: HEC-HMS, developed by the U.S. Army Corps of Engineers, is a robust software for hydraulic modeling of river and floodplain systems. In this tutorial, we’ll cover the step-by-step process of setting up a project, defining basin components, importing GIS data, and performing a simulation run. The primary objective is to equip users with the foundational knowledge needed to analyze river systems and derive critical information for dam break analysis. ...

January 21, 2024 · 4 min · Yogesh Sharma Neupane

SedimentLoadAnalysis

1. Sediment Concentration ((C)): Sediment concentration is a measure of the amount of sediment present in water, typically expressed in terms of mass per unit volume. It is commonly denoted in units of milligrams per liter (mg/L) or parts per million (ppm). The sediment concentration ((C)) can be calculated using the formula: C = m/v where: ( C ) is the sediment concentration (mg/L or ppm), ( m ) is the mass of sediment (in milligrams), ( V ) is the volume of water (in liters). 2. Sediment Load ((SSL)): Sediment load represents the total quantity of sediment transported by a river or stream over a specific period. It is the product of sediment concentration ((C)) and discharge ((Q)) and is typically expressed in mass units. The formula for sediment load is: ...

January 17, 2024 · 4 min · Yogesh Sharma Neupane

Tamor Storage HydroElectric Project

Evolution of Tamor Storage HydroElectric Project In 1985, the Japan International Cooperation Agency (JICA) proposed a substantial 696MW hydroelectric project on the Tamor River, involving the construction of a 153-meter tall dam. However, the government at that time did not express much interest in pursuing the project. Moving ahead to 2012, the Nepal Electricity Authority (NEA) filed an application with the Department of Electricity Development (DoED) following a study conducted by JICA. The aim was to obtain a survey license for the project. ...

January 15, 2024 · 6 min · Yogesh Sharma Neupane

Headworks Design Day 1

Mr. Bharat Raj Pandey is a senior engineer at Hydro Consult Engineering Limited. Today, he shared valuable lessons in our hydropower engineering class, focusing on hydro headworks design. The initial step involves a topographical survey, requiring a D card from the survey department of Nepal to obtain XYZ coordinates. Control points are established through surveying techniques like triangulation to create a detailed map at a 1:1000 scale. The importance of a detailed map lies in understanding the depth and width needed for foundation work during hydropower headworks construction. Cross-section work, at least 500 meters upstream and downstream, at 20m intervals and 20 meters from the high flood level, is essential for design. Additionally, L-section of the river for about 1 km upstream and downstream of the headworks is crucial. ...

January 14, 2024 · 8 min · Yogesh Sharma Neupane

Grand Ethiopian Renaissance Dam (GERD)

The Grand Ethiopian Renaissance Dam (GERD), formerly known as Millennium Dam and sometimes referred to as Hidese Dam, is a gravity dam situated on the Blue Nile River in the Benishangul-Gumuz Region of Ethiopia. The primary purpose of this dam is to generate electricity, addressing Ethiopia’s energy shortage and facilitating electricity exports to neighboring countries. The initial planned generation capacity of 5250 MW was later increased to 6450 MW with various adjustments made over time. Construction began in 2011 after the eventual site was identified in the 1950s. The main dam height has been raised to 155m, and the reservoir at Full Supply Level (FSL) covers an area of 1875km². Three spillways, with a combined total discharge volume of 38,500 m³/s, are designed for flood events. ...

January 13, 2024 · 9 min · Yogesh Sharma Neupane

Unveiling Nepal Hydropower Potential: Recap the Webinar

Unlocking Nepal’s Hydropower Potential: A Gateway to Cross-Border Energy Trade In a recent webinar hosted by the Nepal Hydropower Association, Sushil Aryal took center stage, shedding light on Nepal’s thriving hydropower sector and the exciting possibilities of cross-border energy trade. As a participant in this enlightening session, here’s an in-depth exploration of the key insights shared and the ensuing discussions that unfolded. Nepal’s Hydropower Landscape: Current State and Future Projections Aryal commenced the presentation by underscoring the substantial progress made by the Nepal Electricity Authority (NEA). Power Purchase Agreements (PPAs) for new projects have propelled the installed capacity to an impressive 5.4 GW as of 2021. Remarkably, 88% of this capacity is attributed to Run-of-River (ROR) hydropower projects, amounting to 4.76 GW. Aryal projected an even more remarkable future, with the installed capacity expected to reach 6.51 GW by 2025, surpassing double the forecasted demand of 2.95 GW. ...

January 4, 2024 · 7 min · Yogesh Sharma Neupane

A Comprehensive Exploration of Huberman Labs AMA14

Unveiling the Depths: A Comprehensive Exploration of Huberman Lab’s AMA #14 Note: Important points are taken from following video, later processed by AI to make a comprehensive summary of Hubberman Podcast AMA #14: 2023 Philanthropy, Evening Routine, Light Therapy, Health Metrics & More 1. Mind Mastery: Unleashing the Power of Anterior Mid-Singulate Cortex Professor Andrew Huberman leads us into the intricate landscape of cognitive enhancement, centered around the anterior mid-singulate cortex. The listener’s inquiry about this brain region, associated with willpower, sets the stage for a captivating revelation. Huberman elucidates how engaging in challenging endeavors stimulates the growth of the anterior mid-singulate cortex. ...

January 2, 2024 · 3 min · Yogesh Sharma Neupane