Hello friends, I hope you all are doing great. Today, we are going to start a new section in our Raspberry Pi Programming Course. In this section-VIII, we will implement advance protocols in the RPi4 board. Today's our first lecture in this section and we are going to interface a USB Bar Code Scanner with Raspberry Pi 4.
If you have visited any big grocery store, you must have seen, it's quite important as well as difficult to maintain the products in stock at all times. To ease the job, barcode technology is used because it can easily maintain an organized database of your items, costs, and inventory levels in one convenient location. Price changes can be implemented whenever you desire without requiring new labels for previously packaged goods. You can tell exactly when your supply of a particular item is getting low, so you may place a new purchase before you run out. Since the barcode system is so precise, you may assume that any missing (and seemingly unsold) items have been stolen.
Here's the video demonstration of this barcode tutorial:
So, let's get started with the implementation of a barcode scanner with Raspberry Pi 4:
In this post, you'll learn how to read the Barcode scanner's output in the Serial interface of Raspberry Pi 4 and display the scanned code on the 16x2 LCD. When a User reviews an item's code, the LCD will update to reflect the new total number of items in the shopping basket. This configuration allows us to create an intelligent cart with an integrated billing system.
Here's the list of components, used in designing today's project:
Barcode Scanner can read a wide range of linear barcodes. Barcode
scanners are commonly utilized in retail settings like supermarkets,
grocery stores, restaurants, boutiques, warehouse inventory,
invoices for bookkeeping and other retail establishments.
Intelligent shopping carts now use barcode scanners to quickly and
accurately identify products.
Connecting your handheld barcode scanner to a computer is as simple as plugging it into a USB port. Barcode scanners can typically decode at speeds of up to 300 scans/second. Additionally, they can easily read a wide range of scratchy, blurry barcodes.
Serial output through USB is provided in either H.I.D. mode or RS232 mode, depending on the device's configuration. Users can change the Baud rate from 9600 to 115200 and modify the Suffix by adding a C.R., L.F., CR+LF, or no ending characters. And you may set it to read in either Trigger Mode or Continuous Mode. Scanning the included settings sheet's Barcode will also restore the machine to its factory defaults.
As we discussed above, the black & white bars are actually representing a numeric digit. We are hiding the numeric digit in black & white bars because it's difficult for computers to recognize decimal numbers but reading a simple bar is quite easy. The below figure shows the respective bars for numeric digits 0-9:
Looking at a barcode, it might be difficult to determine, where one set of numbers stops and another starts. But in reality, it's pretty easy. There are precisely seven units of horizontal space in each letter. So, in order to get the numeric digit "1", the bar code(starting from left) has two white lines, two black lines, two white lines, and finally one black line, as shown in the above figure.
The barcode printing on the consumer goods has a universal representation i.e. a series of vertical stripes and the numeric code imprinted below, so that, the Barcode can be manually keyed in, if it is incorrectly printed or scratched in the store. Two-dimensional barcodes are also used on some items i.e. postal stamps, as shown in the below figure:
Let's pretend that barcodes are specific on-off binary sequences, with every black stripe representing a one and every white stripe representing a zero. (We've seen that actual barcodes are more complex than this, but for now, simplicity is in order.)
Some scanners use a single photosensitive cell that reads the barcode pixel by pixel as you slide the sensor head over the item (or the product across the reader). The complete Code is detected in a single pass, thanks to a row of photoelectric cells in more complex scanners.
The following are examples of well-known barcode types:
The European Item Numbering Scheme (EAN) is a specialized version of the Uniform Product Code (U.P.C.) for items with a thirteen-digit identifier. There are 13 digits in an EAN13 barcode.
The retail sector heavily uses UPC-A barcodes based on the U.P.C. The Universal Product Code, Extended (UPC-A), comprises 12 digits.
(EAN -8) uses a set of numbers superseding the U.P.C. EAN-8 for compact shipments; these numbers include eight digits.
Like code 128's character set C, Intermingled 2 of 5 (I.T.F.) is an arithmetic barcode used to encode pairs of integers in a space-efficient manner.
The Code 39 Q.R. code is the most straightforward of all the alphanumeric barcodes because it performs its character verification.
Code 128 is a high-density, efficient symbology for encoding alphanumeric data. The checksum digit is incorporated into the symbology, and the Barcode's integrity can be checked by comparing the checksum with the original data or by comparing the Barcode's bytes to the original data's parity.
Since Code 128 is widely utilized for its ability to hold alphanumeric data of a fixed length, we've chosen it to employ in our project.
Pen-type Barcode
This scanner is widely used in retail stores as its cordless. A photodiode and L.E.D. are integrated into its tip. When light is shone on a barcode, its dark bars soak up the rays. In addition, the photodiode's output is reflected in the white areas. Because of this, the scanner can read the generated output waveform. They guarantee low costs and long service life. More specifically, the scanner has to maintain a fixed angle as it moves across the barcodes at a fixed rate. The user may have to spend some time at the gym to get good at this.
Laser-type Barcode
They follow the same principle as traditional pen readers. They use a laser beam as the light source and a revolving prism to detect it. Therefore, they are effective even at a distance of two feet. This allows them to be surface-mounted, eliminating the need for handshakes. Compared to traditional pen-style scanners, these are far superior due to their speed and accuracy.
Light-Emitting Diode Scanner
The ambient light that the Barcode emits is what is measured. The information is translated into a voltage pattern, which is then read by an L.E.D. scanner. Unlike other barcode scanners, this one doesn't come with a light source. Although the C.C.D. systems are pricey, they are more adaptable and accurate than alternatives. They're commonly found in stores.
Camera barcode reader
The two-dimensional Barcode is usually scanned using a barcode scanner with a two-dimensional camera. The camera must be set to auto-focus and maintained at a fixed distance. Multiple small lights are placed to form the camera. The barcodes will be photographed digitally and uploaded to the system.
Imaging barcodes with a cell phone
These days, practically every smartphone has a built-in scanner. Successfully scanning the 2-dimensional Bar code will not necessitate autofocus. These barcodes are unreadable by a regular scanner.
The Barcode detected by the barcode reader will be displayed on a 16x2 LCD screen connected to the Raspberry Pi 4.
The image below illustrates the circuit diagram of Raspberry Pi 4 with an LCD display and barcode scanner.
The Barcode scanner is connected via USB to Raspberry Pi 4, while the LCD is connected to the SPI pins of RPi4. The SPI pinout is as follows:
Here's the circuit diagram of the LCD 16x2 with RPi4:
Here's our hardware setup and as you can see, we have interfaced both LCD and barcode scanner with the Raspberry Pi 4. We also have a sheet of barcodes to scan:
To begin, we need to turn on I2C on the Raspberry Pi. Here is the command to enter in the terminal:
sudo raspi-config
Now, use the down arrow key to access the Interfacing menu, and from there, select the P5 option, which is the I2C Enable/Disable menu item.
Once that's done, it'll inquire whether or not "you want the A.R.M. interface to be enabled." If you want to see "The ARM I2C adapter is enabled," select "Yes>." Select "ok" and then "Complete" to confirm your selections.
To begin working on the Liquid crystal display, you must first verify its I2C address in the Python console.
sudo i2cdetect -y 1
The attached I2C device has address 27, as shown above.
This came together with my barcode scanner. This card will allow us to quickly and easily alter the device's default settings and change the Data rate, Trigger mode, and more.
Make sure the method of data transmission is USB transmission before we begin programming. The reading mode should be set to Triggering, and the Suffix should be C.R.*. The end of a data set information is always signaled by an enter command when a carriage return is used.
Now, access the Pi's command prompt and type pip install RPI LCD to get the software package downloaded and set up. My laptop and Raspberry Pi share the same wifi network; thus, I can control it from here using a V.N.C. viewer. In addition, I used THONNY and Python 3.7.3 to write the Code.
Since we'll be using Delay to show the material on the LCD, we're starting the Program by importing the Sleep object from time. Then, the RPI LCD object, used for integrating the 16 x 2 display, will be imported.
from time import sleep
from rpi_lcd import LCD
The number of objects scanned up until the loop's execution is kept in an item count variable. At first, it is set to 0 so that no invalid values are stored. For the same reason, the scanned Barcode will be saved in a variable called score, which will initially be empty.
item_count=0
scode=""
LCD.text("Scan the Code... ", 1)
As long as the while loop is active, scanning will continue indefinitely unless the controller is reset. Terminal input is required for this loop's input() function, and the resulting String will be saved in the variable scope. Then, we'll get it shown on an LCD screen:
While 1:
scode= str(input())
LCD.text("Scanned Barcode is", 1)
LCD.text(code,2)
sleep(2)
LCD.text(" Item Added", 1)
sleep(2)
item_count=item_count+1
IC=str(item_count)
LCD.text(" Total Item = ",1)
LCD.text(IC,2)
sleep(1)
The initial value of the item count was 0; however, it will be increased while the loop is executed. The item count is currently set to 1. We'll use typecasting to change the item count value from an integer to a string so that it can be shown on the LCD screen through the LCD.text() function.
Viewing the accompanying illustrations may help clarify matters. After two seconds, the LCD will show the total number of items scanned rather than the scanned Barcode itself (which will remain on the screen for two seconds).
from time import sleep
from rpi_lcd import LCD
LCD = LCD()
item_count=0
scode=""
LCD.text("Scan the Code... ", 1)
while 1:
scode= str(input())
LCD.text("Scanned Barcode is", 1)
LCD.text(code,2)
sleep(2) #Delay of 2 seconds
LCD.text(" Item Added", 1)
sleep(2)
item_count=item_count+1
IC=str(item_count)
LCD.text(" Total Item = ",1)
LCD.text(IC,2)
sleep(1)
The following illustration depicts the wiring for connecting a barcode reader, thermal printers, and Liquid crystal display to a Raspberry Pi 4. The following table shows the relationships between these terms for your convenience.
Now that we have all the parts hooked up, we can begin writing the Program for the intelligent cart. Before moving further, let's review the ideas we've covered in our prior assignments. I am compiling a summary of the essential takeaways from the preceding part.
import spread
from time import sleep
from RPLCD.i2c import CharLCD
LCD = CharLCD('PCF8574', 0x27)
from escpos.printer import Serial
from DateTime import DateTime
now = DateTime.now()
dt_string = now.strftime("%b/%d/%Y %H:%M:%S")
lcd.cursor_pos = (0, 0)
LCD.write_string("Initialising...")
#locating the spreadsheet JSON file
GC = spread.service_account(filename='/home/pi/Ali Proj/Proj 4 Shopping Cart with Thermal Printer/Shopping Cart on 20_4 LCD/shop-data-thermal-585dc7bffa1f.json')
#sheet name is to be passed
sh = GC.open("Shop Data for Thermal")
worksheet=sh.get_worksheet(0)
The preceding Code includes imports for all required libraries, including spread for the Google Sheets Application programming interface, time for wait or rest functions, RPLCD for 20X4 Liquid crystal display, escapes for serially controlling the Heated Printer, and date and Time for retrieving the current date.
Using my Google account, I made a spreadsheet titled "Shop Data for Thermal." Please create your own and give it any name you wish. Please see the G spread docs for information on setting up your Google Spreadsheet and JSON for your Google service account.
Next, we'll launch Sheet1 by invoking get worksheet(0) and loading it into the sh editor.
""" 9600 Baud, 8N1, Flow Control Enabled """
p = Serial(devfile='/dev/serial0',
baudrate=9600,
bytesize=8,
parity='N',
stopbits=1,
timeout=1.00,
dsrdtr=True)
This Code will be used to set up and initialize the serial port based on the parameters provided.
count=0
item_cost=0
totalCost=0
SNo=0
scode=""
qty=1
scodePrev=0
item_name=""
entryF=[]
p.set(
align="center",
font="a",
width=1,
height=1,
)
The necessary variables will now be initialized to " " or " 0 " to prevent any invalid data from being stored in them. In addition, the set() function will be used to establish the thermal printer's default printing settings.
def print_receipt():
p.text("\n")
p.set(
align="center",
font="a",
width=1,
height=1,
)
#Printing the image
p.image("/home/pi/Ali Proj/Proj 3 Interfacing thermal printer with pi/CD_new_Logo_black.png",impl="bitImageColumn")
#printing the initial data
p.set(width=2,
height=2,
align="center",)
p.text(" ===============\n")
p.text("Tax Invoice\n")
p.text(" ===============\n")
p.set(width=1,
height=1,
align="left",)
p.text("CIRCUIT DIGEST\n")
p.text("AIRPORT ROAD\n")
p.text("LOCATION : JAIPUR\n")
p.text("TEL : 0141222585\n")
p.text("GSTIN : 08AAMFT88558855\n")
p.text("Bill No. : \n\n")
p.text("DATE : ")
p.text(dt_string)
p.text("\n")
p.text("CASHIER : \n")
p.text(" ===========================\n")
p.text("S.No ITEM QTY PRICE\n")
p.text(" ------------------------------\n")
print(text_F)
p.text(text_F)
p.text(" -------------------------------\n")
p.set(
# underline=0,
align="right",
)
p.text(" SUBTOTAL: ")
p.text(totalCostS)
p.text("\n")
p.text(" DISCOUNT: 0\n")
p.text(" VAT @ 0%: 0\n")
p.text(" ===========================\n")
p.set(align="center",
)
p.text(" BILL TOTAL: ")
p.text(totalCostS)
p.text("\n")
p.text(" --------------------------\n")
p.text("THANK YOU\n")
p.set(width=2,
height=2,
align="center",)
p.text(" ===============\n")
p.text("Please scan\nto Pay\n")
p.text(" ===============\n")
p.set(
align="center",
font="a",
width=1,
height=1,
density=2,
invert=0,
smooth=False,
flip=False,
)
p.qr("9509957951@ybl",native=True,size=12)
p.text("\n")
p.barcode('123456', 'CODE39')
#if your printer has paper cutting facility, then you can use this function
p.cut()
print("printing done")
With the Code above, we can quickly generate a method to output the total due. The invoice's format is also determined in the same procedure. A '123456' barcode can be printed using the p.barcode() method.
Suppose the detected Barcode does not match the database sheet. In that case, a message will be displayed on the terminal's Liquid crystal display and in the terminal's memory reading "Unknown Barcode" or "Item Not Registered," respectively, using the try/except logic. You can view this under the following line of Code.
lcd.cursor_pos = (0, 0)
LCD.write_string('Please Scan...')
while 1:
try:
scode=input("Scan the barcode")
if scode=="8906128542687": #Bill Printing Barcode pasted on the Thermal Printer
print("done shopping ")
LCD.clear()
print(*entryF)
print("in string")
print(len(entryF))
text_F=" "
for i in range(0,len(entryF)):
text_F=text_F+entryF[i]
i=i+1
lcd.cursor_pos = (0, 0)
lcd.write_string("Thanks for Shopping")
lcd.cursor_pos = (1, 7)
lcd.write_string("With Us")
lcd.cursor_pos = (3, 0)
lcd.write_string("Printing Invoice...")
print_receipt()
else:
cell=worksheet.find(code)
print("found on R%sC%s"%(cell.row,cell.col))
item_cost = worksheet.cell(cell.row, cell.col+2).value
item_name = worksheet.cell(cell.row, cell.col+1).value
lcd.clear()
SNo=SNo+1
entry = [SNo,item_name,qty,item_cost]
entryS=str(entry)+'\n'
print("New Item ",*entry)
lcd.cursor_pos = (0, 2)
LCD.write_string(str(SNo))
lcd.cursor_pos = (0, 5)
LCD.write_string("Item(s) added")
lcd.cursor_pos = (1, 1)
LCD.write_string(item_name)
lcd.cursor_pos = (2, 5)
LCD.write_string("of Rs.")
lcd.cursor_pos = (2, 11)
LCD.write_string(item_cost)
item_cost=int(item_cost)
totalCost=item_cost+totalCost
lcd.cursor_pos = (3, 4)
LCD.write_string("Cart Total")
lcd.cursor_pos = (3, 15)
lcd.write_string(str(totalCost))
entryF.append(entryS) #adding entry in Final Buffer
sleep(2)
except:
print("Unknown Barcode or Item Not Registered")
LCD.clear()
lcd.cursor_pos = (0, 0)
LCD.write_string("Item Not Found...")
lcd.cursor_pos = (2, 0)
LCD.write_string("Scan Again...")
sleep(2)
First, you pick out the product you want and scan its Barcode.
Verify the accuracy of the LCD.
Scan something else and perform the same thing
Once you have everything you need, scan the Barcode affixed to the thermal printer to initiate the billing process.
Collect the bill and use the Q.R. code to pay using a U.P.I. account.
Managing libraries is a specialty of library automation.
Each book is equipped with a barcode that the system uses to keep track of its current availability. The barcode scanner provides the librarian with up-to-date information on the books that have been checked out. Books can be checked automatically, allowing for less workforce.
Maintaining a stock-taking system.
Barcodes provide for more efficient product recognition and data deployment. Manually entering data at the front end raises the risk of human error, which can cause delays and financial losses. But the barcode scanner is highly accurate and rarely makes mistakes when processing product orders. Because the data is automatically recorded with each sale, this simplifies stock-taking by cutting down on time spent manually looking for items.
Reservations for travel
The billing procedure can be lengthy and frustrating at movie theaters, motels, and other establishments. Bills generated through electronic billing systems include a barcode or Q.R. code that can be easily decoded using a scanner kept by the relevant authorities.
Billing office
It lessens the likelihood of mistakes occurring during billing's manual data entry process. Barcode scanners have many applications in billing departments, including speedy data gathering and the ability to check pricing and promotions.
For Office Biometrics
A company's employees are obligated daily to record their attendance and clock in/out times. Scan the Barcode on their I.D. cards instead of having them manually enter their information.
For use in the production and logistics sectors
Using a barcode scanner, keeping tabs on company property is possible. A quick snapshot of the warehouse's inventory is provided. Raw materials utilized in production must also be sent to different markets. Consequently, there can be no mistakes in the labeling. As a result, it speeds up transactions and generates more money.
Reducing the likelihood of making mistakes and responding quickly to consumer requests are critical to growing the business. Time constraints can be met with more efficiency when both incoming and leaving shipments are monitored regularly. As industrial processes become increasingly mechanized, the cost of human labor declines.
On campus
The main features include tracking fixed assets like computers, lab equipment, machinery, etc. Teachers or employees responsible for the safety of their assets, such as the craft, can keep tabs on them with this feature. Barcode scanning keeps track of books and supplies that have gone missing in a library. A student's entrance and exit from the library can be quickly and accurately recorded using barcode scanners.
Industry of Health Care
Surgical supplies, patient specimens, pharmaceuticals, etc., must be tracked. Barcodes on patients' wrists allow doctors to quickly and readily verify that their care is being administered properly. These barcodes make it simple to record and monitor the previous distribution of prescriptions.
Governmental and Military Affairs
They take great care to ensure that sensitive information about the country does not leak. Problems with data recording or disclosure could lead to legal trouble. Official data can be kept safe with the use of barcodes.
Logistics
A worker working in logistics could be accountable for juggling multiple products at once, which increases the likelihood of making mistakes and sending out the wrong items. A barcode scanner can be used to automate this process with little room for error.
The Retail Industry
Including a barcode on each item will speed up the billing process by eliminating the need to enter each purchase manually. It will also make it simpler to view stock levels. Theft can be prevented by installing a barcode-based sensor on the exit door. In addition, this technology makes it easy to track the discounts applied to each item and ensure that they are still valid, reducing the need for human labor.
Barcode scanners prove essential for managing a wide variety of administrative processes. It appears that barcode scanning technology will continue to evolve in the future. We have seen how to construct our own "Smart Shopping Cart," complete with a barcode scanner to read the item's Barcode, retrieve the prices from the databases, show the information of the scanned object on an LCD for reference, and print the invoice using a thermal receipt printer. In the next tutorial, we will discuss How to design a Cryptocurrency Miner with Raspberry Pi 4. So, stay tuned. Have a good day.
Technology is changing fast. It’s constantly shifting and evolving. Tech is making our lives easier but it’s also creating new problems. It is changing the way humans behave and interact with one another. Technology is providing answers to things we never knew and solutions to problems we can’t solve on our own. There is a lot of innovation happening right now, especially in the field of engineering. Below are five technologies that are being innovated by engineers.
You’ve probably seen a video of a 3D printer or have heard about what they can do. 3D printing is changing fast and enabling us to do a lot with it. 3D printing software provides more tools and resources to print useful things for us. The medical industry has begun using 3D printed organs and other significant tools for the field of medicine. Engineers have taken 3D printing to a whole new level. It is getting to the point where we can 3D print anything we need. Think about it. Soon we will imagine things we want and simply print them.
Engineers are also helping innovate artificial intelligence (AI). With AI, there is no shortage of ways that our lives will change. We’re already experiencing it. Engineers were instrumental in creating AI chatbots that improve customer service and user experience . AI can analyze large sets of data. It can synthesize media using all the intelligence it has from the internet. AI is already solving problems that we used to deal with quickly. It is changing the way we live and think about the future. AI will continue to augment our lives in several ways, and engineers will facilitate this growth and, hopefully, steer it in the right direction.
One area of technology that will impact the way we live is our ability to urban farm and create more ways to capture carbon in the atmosphere. There are now examples of engineers creating living buildings, buildings that incorporate trees and other foliage into the design. There are also downtown farms. For example, there are now buildings that can be used for farming shellfish . These vertical buildings host aquariums of fish that are used for food. Engineers can work with environmentalists to create truly incredible infrastructure that could change the world. This is one area of innovation that shows promise for the future.
Optical engineering might seem like a consistent lane to be in, but this isn’t the case. Optical engineers have already innovated contacts, eyeglasses, telescopes, and more. This will only increase in the future. There are already plans for contact lenses that connect to the internet. Soon you will be able to see avatars, applications, and other online images simply with your contacts. You will be engaging with the internet on a whole new level. The optics are changing . Optical engineers will facilitate the shift from using phones to participating with the internet through virtual reality (VR).
There has been a lot of talk recently about the metaverse. This is what we are calling the world within technology we can engage with through goggles and headsets. Have you tried VR before? It used to be flawed but it’s getting better all the time. Engineers are making VR better and better all the time. It is getting more realistic and functional. There is also augmented reality, or AR. This is the technology that utilizes VR components with the tangible world. For example, remote medical surgeries are now a reality. With 5G internet, better AR, and engineering innovations, we can improve our way of life in many ways.
Engineering is also facilitating data , storage, and analysis. Engineers have created Cloud storage abilities and the capability to analyze large sets of data. Of course, AI will be able to analyze data a lot better than we will but storing data in the Cloud is how the AI will have it so organized. Data is easier to analyze when it is organized. Data has become one of the most valuable assets in modern business. When you have thoroughly analyzed data, you will have the ability to market to new customers, find new target demographics, and create both new products and services.
There is no shortage of ways that engineering is changing our world. Its relationship with technology continues to change. The way that we live is being augmented all the time. How will we think about these technologies in the future? With more and more innovation, the world will change around us. It’s an exciting perspective to look at the world through the engineer’s eyes.
, In recent years, additive manufacturing (AM) has become an increasingly popular topic in the aerospace industry. Additive manufacturing is the process of making three-dimensional objects from a digital file. It is also known as 3D printing.
In general, additive manufacturing builds objects by adding successive layers of material. This is in contrast to traditional manufacturing methods like machining or milling, which involve removing material from a block of metal or other material.
With technology evolving and becoming more widely adopted, additive manufacturing has transformed how aircraft are designed, built, and maintained.
This article will discuss some of the critical benefits of aerospace additive manufacturing.
Additive manufacturing provides greater design flexibility than traditional manufacturing methods. This is because AM enables the creation of parts with highly complex shapes and geometric structures that would be impossible to produce using subtractive processes like machining.
And this opens up new possibilities for engineers in aircraft design, leading to more innovative and efficient solutions.
For example, the most common type used in aerospace applications is called selective laser melting (SLM). SLM uses a laser to melt the metal powder into the desired shape. The advantage of SLM is that it can create complex aerospace components and shapes that would be difficult or impossible to create using traditional methods.
Here is an example of a complex design made through SLM.
Previously, products were made by assembling a wide range of individual parts. With additive manufacturing, products can be created using fewer individual parts since the designs are printed using a 3D printer at a time. This allows for more complex designs and saves time you’d otherwise spend in traditional assembling.
Aerospace manufacturers are always looking for ways to reduce manufacturing costs. One major way to achieve this is by adopting the aerospace additive manufacturing alternative. According to a survey conducted by Appendix, cost-effective manufacturing is among the most important benefits 3D printing offers to aerospace companies.
AM contributes to cost savings by creating complex designs with fewer steps and structural components. Traditional manufacturing methods waste a lot of material because it is impossible to use in the finished product. With 3D printing processes, only the amount of needed material is used, making it more efficient.
Also, additive manufacturing allows for greater customization, leading to reduced costs. For example, if a part needs to be made for a specific application, aerospace additive manufacturing can be used to create a part that is off the shelf. This saves the manufacturer from having to order custom parts from your aerospace suppliers , which can be expensive.
Additive manufacturing is generally much faster and more efficient than traditional manufacturing methods such as milling or casting. Besides the speed, it can produce parts with high accuracy and repeatability. This is because AM eliminates the need for tooling or molds, and parts can be produced layer by layer directly from digital 3D printing models with minimal material waste.
Storage requirements for aerospace equipment differ depending on the application. Some standard storage requirements include:
Temperature control: The equipment must be stored within a specific temperature range to prevent damage or malfunction.
Environmental protection: The equipment must be protected from harmful elements such as dust, moisture, or corrosives.
Storage requirements in the aerospace industry vary depending on the type of aircraft. However, aerospace industries are constantly looking for ways to reduce storage requirements, as storage space is a valuable commodity in this industry.
Additive manufacturing processes help minimize storage requirements by producing parts directly from a 3D printing model.
This reduces the required inventory since parts can be printed on demand instead of on storage carousels, as shown in the image below. Carousels are more common in traditional factories due to subtractive manufacturing methods, such as milling and turning, requiring much material and storage.
With aerospace additive manufacturing, parts are built up one layer at a time, so very little material is wasted. This means less storage is required to store the raw materials freeing up valuable space in factories.
Component weight is a critical factor in the aerospace industry. Every pound of weight eliminated from a single component allows for carrying additional payload or fuel, increasing the aircraft's range or performance.
In recent years, aerospace additive manufacturing has emerged as a promising technology for reducing the weight of aerospace components in the aerospace industry.
Additive manufacturing can create parts that are lighter and stronger than those that can be produced using traditional methods. This is because the additive manufacturing process does not require traditional cutting, drilling, or welding methods. As a result, less material is needed to produce a single component, which reduces its weight.
AM also allows for greater control over the process of manufacturing and chemical microstructures of materials. As a result, components can be designed with specific attributes like improved toughness or fatigue resistance. This reduces weight and decreases fuel consumption and emissions while improving performance and range simultaneously.
Finally, unlike traditional manufacturing, additive manufacturing enables general component design optimization, which helps with weight reduction. The result is lightweight structures. In traditional manufacturing methods, excess material must be added to compensate for errors and inaccuracies in the manufacturing process, resulting in heavier structures.
The aerospace industry is a critical part of our economy and our way of life. It produces and operates various aircraft, from commercial airliners to military aircraft. To keep up with the demanding needs of this industry, manufacturers are always looking for ways to improve their mechanical performance. One way that they are doing this is by using additive manufacturing technology.
Additive manufacturing has a transformative effect on the aerospace industry thanks to its many benefits, such as increased product complexity, reduced manufacturing cost, minimized storage requirements, and decreased weight of components.
As 3D printing technologies continue to evolve, more additive manufacturing applications will likely be found in aerospace, leading to an even more significant impact on the industry.
However, 3d printing technology is still relatively new, and there are not many standards in place. In addition, each manufacturer has its additive manufacturing processes and methods for creating parts, making it difficult to know if a part will meet the required specifications.
Hello, peeps! Welcome to another exciting tutorial on MATLAB in which we are discussing one of the most important windows of MATLAB that you are going to use the most. In the previous tutorial, we learned a lot about the basics of MATLAB and the different types of windows that are used in MATLAB and are present on the face of MATLAB when you launch it. There was a piece of interesting information about the basics of this fantastic development environment. This is the next step in the related tutorial in which we study the applications and workings of command windows in depth. Here is a glance at the topics that you are learning about today.
How can you define the command window of MATLAB in detail?
What are some examples of commands related to online help?
How can you use the useful commands on MATLAB related to the variable?
Give the information about the commands related to the files, directories, and the PC that you are using.
What are some examples of the type of equations that are solved in the command prompt?
Thus, let’s start learning.
Recall that the command window is the basic window that is shown in the centre of the screen when you fire up your MATLAB, and here, the pre-defined commands are run in the easiest way by merely providing the command and values. If it seems to be normal right now, then maybe you have unclear programming skills because programmers know that in most languages, the commands and functions have to be defined first.
Not only this, but the command window also performs another responsibility. In some programs, when we are using the edit window, the command window shows us the results and outputs of the calculations, if applicable. The usage of edit windows is not yet discussed in his tutorial, but you can understand that the command window shows us the numerical output and the command’s results when we allow it to do so.
As we have said earlier, the command window is used for different purposes, and therefore, at the beginning, we are telling you about the different ways to seek official help from MATLAB if you are stuck in any situation and do not know how to tackle it. The good thing about MATLAB is that it provides you with the maximum information and helps in different ways and it is made for students. Therefore, it not only provides you with the terms of help but also defines them in the easiest way so the students may know where they have issues in the calculations. So let’s start the process of finding help in different ways in MATLAB. Just follow the steps given below:
Launch your MATLAB software.
Go to the command prompt where the function catalogue is blinking.
Start writing the following commands to check what they do.
By writing this in your command window, you will get the list of the commands for which, MATLAB can help you by defining the introduction and codes of that particular command.
It creates a helpdesk for you and directs you towards the MATLAB official page where you can report and find help regarding your issues.
This command provides you with help regarding a particular topic. Assume that you want to get help related to MATLAB's "help" command, which was also mentioned above. You can type "help" instead of "topic" in this command. You will get the details all the time.
It is a special command that is used to get the help link and details in a separate window.
This is an interesting command that is designed to provide you with help related to the strings that we will use in the codes. If you are new to this concept, skip it for now because you are going to learn about it in detail in the coming sessions.
It is one of the most amazing commands in MATLAB where you can find demo examples of different types of code by merely writing a single word, and you will be directed to the official page of MATLAB where all the demos of various programs are present.
If you want to get the Readme files of MATLAB, you just have to write this command in the command prompt and you will get the required output.
This command has some different types of work. Every time you write “Why” in your command prompt, you will get a different type of sentence with a different meaning.
This is a command resembling the “clc” command where you can go to the start of the command prompt and all the results and writings will be cleared from the screen and you will start writing from the beginning.
This command is used to declare the variable globally. In other words, you will not have to declare the variable again and again in different sections, but it will be defined once and can be used anywhere in the program.
Here is another category that deals with variable or workspace information, and you can easily perform them as you have practised the commands discussed above. So here is the list of this particular type.
This command is used to get all the variables that are declared in the workspace in which you are working.
If you want to know the variables declared in the workspace along with their sizes, then you will use this command. In this way, by adding only one character, you can also examine the size of the variable.
Sometimes, or I should say, many times, we want to clear the screen so we may try other codes and commands. For this, you do not have to select all the content and then press backspace, but you just have to write a simple “clc” command and all the data will vanish from your screen. But be careful while using this command because once the data is removed, you will never get the same data back.
Consider the case when you just want to remove the specific lines of code or the variables and other code that are useful to you. Then you will use the clear command in a specific manner in which you will specify the variables that you want to remove from the screen and the memory. In this way, the declaration and erasure of data become easy.
As we said earlier, it may be a disaster in your code if you clear the instructions in the code that were supposed to be there in the command prompt, and in such cases, you can lock the function by putting the name of that particular function just at the place of “fun” in this command.
As we have defined the figure window in our previous lecture, if you have the results of your code in the form of a figure window and want to close it with the help of a simple command, then simply write this command and the window will be closed.
While using MATLAB, I face some cases where I have to think a lot about the directory and want to get information about different files saved in MATLAB by e. So, I found some interesting commands that tell me the exact information about the directories and files I am using efficiently and in great detail. Some of them are given below:
It changes the current working directory. It seems the same command we use in the command prompt of windows.
The purpose of this command is to see the content of the current directory.
This command is used to copy the content of the files that we are working on.
To remove the current directory from your MATLAB, we use this simple command.
It is an interesting command. You can access all the data on which you are working with the help of this simple one-word command.
Yes, it is right. You can find general information about your computer with the help of commands in the command prompt. MATLAB does not only work as simple software that works separately from the other functions of the computer but it is also connected to the internal system of your PC. For instance, if you want to know the basic information about your PC, then you have to see the commands given below:
This is my favourite command. You can have the time and date in the form of a vector wall clock by writing this on your command prompt.
The licence and version of MATLAB can be seen with the help of this command.
This command must be used when you want to compare your computer to other devices while MATLAB is running.
Many times, people do not know the type and specifications of the computer, and they can find them with the help of this command.
Keep in mind, just like some other programming languages, MATLAB is a case-sensitive language, and therefore, if you put these commands with different spellings or change the way of the writing that they were supposed to be, you will get an error. Usually, if the case or one or two characters are changed, MATLAB gives you the suggestions and, therefore, you can easily press the enter key and get the required work from MATLAB. Otherwise, you have to write the exact command.
Now, you know the basics and easy commands that are used in the command prompt, you can easily use the command prompt for different numerical problems. Now, we are starting MATLAB and solving the simplest numerical problems, and then we will move towards more complex problems.
First of all, have a look at the equation that we are going to solve in MATLAB.
4x + 2 = 18
Here, x is the variable, and we want to find the value of this variable. So, we are using the following code to get the required output. You must know that the 18 on the right-hand side is moved to the left-hand side and, therefore, the equation becomes
4x + 2 - 18= 0
4x -18 = 0
We will write this problem in MATLAB and will get the results:
As you can understand with the help of this image, we are declaring a variable with the name “equation” and then feeding the values of x and the constant into it. By default, MATLAB reads the equation from the right side, and it reads the rightmost value as constant, and after that, moving towards the left increases the value of the polynomial. So, MATLAB understood that 4 is the value of variable x.
Consider another equation that is shown as:
34x4 +45x² -12=0
Here, you can see that the cubic value of the variable x is missing, so in place of this value, we will write zero. So the code and the output of the equation given above are:
You can use any word instead of "equation" to declare the equation. Yet, be careful, you have to write the exact word in the root command to get the desired results. The roots command simply takes the equation, solves it, and provides us with the result instantly.
So, it was the day when we learned a lot about the command prompt and saw some amazing commands related to MATLAB that, when written on the command prompt, give us the useful required information, and we checked most of them during the lecture. Your homework is to check the missing commands and get the results related to MATLAB. We will do some complex calculations in the next session, and now you are ready to get the answers to the complex calculations and codes, so stay with us for more action.
Hey learners! Are you enjoying the welcome window of MATLAB? If yes then cool but if no, then you must be waiting for a task or the command to run and check on the MATLAB. Before starting the experiment on any software, one must have basic information about the uses and structure of that particular software. We have seen many cases where people try to use software for the first time and find it difficult because of a lack of basic concepts and ultimately, they lost interest in learning. So, if you are a complete beginner in the MATLAB, then this tutorial is the best way to learn it if you know a little bit about it, you should read this lecture to refresh the concepts and you are going to learn some new points that will help you throughout this course.
In the previous lecture, we downloaded and installed MATLAB with a trial version of 30 years so you may learn the free software and try it before buying it. The next step is to know about your screen when you open the screen. But here, we want to make clear that if you are not able to download and install your software, there is another way to use it. You can easily use MATLAB online and can learn and complete your tasks without any issues. So, have a look at the topics that you are going to learn today and after that, we’ll move toward the details.
Can I use MATLAB online?
What is the MATLAB licensing and system requirements in the online version?
Describe the important details about the MATLAB Environment.
What are the different types of windows on the screen of MATLAB?
How can we use the workspace window for the editing of the content?
All these concepts will be cleared in this article in just a bit so let’s start learning.
As we have mentioned in the lectures just at the beginning, MATLAB was developed for the teachers and students to use, understand, and test the engineering rules and theorems in a better way without having the need for practical tools and information. But, not all students have Personal Computers all the time many of them do not have the powerful devices to load this complex environment on them. So, MATLAB becomes easy when you use it online and the plus point is, you find all the updates and changes as soon as possible and can get the best version all the time without making any changes but keep in mind, the online version also have the specifications that must be matched with your system.
Feature |
Requirement |
Memory |
Least 2GB |
Screen Resolution |
1024 x 786 (minimum) |
Browser |
All the latest versions of the browsers since 2009 |
Important Setting in Browser |
Enable cookies, Enable pop-ups, enable JavaScript setting |
Speed of Internet |
1 Mbps (Minimum) |
We have specified here the least requirements that must be in your PC when you are using the MATLAB online but more powerful is your system better and quick responses you will get. For example, if your internet speed is 2 Mbps or more, you will get the results quicker all the time as compared to the case discussed before.
Just like the downloaded version, online MATLAB also has the licensing of the packages that you want to share. We suggest you just get the license for the basic packages such as Simulink if you require them because it makes no sense to load the packages that you are not going to use for days. Usually, when you need any type of license, you will be guided by the instructors before starting, and therefore, do not bother to about the missing license.
In addition to these licensing, you will also be required to load some ad-on and toll bars as well but do not worry, we’ll discuss them side by side and you are not missing any part.
Recall that MATLAB has a matrix as the structural unit of data and that the collection of the data is efficiently organized in the form of rows and columns. The interesting thing about MATLAB is, even scalers deal in matrices. There is more than one way to execute the commands that you want to run on it. When you start MATLAB, your screen shows three types of windows:
Commands window
Figure window
Edit window
A brief introduction of each of them is given below. You can find the details of when we will use these windows in detail in the next session. Still, for now, it is enough to know that:
The command window, as you can guess by the name, is used to write and run the commands that are pre-defined in MATLAB, and you have to just provide the values at which these commands will be applied. Usually, simple mathematical formulas are applied in the command window, such as addition, subtraction, or transpose of the matrices. But the good thing about this window is, you do not have to save the program on it because it is just made for the commands and the results are shown in just a bit without saving the files on your PC.
A figure window is shown to us when we run the program on MATLAB and the result depends upon any figure or is shown in the form of a graph or figure. It is usually seen as perfect for subjects such as signals and systems, where almost all the outputs are in the form of figures and graphical signals.
The editing window is related to the figure window. Here, we write the codes of the program in the MATLAB language and save these files on our PC. In the end, when we run our programs, we get the output if the program is written correctly. Otherwise, you will get errors. You will see this window most often because we will run a lot of programs in this course in the edit window. There are different versions of these windows, and we will use them according to need.
In addition to these windows, there are certain portions of the MATLAB window, and we are going to discuss them one after the other. When you click on the installed software of MATLAB, you will see a window resembling the figure given below:
The main window where you can see the function catalogue is the command window that we have discussed before. Other characteristics of this screen are explained here.
In the command window, you will see two consecutive “greater than” signs that are used in the function catalogue. The cursor here shows that you have to write your required action here and the MATLAB will complete it. Usually, it is used to
Enter the variable
Call a function
Express the calculation
Write the values
With the examples in the coming sessions, you will learn the details of this window in a better way.
The current folder does not mean this is the opened folder, but it shows the list of all the folders that we have saved in the “MATLAB” folder during installation. Usually, the user does not save them intentionally, but during the process of downloading and installation, you have allowed the installer to add all these folders to your PC so that MATLAB may work best with your PC. It has folders that include licenses, a production server, Java files, and all the other files that are necessary for the working of your software. Keep in mind, never delete any file from this folder because it may affect the working of your environment and, in some cases, reinstallation is needed for the working of MATLAB.
On the right side of the command window, you will see the workspace window. With the help of this window, you can interactively manage and deal with the content of the MATLAB workspace. ordinarily, people do not pay heed to this window and never teach you the uses but I think, you should learn this for some task that is highly useful.
I think I should discuss the working and usage of the workspace window here because it is quick and easy to understand. By default, the workspace is shown in the upper right corner of the screen, but if you do not have it, you can have the workspace window in two ways:
MATLAB Toolscript: Go to the Home tab> Environment section> Layout> Show section> Workspace.
In the MATLAB command prompt, just type Workspace.
If you are using online MATLAB, then you can easily collapse the panel according to your requirements and mood. You can collapse it on the left or right, or expand the panel by just clicking on the required option. You can also minimize it in a simple way.
You will learn the matrices in detail in the next sessions, but for now, I am showing you the usage of the workspace and how you can simply change or delete the values of a matrix with the help of the workspace. For this, follow the steps given next.
Fireup your MATLAB software.
Write the following cde int he command window:
A=[1 2 3; 4 5 6; 7 8 9]
In this way, you will get a matrix with the same values and names. Observe that you will get a matrix with all the value same as the A in the wrkspace. It indicates that workspace saves the content of command prompt in it and you can also change it in an easy way.
Click on the variable A at the workspace window and you will be directed towards the workspace tab at the place of command prompt.
You can see we are easily changing the value of element 5, and you can have any value. When you save the result, you will come to know that the same value has been changed in the command prompt. Therefore, you can easily use the workspace window for multiple operations.
You can also check the result by writing the letter A in the command window. Now, the matrix A will have the updated values.
The figure window, as indicated by its name, will show you the results in the form of figures and graphs. It automatically arises when the code in the command prompt has the results in the form of a picture, graph, or image. You can also change the colors of the indicators or add some other details to get clearer and better results.
There are some other uses of the figure window, and you will see the real use of this window and definitely love it in the upcoming sessions where we will show you the colorful and beautiful images and graphs by using simple lines of code. If you are new to MATLAB, maybe you will be confused about how you can use the code to show the images, but it will be crystal clear when you learn about the fantastic codes and functions of this environment.
Thus, we have learned a lot about the MATLAB screen today, and I am sure you have learned something new even if you are not a beginner in MATLAB. We are progressing slowly toward the codes and other practical work because I want to teach you all the fundamentals first, and then we will begin the practical work with no need to research why we are doing this and how things work. In the next lecture, you will learn about the command prompt in detail along with the editor window, and we will also see some interesting commands that are designed by the MATLAB developers, so by default, you can easily use them without any declaration. So, stay with us because we are going to show you almost all the important features and commands of MATLAB in an easy yet useful way.
Hey peeps! Are you excited about installing your own MATLAB and performing amazing and interesting programs on it? Not only this, you are going to use simple and easy commands on it to make your complex problems easy and interesting. In the previous lecture, we discussed some very basic but important introductions to different parts of MATLAB and shared information about its history and algorithms. In this tutorial, we are about to move forward toward some action. Usually, most of the software has the same procedure to be followed, and people only know that. Yet, to install MATLAB on your PC, you have to follow some specific steps. Do not worry if you have never installed any software or are not aware of the technical stuff because we will explain each and every step with the visual aid. Yet, it is always helpful to know the points that will be discussed in the next sections so that you may make up your mind. So, here are the important features of this article. It contains:
The system requirements for the installation of MATLAB.
The downloading process of the MATLAB details without missing any steps.
The process of installation helps to figure out the information about the types of packages and different versions, along with the file size and the time required for the installation of MATLAB on the PC.
When installing any type of software, you must see the system requirements first because we have seen many cases where the installation process is not completed, or even if completed, it does not work properly as it was expected. There are certain reasons behind this, but we are not going to discuss them because it is out of the scope of this article. For now, you just have to knowYou must know that the first thing that you must check before starting the installation of any software on your PC, is the system requirements. With the evaluation of technology and computer structure, we come across different types of situations where the user needs more and more space in the form of RAM and ROM to install advanced software. When talking about the great and complex development environment, you must have a bulk amount of memory on your PC to accommodate MATLAB. Keep in mind, we will work on MATLAB R2016a, so we are telling you about this. We have not chosen the latest version of MATLAB because not everyone has the PC to install the latest version all the time. Moreover, it becomes easy to work on a relatively older version because if we face any issue, we can find help on the internet related to these versions. So, have a look at the system requirements in detail.
64-bit MATLAB System Requirements with Different Operating Systems |
||||
Operating System |
Windows 10 |
Windows 8.1 |
Windows 8 |
Windows 7 Service Pack 1 |
Processor |
Intel or AMD x86-64 processor of any version |
AVX2 instruction set support is highly recommended |
With Polyspace, 4 cores (recommended) |
|
Disk Space |
2 GB (MATLAB) 4–6 GB (typical installation) |
|||
RAM |
2 GB, 4 GB extra for Simulink, and 4 GN per core for the playspace. |
|||
Graphics |
Hardware accelerated graphics card supporting OpenGL 3.3 with 1 GB of GPU memory. |
It is recommended to use the SSD RAM on your PC so that you do not have to wait much for every program. You must know that MATLAB is the most complex calculator, and therefore, you may have an idea that it takes time to start, run, and execute the calculations on relatively slower computers. In this course, we are going to use Simulink after we cover the MATLAB command window. Therefore, you must have 2GB+4GB of RAM for this course. Do not worry in the future if you feel that your MATLAB is slow because it is the normal observation that MATLAB runs slowly because of the gigantic amount of data fed into this software.
Now, it's time for some action. We know it is boring to check the system requirements, but it is a compulsory task. Well, for now, you have to have high-speed internet because this software takes time to be downloaded and installed on PCs, and therefore, you need some patience. We are going to discuss the whole procedure in the form of steps, and if you have the system requirements completed, you can start downloading while you are reading this tutorial.
Another thing that is important to mention here is the types of MATLAB versions and accounts that are designed for different people. In short, there is versatility in the availability of this software, and by the same token, the features vary from one account to another. The following options are there for you when you download this fantastic software.
Student
Start-ups
Enterprise
Individual use
You must know that all of these are paid versions of MATLAB, but you can also have a trial period of 30 days to check the system and the workings of MATLAB. You can also have alternative ways as well. Here is the list of steps that you have to follow:
First of all, you have to visit the official website of MATLAB. You can find the link there to download the MATLAB version of your own choice. The official link is www.mathworks.com and you can download any version with the specification of the language of your own choice. Usually, people download MATLAB in English, and we are also going to do the same.
We are going to show you the trial version downloading process, and the buying process is also the same. In that case, you just have to put in your credit card information. But we recommend using the trial version before buying because it is safer to try and then buy. So to do this, go to the footer of the page and click on the trial software link option.
In the next step, you have to provide your email. This must be an active email because it is used for verification later. Moreover, anytime you feel any difficulty opening or upgrading the account, you can easily do so with the help of this email.
Once you click "Continue,” you will be directed to the screen that asks for the type of account and the purpose for which you want to use your MATLAB account. Now, go to the email account and verify it.
The next step is to choose the type of account that you want to open. The type of account varies in rates and in return, as well as in features. For this course, we recommend you buy the student’s account, and then, you can also upgrade it if you want any other type of account in the future.
There will be different phases where you have to provide your personal information. When you provide all the required information, then the agreement will appear, and you have to read it and click on the agreement button to show that you are okay with all the terms and conditions.
It's an exciting step. You are going to pick the best package and related add-ons. Do not worry, you can also access all of them later when you need them, so at this point, do not hassle to get all the add-ons at once, because it can slow down your PC without providing any benefit. So, for now, just tick the image processing and computer vision boxes and you are good to go. Click the next button to move forward.
At the end, a screen will be shown to you that describes your email and license details. It is important to note them all, or the super easy way is to keep a screenshot so that you may have it all the time when you are using your PC. Usually, it is not required for different tasks. Yet, if you feel any emergency situation, you can use it easily.
After this process, the downloading will begin. That will take some time because of the heavy load of this fabulous development environment. So do not worry. It takes time according to the The speed of your PC. Usually, students feel strange waiting so long for a single piece of software, yet, you must have the idea that it is a set of different packages and, therefore, it takes time.
Once all the downloading processes are carried out without any issues, the MATLAB icon will appear to tell you that it is time to take action.
Like the downloading process, the installation is also divided into different steps. We are providing you with the general process so that people with technical knowledge and absolute beginners may easily understand the steps. So again, go to your download folder and start your installation.
When you first click the downloaded file, you will be directed to a login window where you have to choose the type of login and then you will provide the personal information that you have given before while downloading the file.
It is not compulsory to discuss that you have to agree with the terms and conditions because, usually, people know this. Well, you just have to give the required information and the installation process is somehow smoother than the downloading process.
Once you specify the type of version that you want to use, you will be directed to the pop-up window that asks for the location of the files where you want to save the MATLAB. By default, the location is in the C folder, and we are also saving the default settings. You can change the folder if you have the knowledge to save other files related to MATLAB that are also saved in the same folder, but you have to provide the same path at that moment.
Just like package downloading, product selection is also an important point. Keep in mind that it is compulsory to install “MATLAB”. It may seem to be a matter of common sense, but basically, I just want to tell you that at the moment, you just have to install this single product and not move towards the other options.
Now, the installation process will take a few minutes, and then you will notice that it is asking for the desktop icon of MATLAB. You are going to use it often, so we suggest you create a shortcut for MATLAB.
So, in this way, the fantastic software of MATLAB is installed on your PC with all its functions and features that are compulsory for beginners. Do not worry if you feel that it is taking a long time. The software takes a long time to be downloaded, installed, or get started because it has a lot of information and features and you have to have a powerful PC to run it smoothly. Don did not hesitate to ask any questions if you had any confusion. We are going to discuss each and every step but will not provide you with unnecessary information. We believe that you have all the prerequisites and have the basic knowledge of the concepts. So, even if you are not a beginner, you are not going to be bored with this course. In the next lecture, you are introduced to the amazing world of MATLAB, where simple commands are enough to solve complex problems that take lots of pages to solve manually. Here, you must also keep in mind, the requirements of the system that we have mentioned above are the minimum requirements. So, the faster your PC, the faster and better your results in MATLAB. Do not overload your PC by installing heavy packages without any requirements installed. You just have to install MATLAB for smooth working all the time.
Hello people! Welcome to an exciting series on The Engineering Projects in which we are studying MATLAB. This series is not just organized just for technical people but for anyone with a basic knowledge of programming and mathematics. We will define each and every concept from scratch and you are not going to bore in any lesson because you will learn new and exciting things in every lecture. If you are wondering what MATLAB can do and what some of its features make it the best calculator and it performs complex calculations in just seconds. You will also see some other parts of MATLAB that make it the best. Have a look at the list of the topics that we are going to discuss with you:
What is MATLAB?
What are some basic features of MATLAB?
If I need to have some prerequisites in MATLAB?
What is an example of a simple task in this software?
How different disciplines of mathematics are getting benefits with MATLAB?
First of all, let us see the introduction of MATLAB and after that, we will move towards some different concepts.
MATLAB is a programming language specially designed for engineers and mathematicians and the company that leads the production, maintenance, and other operations of this software. It is interesting to note that MATLAB takes its name because it is a matrix laboratory and is called so by using the combination of both words. It has different parts such as Simulink which is the graphical window helping electrical and electronic engineers to solve different types of circuits in an efficient way without the need for real components. So, we can say that:
“MATLAB is a specialized programming language introduced by MathWorks for the students of engineering and mathematics and has the multi-windows for different types of operations.”
As we said, this software is a specialized laboratory of matrices and we see a hundred different operations that are specialized for the matrices but are also implemented on different related concepts. The LINPACK and EISPACK did the initial development of this language but we see that MathWorks has the main authority and is working more and more in this field.
The best thing about MATLAB is its multi-paradigm nature that attracts every type of users.
such as functional users, Object-oriented programming experts, and others. Here is the image that describes the multi-paradigm nature of MATLAB.
In this way, you can conclude that MATLAB is used in two ways:
Environment
Programming Language
But in general, we will use the word “software” throughout this course for the sake of simplicity because most of the students are unaware of different technical terms.
You must know, the operations in the MATLAB are stored in the form of matrices no matter if you are using the string, character type, or variable type, these are stored in the form of matrices in MATLAB and in this way, by using properties of matrices, MATLAB performs almost all types of operations by using these matrices.
To understand the importance and usage of MATLAB, we are discussing a brief description of the system inside MATLAB you are going to enjoy it because it has some extraordinary features that make your boring practical work easy and fluent. For the sake of simplicity and a clear concept, we can divide the MATLAB system into five parts which are shown in the image given below:
If you are not familiar with every part, do not worry because I am going to express it in very simple words. There is no need to memorize each of them, you just have to simply put these words into your mind and decide which type of feature you are going to use most of the time when you will discoverMATLAB in detail.
The first thing that must be kept in mind is the basic introduction to MATLAB. It is a development environment that helps programmers to get the desired result in a better way. It has a unique set of environment that enables the users to operate MATLAB functions and files that is usually pre-installed in MATLAB. It has the following features:
A desktop
Command window
A command history
An editor
A debugger
Different browsers
When you start MATLAB, you will be fetched by all of these without searching much. Some of these are just a click away from the main window and you can use them simultaneously.
This is a magical library for every type of engineer and for pure mathematicians. The pre-defined functions are there for you through which you can use trigonometric functions such as sin, cosine, Bessel function, fast Fourier transform, and other functions that help the users get rid of long derivation and calculations. Instead, they simply use the function library and pre-defined functions in an easy way. The main purpose of these libraries is to ignore the long calculations and focus on the working and results of these functions. Usually, people learn the long derivations in the theoretical part and get practice about the same topic in MATLAB by ignoring the long calculations all the time when they solve the problems.
MATLAB is a great programming language that gives users to use it for a great number of tasks. No matter if you have a simple and easy task to perform through the program or if you have a complex program to perform on MATLAB. All the programs are easy to perform and if a person has an understanding of this superb language, you can easily make complex programs in an easy way because MATLAB knows best what you want.
This language was developed by the owners of MATLAB and it is closely related to the language that we use in our daily life. In this way, we get a more user-friendly language that is easily understandable by non-technical people as well if they pay to heed the basic concepts.
When I started to learn MATLAB, I wanted to perform the signals in this fantastic development environment and I was amazed to see the versatility of the programming languaging and the options and facilities it provides to highlight the results in the best way.
For the best data visualization of data, MATLAB has a three-dimensional and two-dimensional high-level structure that provides the best and most impressive representation of data in the best manner.
MATLAB is not just limited to the specific language but it gives you the independence to use multi-languages on ti such as FORTRAN and C. If you are not familiar with these two, do not worry because MATLAB is not just limited to these two but you can do many useful tasks with this versatile software.
As we are discussing from the beginning, this environment is for technical people such as engineers, and therefore, we assume that if you are starting to learn this fantastic software you must have the following concepts in your mind:
Little knowledge of programming. At least you must know what is programming and why we are doing this.
What is a statement?
How can you declare the variables and constants and what is the purpose to do so?
Plotting of graphs and other visual pieces of information like this.
Do not worry if you do not have all these concepts or if you are new to the programming procedures because we are going to discuss all the things in an easy and brief way so that the new users understand all the concepts and the technical people may revise their concepts. Sometimes, you do not have to have all of these concepts in mind when you have the task of simple or basic level but I think it becomes fun when you start using MATLAB and after that, you try to have more and more practice to get the amazing results on this user-friendly software.
Are you excited about using MATLAB? If yes then let’s talk about a simple and easy command on MATLAB to show you a glance at the working and the screen of MATLAB. I am not going to explain each and every part of this command because you will learn a lot about it in the upcoming lectures. For this, if you have the basic concept of matrices, you will get an idea of what is going on on the screen MATLAB. So, let’s have a look at the simple addition of two matrices.
In the simplest command that we have used above, we have simply declared two matrices with the names A and B. It is important to store the values of matrices in the variables to use them later. You are going to use these values for the addition with the help of easy command. You must know, you can use any name of the variable instead of A and B but usually, we utilize these variables because they are simple to understand.
There is no need to explain why MATLAB is important in the engineering field because it is specialized for engineers and all the features of this marvelous software are designed with keeping engineers in mind especially when we talk about electrical and electronic engineers. Usually, MATLAB is easy to use for technical people because, during their educational period, they use different types of software and languages and know how to deal with such environments for the sake of complex tasks and calculations in engineering.
Many students of engineers are providing the best ideas about their fresh ideas in engineering concepts through MATLAB without spending a large amount on experimentation, they can easily propose their ideas with the help of simulations in MATLAB.
Usually, the instruments have errors in the calculation and do not provide 100 % accurate results but when we perform the simulation with software such as MATLAB, we get the ideal results all the time without any issues with accuracy.
When talking about the applications of MATLAB in the field other than engineering, you will find economics one of the most important because of its built-in capabilities to work with time series data, computation techniques, presentation of the result with the help of visualizations, and some other features that are up to mark and makes the study and teaching of economic’s in a better way.
The graphical representation of results in different ways makes this environment more user-friendly to even those who are less aware of the technical stuff and software. So, it becomes easy to understand the concepts with the help of this amazing environment.
When we are dealing with statistics, we can use MATLAB for different types of tasks such as descriptive or inferential and people related to this field find it useful to use MATLAB instead of using the typical manual methods or other software because these all are time taking and have some limitations.
Trus, MATLAB is a powerful programming language that is used in the programming environment developed by different companies and maintained by Mathworks for engineers. But, other disciplines such as economics and statistics also have applications in MATLAB because all of them are related to mathematics. MATLAB is developed with the help of concepts of matrices and therefore, it also involves the user-friendly functions and commands of matrices that are extremely useful in a great number of departments. It was the introductory lecture on MATLAB and you will learn more about it in the next session where you will be directed to install MATLAB in the best way with all the required information. This course is equally useful for the beginners and the persons with intermediate concepts about the programming language because the revision and tips will be there for you at every steps and you are not going to bore throughout this series.
A low-literate audience can nevertheless have their voices heard and their questions answered by using an IVR system, as has been proven time and time again. However, achieving such aims in a development setting calls for a cheap system that welcomes input from various parties. RASP-IVR is an inexpensive IVR system that operates on a PI 4 and a local Global System for Mobile Communications modem. RASP-IVR was designed as an open-source, community-driven solution. It's unusual to find a customer-focused company that still uses human operators rather than an interactive voice response system. Credit card companies typically have IVR systems that can be used to make payments or file fraud reports. Airlines use elaborate IVR systems to schedule flights and check their current status. To facilitate medication refills, pharmacies implement interactive voice response systems. Furthermore, IVRs are widely used for forwarding calls to other extensions and providing directory assistance.
Enterprises of all sizes have adopted IVR technology due to its cost savings over using actual, flesh-and-blood staff. The number of callers who desire to speak with a human indicates an IVR system's success. As the percentage drops, the system becomes more efficient. Of course, some IVRs will never let you bypass the system and talk to a human being. However, that's frowned upon even by IVR advocates. As most people know, Raspberry Pi is a development board that packs a fair amount of processing power into a little package (about the size of a palm). When coupled with python's adaptability, this might lead to the creation of a wide variety of useful but diminutive devices. I recently had to construct an interactive voice response system using a Raspberry Pi, which essentially entails dialing phone numbers, sending messages, and receiving DTMF inputs from the recipient when they pick up the phone.
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | Jumper Wires | Amazon | Buy Now | |
2 | Raspberry Pi 4 | Amazon | Buy Now |
Pi 4
SIM800L GSM Module
2G SIM Card (Airtel)
Aux Cable
LM2596 Buck Converter Module
USB to TTL Converter
12V 2A Adapter
Perf Board
Berg Sticks
Connecting wires
Soldering Kit
Computer and phone systems can be integrated into various ways, and IVR systems are one such way (CTI). Key tones are the most common way a phone can exchange data with a computer. Dual-tone multi-frequency frequency is what you get. A telephone's number pad emits a low and high-frequency tone. A "1" can be generated in a 697-Hz tone or a 1209-Hz tone, both of which are recognized by the PSTN as the numeral 1. For a computer to interpret the DTMF frequency produced by a phone, specialized hardware known as a telephony circuit or telephony board is required. Using a telephony board to connect a computer to a phone line and some low-cost IVR software, it is possible to create a rudimentary IVR system. The IVR program lets you record messages and menu items that callers can navigate using their phone keypads.
Speech-recognition software is a part of more sophisticated IVR systems, enabling callers to interact with computers via voice commands. The technology behind speech recognition is now advanced enough to comprehend things like full names and long series of digits. Text-to-speech software can be used on the receiving end to fully automate a firm's outgoing telephone calls. To better serve customers, computers may now generate personalized text to answer their inquiries, such as financial statements or flight times, and have an automatic voice read to them. Voice extendable mark-up language is a popular foundation for many cutting-edge interactive voice response systems today.
The "RASP-IVR" moniker comes from the fact that it was created on the inexpensive Linux-based single-board computer known as a raspberry pi. The operating system is built on RASPBX, with several additions and modifications to improve compatibility for interactive voice response (IVR) use. Model 4 Raspberry Pi and GSM mobile phone modem make up the system. An Asterisk server is connected to the GSM modem via an interface. FreePBX is a web-based interface for managing an Asterisk server, allowing users to set up and modify IVR menus and VoIP settings. Using open-source libraries, we've written scripts to bring RASPBX's functionality for Voice over IP (VoIP), short messaging service, and localized SIP transfers to a broader.
Depending on the situation, the Asterisk domain server can route the incoming GSM call over a local or worldwide VoIP network. The VoIP communications can be directed to different extensions based on the client's dial input. They can be answered from any desktop or mobile device with a domestic SIP account and a SIP client like Zoiper. Furthermore, the VoIP conversation can be routed to third-party platforms like Twillio to use their cloud-based solutions like speech-to-text engines or cloud-based storage. In contrast, RASP-IVR requires no external resources, making it ideal for collaborative innovation or limited rollouts.
The cost of using an API to make phone calls from a Raspberry Pi can add up quickly. You can use python and Raspberry Pi to make inexpensive phone calls using several different service providers, including Twilio. These solutions are fantastic; however, the price has two significant drawbacks. Almost wherever you go, you'll be charged by the minute, which goes for both outgoing and incoming communications. You might not think this is significant, but if you make more than a hundred calls daily, you'll soon realize how much it costs. The second issue is buying and managing a different cellphone number from which to make these calls. You cannot use an existing number because these are all made up, and depending on your area, you may have to pay more to get a number that works in your nation.
After researching the rates of several API-based telephone conversation services, it became evident that the cheapest option is to use a Gsm technology like SIM800L with Pi to place calls through a network service provider like Airtel. To that aim, we'll connect a SIM800L module to a Raspberry Pi so we can send text messages and make phone calls automatically.
As 5G and the IoT become increasingly popular, numerous innovative new GSM modules have been released that are compatible with 5G networks while using less energy. But I had the bright notion of employing a ubiquitous and inexpensive commodity to purchase at any nearby hobby store. So, we put the popular SIM800L and the Ai-thinking A9 through their paces. Even when just powered by my laptop's USB port, the artificial intelligent-thinker A9 Gsm modem proved completely reliable and responsive right from the get-go. However, the primary issue was that the in-line voice input interface did not operate very well, and the artificial intelligent Thinker A9 Gsm modem did not enable DTMF recognition. So, I switched to the SIM800L Global System for Mobile communications Modem, a power-hungry beast that, if fed enough juice, proved ideal for this task. There is no need for expensive external DTMF hardware because it has both in-line audio for playing automated voice and built-in DTMF detection.
The SIM800L is only compatible with 2G networks, not 3G or 4G. Only Airtel and BSNL provide 2G services in this area. Therefore, get an Airtel SIM card or use one we already have. After purchasing a new Airtel subscriber identity module, card, I activated it on my cell phone and began using it with my SIM800L.
Complete schematics for a Raspberry Pi-based telephone and message system are provided below. It's clear how simple it is to draw connections between ideas.
The method by which the SIM800L module is supplied with electricity is crucial here. Within a voltage range of 3.7V to 4.2V, the SIM800L chip functioned. The optimum working voltage is close to 4V. For the SIM800L module, we needed to reduce the adapter's 12V 2A output to 4V; thus, we utilized an LM2596 Buck converter. Thicker, shorter wires are preferable when linking the buck component to the SIM800L so that the module can easily handle the high current. When powered, if the element detects improper power connections, it will reset and send invalid data through the serial port. You'll need a 12V 2A adapter to power the SIM800L module, and you should use bulky wires just to carry a lot of current without causing too much resistance. Connecting a fully loaded Lithium battery across the SIM800L module's Vcc and Ground pins should resolve any power difficulties.
Those unfamiliar with the jargon of electronics engineering know that "AT Commands" are what we use to talk to the SIM800L module. Calling, texting, and keypress detection are just a few of the many functions that may be accomplished with AT commands. This tutorial will use Py from RPi to transmit these AT instructions to the Global System for Mobile Communications SIM800L module. Connecting the SIM800L module's Rx and Tx pins to the Raspberry Pi's USB port required a universal serial bus to TTL converter.
Through its MIC+ and microphone- pins, the SIM800L component supports mic input. Any audio information sent to these pins after the call has been placed will play on the call recipient's phone. In our scenario, we have to play recorded audio from the Rpi; however, these go pins are primarily designed to connect a microphone. To hear it on the GSM component, we must convert our audio output from the RPi through the 3.5mm port, known as line-out audio, to mic-level audio. You might construct a line-to-mic converter circuit to complete this task professionally. Still, I connected the two devices and set the volume level on the Raspberry Pi to barely two decibels. I had no trouble getting it to function this way.
I assembled the entire circuit on the perf board, ensuring the voltage connectors got enough lead to offer low-resistance contact. This is how my board appears after soldering. Since the LM2596 is an adjustable buck converter, ensure you use the onboard trim pot to set the voltage output to 4 Volts before using it. Anything above 4.2 volts can permanently damage the SIM800L component.
Simply turn on the circuit and attach the Cell phone card when you get here. Once more, confirm that the SIM card is inserted correctly and that the antenna is securely fastened. If all is done correctly, you should see the SIM800L board's inbuilt led flashing once every three seconds. As a result, the SIM800L module may create a network using our SIM card. This guarantees the appropriate Operation of our powering circuit. Now that the board is connected, we can build our Python code without an RPi.
You may find the entire Python script for the RPi interactive voice response system at the end of this tutorial. Due to the size of the code, it is not practical to detail every step. It is incorporated with comments and procedures to do reading and comprehending the code easier. Importing the necessary header files allows us to launch the program. We used the serial module to enable the serial connection between the Raspberry Pi and SIM800L components. The pygame software is employed to play audio, in this case, audio files. We also have the time component to cause delays, so that's something. You don't need to install anything new because the Buster OS comes pre-installed with all three packages.
import serial #for serial communication with GSM SIM800L
import time
import pygame #to play music
Using this method, an AT command can be sent from a PI computer to a SIM800L device and then received in return. All AT commands transmitted to SIM800L must be written in ASCII and conclude with the character "rn." Before sending them to SIM800L, this method appends the character "rn" to all our AT instructions and transforms them into the ASCII character set. Once the response has been read, it decodes the ASCII data so we may utilize them in our code.
def SIM800(command):
AT_command = command + "\r\n"
ser.write(str(AT_command).encode('ascii'))
time.sleep(1)
if ser.inWaiting() > 0:
echo = ser.readline() #waste the echo
response_byte = ser.readline()
response_str = response_byte.decode('ascii')
return (response_str)
else:
return ("ERROR")
This function is quite similar to the one before, except instead of sending a value to the SIM800 component, it just awaits a response from the SIM800L module. As a result, it returns the answer when it receives one.
def wait_for_SIM800():
echo = ser.readline() # waste the echo
response_byte = ser.readline()
response_str = response_byte.decode('ascii')
return (response_str)
The GSM modem is ready for interactive voice response operations after being initialized. Before sending particular AT instructions to the Gsm modem to activate the message and DTMF receiver modes, it sends an "AT" to check for the module and waits for an "OK" response. In addition, it turns off all alerts so that we won't be distracted throughout a call by texting notifications.
def Init_GSM():
if "OK" in SIM800("AT"):
if ("OK" in (SIM800("AT+CLCC=1"))) and ("OK" in (SIM800("AT+DDET=1"))) and ("OK" in (SIM800("AT+CNMI =0,0,0,0,0"))) and ("OK" in (SIM800("AT+CMGF=1"))) and ("OK" in (SIM800("AT+CSMP=17,167,0,0"))): # enble DTMF / disable notifications
print("SIM800 Module -> Active and Ready")
else:
print("------->ERROR -> SIM800 Module not found")
After answering the call, the following method is employed to play the audio files. We have recorded audio files like "cancel.wav," "confirm.wav," and "intro.wav" stored. Following the user's keyboard answer, we must play every one of these files. We can use the play audio function to play any audio file of our choosing. Assume that your Python script is stored within the same folder as these audio files.
def play_wav(file_name):
pygame.mixer.init(8000)
pygame.mixer.music.load(file_name)
pygame.mixer.music.play()
#while pygame.mixer.music.get_busy() == True:
#continue
The software's most crucial feature is this one. It obtains the mobile number that has to be called and offers the callback for that session. Any response, such as NOT REACHABLE, CALL REJECTED, CONFIRMED, CANCELED, etc., can be given in return. The function calls a specified phone number using AT instructions and then plays recorded audio. The system then listens for the caller's DTMF reply and, depending on that reaction, plays the relevant recorded voice before informing us of the caller's choice. The method will also respond with that information if the caller declines the call or cannot be reached.
def Call_response_for (phone_number):
AT_call = "ATD" + phone_number + ";"
response = "NONE"
time.sleep(1)
ser.flushInput() #clear serial data in buffer if any
if ("OK" in (SIM800(AT_call))) and (",2," in (wait_for_SIM800())) and (",3," in (wait_for_SIM800())):
print("RINGING...->", phone_number)
call_status = wait_for_SIM800()
if "1,0,0,0,0" in call_status:
print("**ANSWERED**")
ser.flushInput()
play_wav("intro.wav")
time.sleep(0.5)
dtmf_response = "start_over"
while dtmf_response == "start_over":
play_wav("press_request.wav")
time.sleep(1)
dtmf_response = wait_for_SIM800()
if "+DTMF: 1" in dtmf_response:
play_wav("confirmed.wav")
response = "CONFIRMED"
hang = SIM800("ATH")
break
if "+DTMF: 2" in dtmf_response:
play_wav("canceled.wav")
response = "CANCELED"
hang = SIM800("ATH")
break
if "+DTMF: 9" in dtmf_response:
play_wav("callback_response.wav")
response = "REQ_CALLBACK"
hang = SIM800("ATH")
break
if "+DTMF: 0" in dtmf_response:
dtmf_response = "start_over"
continue
if "+DTMF: " in dtmf_response:
play_wav("invalid_input.wav")
dtmf_response = "start_over"
continue
else:
response = "REJECTED_AFTER_ANSWERING"
break
else:
#print("REJECTED")
response = "CALL_REJECTED"
hang = SIM800("ATH")
time.sleep(1)
#ser.flushInput()
else:
#print("NOT_REACHABLE")
response = "NOT_REACHABLE"
hang = SIM800("ATH")
time.sleep(1)
#ser.flushInput()
ser.flushInput()
return (response)
The send message method in this program enables us to send messages in addition to making calls and receiving responses. The message is sent after it receives both the text and the participant's mobile number.
def send_message(message, recipient):
ser.write(b'AT+CMGS="' + recipient.encode() + b'"\r')
time.sleep(0.5)
ser.write(message.encode() + b"\r")
time.sleep(0.5)
ser.write(bytes([26]))
time.sleep(0.5)
print ("Message sent to customer")
time.sleep(2)
ser.flushInput() # clear serial data in buffer if any
The very last method I created for this project allows you to figure out who is calling by their phone number. Some people might attempt to call back to this line because this SIM card will make calls to new persons. If so, you can use this function to see which line is making the call, send them a message, or create a follow-up call if necessary.
def incoming_call():
while ser.in_waiting: #if I have something in the serial monitor
print ("%%Wait got something in the buffer")
ser.flushInput()
response = SIM800("ATH") #cut the incoming call
if "+CLCC" in response:
cus_phone = response[21:31]
print("%%Incoming Phone call detect from ->", cus_phone)
return (cus_phone)
else:
print("Nope its something else")
return "0"
return "0"
It's time to create the main program, in which we will employ all of these functions to accomplish something nice now that all of them have been defined. The customer id and phone number are now being hard-coded for demonstration purposes, but you can obtain them using a Shopify API request or retrieve them from a spreadsheet as needed. For testing purposes, we use the customer's identity, "AISHA," and phone number, "9877XXXXXX."
cus_name = "Aisha"
cus_phone = "968837XXXX"
We will begin a serial conversation with a 15-second delay at 9600 baud speeds within the main endless while loop block. Considering that various SIM800L components may operate at a different baud rate, ensure that you enter the correct COM folder and baud rate in this field.
ser = serial.Serial("/dev/ttyUSB0", baudrate=9600, timeout=15) # timeout affects call duration and waiting for response currently 30sec
print("Established communication with", ser.name)
After making the call and getting the necessary reply from the consumer, we will send the recipient a text based on their response. For instance, if the answer is validated, we can send a message about it. Likewise, we can alter the message if the client provides a different reply.
response = Call_response_for(cus_phone) #place a call and get response from customer
print ("Response from customer => ", response)
if response == "CONFIRMED":
text_message = "Hi " + cus_name + ". Your booking has been confirmed.Thank you. -Circuitdigest"
send_message(text_message, cus_phone)
if response == "CANCELED": # if the response was to cancel
text_message = "Hi " + cus_name +. "Sorry that you have decided to cancel your booking. If you canceled by mistake, kindly contact us by phone. -Circuitdigest"
send_message(text_message, cus_phone)
if ((response == "CALL_REJECTED") or (response == "REJECTED_AFTER_ANSWERING")): # if the response was rejected
text_message = "Hi " + cus_name + ". We from circuitdigest.com have been trying to reach you, to confirm your
booking. You will receive another call within a few minutes, and we kindly request you answer it. Thank you"
send_message(text_message, cus_phone)
Just double-check the connectors and turn on the GSM component board and RPi. Make that the appropriate COM port is listed in the code before running the application; in my instance, it was "/dev/ttyUSB0." After that, check that the sound is set to atrioventricular ( av ) node jack by right-clicking on the loudspeaker icon and that the audio level is low.
Simply alter the contact number and client name in the following step to your liking, or modify the program to retrieve the information from an excel spreadsheet or cloud Application programming interface, and our automated interactive voice response is ready to go.
The application will dial the specified number and listen for DTMF responses. Additionally, it will play relevant sound clips and transmit a text message dependent on the recipient's response. Below are a few sample messages that I obtained on my cellphone.
The audio tracks and texts can easily be changed to meet your application's needs. I hope the assignment was enjoyable for you and that you learned something.
Call routing within a company is among the most popular uses of an interactive voice response system. Previously, you would employ a switchboard controller or receptionist to answer all callers and direct callers to the appropriate line. When answering customer calls, an interactive voice response system is beneficial. A caller may be given a menu of choices and inquiries about the system's type of call. If possible, the system will respond to the more typical inquiries while referring the less common questions to qualified experts.
Interactive voice response systems are excellent for getting detailed, current info from databases—for instance, movie times. On a significant database, the weekly movie lists are updated. The cinema theater's website can also be filled with information from these databases. When making a call to the cinema, the caller can use the keypad or voice instructions to search the database for movie timings. The same technology can be used to check account balances, evaluate the latest credit card payments, check flight times, refill medicines at a pharmacy, plan auto maintenance, and register for university classes. The list is endless.
Interactive voice response systems are helpful for sales as well. A sales department can create an interactive voice response order form, enabling callers to complete it on their phone's keyboard. When the form is finished, the computer can send a copy to a sales team representative through fax or email. The sales department could also use the IVR as a virtual flyer that highlights the characteristics of a good or service and offers customers the chance to speak with a live agent at any time.
Marketing teams and election pollsters can use the interactive voice response systems' outgoing call functions. A political campaign may send a voicemail message with a phone-in survey for voters to complete. An advertiser may determine whether a buyer is interested in his goods or services. They might press a key to speak with a sales representative if interested in the advertiser's computerized pitch.
Electronic alert systems may also be combined with interactive voice response systems. Let's assume that your company has worldwide workers working from home. Worker contact details, such as home phone numbers, mobile phone numbers, fax numbers, pager numbers, email addresses, etc., can be coded into the interactive voice response system. The IVR prog will use every form of contact until a connection is established if a call has to be directed to that worker.
Transcribing health records is an intriguing application of interactive voice response technology. Currently, doctors record their patient notes and submit the audio to a service that performs medical transcription. However, a doctor may contact the interactive voice response system, record his notes, and have a filed transcript emailed to their office thanks to advanced speech recognition software.
The creators have been collaborating with a few Rwandan health industry partners. The developers want to create solutions that will expand the coverage and reach of the partners' already-existing face-to-face operations. Interactive voice response can extend services to clients who cannot travel to existing facilities. Interestingly, one non-partner frequently visits remote communities and considers the interactive voice response as a tool for drawing people to these outreach efforts. By providing automated processes that operate outside of regular business hours or by gathering and analyzing customer data, the IVR can lessen the employees' workload. One partner will use this function to computerize donor-sponsor reports. In the opinion of one of the partners, the interactive voice response is a small step towards a more significant switch from hard copies to soft copies. Before conversing with a counselor, the web service might pull up the patient's EHR using information gathered by the IVR synchronized with the hard copy to soft copy system and the interactive voice response. After the call, a text message is sent to the customer, and another is sent to the dispatch center that is most convenient for the client.
Using its speech and texting platforms, the RASP-interactive voice response system opens the door to creating unique apps that can assist with contextually relevant difficulties. Features including automated call rerouting, user-selected content, caller audio content recording, text message-based engagement, data collecting, and tailored resources that can be accessed on caller ID are all made possible by the RASP-Interactive voice response system.
We acknowledge, however, that interactive voice response-based solutions, like all technology, must be developed to enhance current human development efforts. The following are IVR-based systems' benefits, although certain limitations are covered below.
A voice-only system is more appealing to people with limited literacy
than texting or internet-based apps.
To use an IVR system, users just dial a number on their readily available cell phone, as they would with any other service.
I am using a mobile phone to get entry to discreet and stigma-free services like psychological counseling, and family planning might be advantageous.
Interactive voice response systems can reconnect dropped calls thanks to caller ID and track many simultaneous activities from the same telephone.
Finally, the speech signal is informative, providing estimations of the speaker's age, body weight, sexuality, anxiety, and other health indicators.
Some drawbacks exist, though, which must be weighed against the advantages. Since the interactive voice response system is language-dependent, the prompts must be recorded in users' native tongues. Interactive voice response ern systems are constrained by emerging communities' cultural and social conventions, even though the telephone interface is familiar.
Users more accustomed to interpersonal communication may resist automated data inquiries and exchanges. To that end, one of the partners believes that in-person demonstrations of the IVR system to clients will provide the most positive results.
Another barrier we discovered for people with few resources was the lack of phone access. Due to fluctuating electricity prices and supply, charging a phone is not always possible. In many cases, people will use various telephones, or multiple people will use the same phone. It's possible that follow-up calls and texts won't be received.
In addition, having a shared phone line can raise questions and suspicions about who is calling. Finally, there are several ways in which users' privacy could be compromised by IVR technologies, from the storage and transmission of data to the reporting of such data to the difficulty of preventing one user from accessing the information of another.
The existing system demands developer-side programming expertise that a CBO might not have access to. The dongle's inability to talk to the Raspberry Pi occasionally resulted from a hardware malfunction. The network failed in some cases. When making a mobile-to-mobile call, one internet provider did not forward the touch-tone signals.
Unfortunately, the system can only handle a single call at a time, making it unsuitable for deployments with a high rate of incoming calls. Our co-operators who expect low call volumes can benefit from the RASP-IVR. A shift to a more scalable approach would be justifiable if volume increased.
Through this tutorial, we have gained a thorough understanding of IVRs and their inner workings. We proceeded to assemble our own Raspberry Pi 4 IVR with a handful of components and some test audio samples. We have investigated the mechanism behind this system and spoken about some of the primary uses for the IVR system. We also had a look at some of the advantages and disadvantages of using it. The following tutorial will teach you how to connect a USB barcode scanner to a Raspberry Pi so that you can read 2D barcodes.
Hello Friends. I hope you are doing great. In this article, I will cover the nature of flow responsible for the changes in density. The nature of flows responsible for density change is known as compressible flows.
Fluid dynamics and thermodynamics combine for the theory of compressible flows. The compressible flow creates a relationship with the ideal gas. First, I will explain the stagnation state, speed of sound, and then the Mach number. This all comes under compressible flows. Then there come the static and stagnation fluid properties, shock waves, and variation of fluid properties in the case of regular and oblique waves. All of these are discussed in this article. So without wasting any time, let us start with the Stagnation property.
The definition of the stagnation property is as follows:
The enthalpy and kinetic energy of the fluid is combined in a term called stagnation or total enthalpy.
The formula of Stagnation Property:
The procedure of stagnation property is as follows:
ho=h+V22
Units of Stagnation property:
The units of stagnation property are kilo Joule per kilogram.
Some of the essential key points related to the stagnation property are as follows:
In the definition of stagnation property, there is a term enthalpy. The enthalpy is the combined flow and internal energy of the fluid. The formula of enthalpy is given below:
h=u+P
It is better to say that enthalpy is equal to the total energy in the case when the potential and the kinetic energy of the fluid are not considered (or negligible).
So, when there are high fluid flows (usually in jet flows/high flows), the potential energy is not considered, whereas kinetic energy is thought. In this situation, the enthalpy and the kinetic energy combine and are called the stagnation enthalpy.
Whenever the fluid's potential energy is not considered, the total energy is said to be stagnation enthalpy.
To differentiate the stagnation enthalpy from the standard enthalpy, the ordinary enthalpy is known as static enthalpy. In contrast, both enthalpies become the same when the kinetic energy is not considered.
Derivation of Stagnation Enthalpy
I will share some essential points related to stagnation enthalpy in this part. So without wasting any time, let us start.
In order to start the derivation of the stagnation enthalpy, we will consider the preferably steady flow, which flows from a nozzle or diffuser. The main property of the flow is that it is flowing on its own, not with the aid of a motor or anything.
The same thing is also implemented; the potential energy is considered minor or negligible.
In this case of a single stream of the steady flow device, the energy balance equation is said to be as follows:
h1+V122=h2+V222 …(a)
h01=h02 (b)
It is better to say that the above equation represents that during the single stream steady flow, there is no change of potential energy, heat, and work interaction is also not present.
A decrease in static enthalpy is observed when there is an increase in velocity. This usually happens in devices that are diffusers and nozzles, respectively.
Another equation is observed, and from equation (a), the velocity of state two will equal zero when the fluid is stopped. So the equation transforms into new, and that is as below:
h1+V122=h2
h02=h1+V122
Another exciting fact says that when there is no heat transfer from the system to the system, it is called an adiabatic state. So the stagnation enthalpy is also considered to be the enthalpy of fluid.
Pressure and temperature also increase when there is the conversion of kinetic energy to enthalpy.
You might be wondering from the heading that says Stagnation Properties. So Stagnation Property is the property of fluid at the stagnation state.
You have observed from equation (b) that there is a transcript 0. So actually, 0 represents the stagnation stage.
Here is another term called isentropic stagnation state and the definition of it is as follows:
The isentropic stagnation state is the one when the stagnation process is adiabatic as well as reversible.
one of the salient features of the isentropic stagnation state is that the entropy remains constant, so in the case of an actual stagnation state, the entropy might increase or decrease depending on the situation.
Both the stagnation state and the isentropic stagnation state are considered the same sometimes.
There is another equation that says that in the case of an ideal gas, equation (b) will become as follows:
CpT0=CpT+V22
The final equation after dividing Cp from both sides is:
T0=T+V22Cp
Here T0 is said to be the stagnation temperature ( transcript with 0 presents stagnation state).
T0 is the temperature at which ideal gas adiabatically becomes a state of rest.
The next term is stagnation pressure. Before defining it, let us see the equation first, and it is as follows:
P0P=(T0T)k/(k-1) (c)
So stagnation pressure is defined as the pressure of a fluid that becomes in a rest state adiabatically.
equation (c) presents the stagnation pressure.
At the start of these critical points, I have used a term, i.e. single stream steady fluid flow. So for this term, the energy balance equation becomes:
qin+win+h01+gz1=qout+wout+(h02+gz2)
The equation in the case of an ideal gas with the specific heats will be as follows:
qin-qout+win-wout=CpT02-T01+g(z2-z1)
So here h02 and h01 are the stagnation enthalpies, whereas T02 and T01 are the stagnation temperature
So this is all from the stagnation enthalpy, property, temperature, and property.
Now I will explain what Mach number is and the speed of sound. So let us start.
Both are interrelated to, first, the speed of sound.
Speed of Sound
After reading the heading, you might be wondering why the article is about compressible flow low then why we are discussing the speed of sound. So better not to worry and let me explain to you in easy words.
The speed of sound in terms of compressible flows is explained as follows:
The sound rate is an integral part of the study of compressible flows as it is the sonic speed at which infinitesimally small pressure waves travel through a medium.
Some of the essential key points and the equation are discussed below. Have a look.
If you look into the definition, there is a statement that says that small pressure waves travel through some medium. Here the pressure waves are created from turbulence or some disturbance.
To explain the topic more precisely, I will explain the speed of sound through some theoretical derivation background.
There is a duct has fluid in it, and that fluid is at rest. There is also a piston inside the duct, which is moved inside. The piston is being moved at some velocity known as constant incremental velocity.
This disturbance of the piston moves the waves of fluid and the movement is made at the speed of sound.
The waves are separated from the fluid adjacent to the piston thus resulting in a change in thermodynamics property.
To elaborate on the whole scenario, the following diagram is presented below:
For a more precise explanation a control volume is considered., In this situation, the waves created by the disturbance or any movement inside remain within the boundary.
Here mass balance equation for the single stream, steady flow is as follows:
mright=mleft
And on simplification, the equation will become as follows:
ρAc=ρ+dρA(c-dV)
Let me explain this equation to you. As you know that in the above theory we have considered a control volume. So when something passes through, there are some movements of the waves, and the fluid moving in the right direction will now move in the direction of the wave front. The speed at which the fluid moves is the speed of sound c. Now the fluid moving in the direction of the left will move away from the wave front, and now rate will be c-Dv, respectively.
So I hope that now the equation is quite understandable to you.
we can further simplify the equation by deduction of cross-sectional area, and now the equation will become:
cdρ-ρdV=0 (a)
The definition of control volume says that there is no heat transfer and work done throughout the process. The equation will not have the potential energy for the steady flow process, and it will be as follows:
h+c22=h+dh+(c-dV)22 (1)
And after the simplification, the equation becomes as follows:
dh-cdV=0
You might be shocked at how the equation is reduced so much as it has so many terms before. So here is the answer. In equation (1), the term dV2 is not considered.
The ordinary sonic wave is nearly unneglectable. They are small, yet they are still considered. So they are somehow isentropic. Now the equation in the case of thermodynamics will be as follows:
Tds=dh-dP (b)
Here the term on the left Tds will be equal to zero, and after the simplification, the equation will become:
dh=dP (c)
For the calculation of the speed of sound, we will combine the equation (a), (b), and (c) will become as follows:
c2=dPdρ
After the simplification, the final equation for the speed of sound will be as follows:
c2=k(∂P∂ρ)T
So here is the final equation of the speed of the sound.
We are moving towards the second part, the Mach Number. Let us see the definition and the equations of it.
Mach Number
The Mach number is also one of the essential parts of compressible flows.
The definition of the Mach Number is as follows:
The Mach Number is the ratio of the actual velocity of the fluid to the speed of sound in the same fluid.
Formula of Mach Number:
The formula of the Mach number is as follows:
Ma=Vc
Some of the essential key points of the Mach number are as follows:
The Mach number has a direct relationship with the velocity of fluid means an increase in the Mach number increases the velocity and vice versa. Whereas the Mach number has an indirect relationship with the speed of sound. The increase in one quantity decreases the other.
There are some important parameters for the flow regimes, and they are as follows:
In the case of
Sonic Mac=1
Subsonic … Mac<1
Supersonic Mac>1
Hypersonic Mac≫1
Transonic Mac≅1
While discussing the flow type, the one-dimensional isentropic flow comes under the compressed fluids.
Examples:
The nozzle diffusers and the turbines are examples of one-dimensional fluid flow.
Some of the essential key points related to the one-dimensional isentropic flow are as follows:
I will explain to you the theoretical background of the one-dimensional flow. Before that, look at the diagram as it will be convenient for you to understand the theory.
As you have seen the diagram and know about the number, let me explain. The value of the Mach number is one at the smallest flow area, called the throat.
Increase in fluid velocity is observed when the fluid passes through the throat. But this increase in velocity is also due to the decrease in the density of the fluid.
If you have a look at the diagram, then there is a word i.e. converging nozzle. But here the converging-diverging nozzle is used so it is the one in which the flow area first increases and then decreases at the throat. Some might confuse these converging nozzles with the Venturi ones. But the Venturi nozzles are used for the incompressible flow.
In this topic, we will pinpoint the main parameter that involves the coupling in the case of isentropic duct flow between the density and velocity.
In this area, we will look forward to some equations of steady flow and the changes in the fluid velocity accordingly to the flow area. So following are some essential key points related to it:
The equation will present the relation between the temperature, pressure, density velocity, Mach number and flow area. These are the equation for the isentropic one-dimensional flow.
The following is the mass balance equation in the case of a steady flow process:
m=ρAV=constant (a)
The equation (a) will be differentiated and divided and the following result will be obtained;
dρ+dAA+dVV=0 (b)
Now the next equation will be related to the isentropic flow in which there is no potential energy and it is as follows:
dP+VdV (c)
The next equation is expressed in terms of Bernoulli’s Equation and again the potential energy is neglected. For convenience, we will combine the equation (b) and (c) and it will become:
dAA=dP(1V2-dρdP)
Now here comes the final equation that describes the isentropic flow in the terms of changes in the pressure accordingly to the flow area.
dAA=dPV2(1-Ma2)
The above-mentioned equation has everything it has an area, density, pressure and Mach number
For this equation there are some limitations in the case of Mach number and they are mentioned below:
Subsonic Flow … Ma<1 and (1-Ma2)term is Positive
Supersonic Flow Ma>1 and (1-Ma2) term is negative
Let me explain these limitations more extensively. In the case of subsonic, the value of differential is dA and differential pressure dP should have the same signs. The increase in pressure increases the flow area and vice versa. Meanwhile, in the case of a supersonic, the value of a differential area and the pressure should have opposite signs. Also, an, increase in pressure quantity should have decreased the flow area of the duct.
There is another equation that is also related to the isentropic flow and it says in equation (c) the value of density and value is substituted in the final equation and it is as follows:
dAA=dVV1-Ma2
So ending this topic on the limitations of Mach number for this equation and they are as follows:
Subsonic Flow (Ma<1) dAdV<0
Supersonic Flow (Ma>1) dAdV>0
Sonic Flow (Ma=1) dAdV=0
Isentropic Flows for Ideal Gas
While discussing the isentropic flow this topic holds its importance as related to the ideal gas. Let’s have a look at the equations and some important key points of it:
For ideal gases both the static and the stagnation properties are combined together, and with the help of the Mach number and specific heat, the equations will be transformed.
The first equation is about the stagnation temperature T0and the ideal gas temperature T. And the equation will be like this:
T0=T+V22Cp
And after simplification, the equation will become:
T0T=1+V22CpT
In this equation, we will substitute the values of V and specific heat. The values we will be substituting are:
Cp=kRk-1
c2=kRT
Ma=Vc
After substation of all the values and doing the simplification, the final equation will become:
T0T=1+(k-12) Ma2
If you remember that at the start, I used two terms, i.e., static and stagnation pressure. So now, I will show you one by one equation of both these terms, and they come under ideal gas. So presenting you the ratio of stagnation to the static pressure, and the equation is:
P0P=[1+k-12Ma2]kk-1
This equation is the result of substituting the value of T0T in this equation.
P0P=(T0T)k/(k-1)
Now presenting you the ratio of stagnation to static density:
0=[1+k-12Ma2]kk-1
There is some limitation where the value of the Mach number is one, so all the points where the Mach number is unity are called the Critical Properties.
While writing the equations of compressible flows the asterisk( *) is used to present the critical points. So their equations will be as follows:
T*T0=2k+1
P*P0=(2k+1)k/(k-1)
*0=(2k+1)1/(k-1)
So these are the equations that present the critical points. That is all from the one-dimensional isentropic flow.
In compressible flows, isentropic is considered to be one of the most important branches of it. Here under this topic, I will discuss the isentropic flow that passes through the nozzles, what are their nature equations, and the nozzle type. Let us start.
First of all, I will share some of the essential key points with you that covers all the information about the topic.
Here in this topic we will learn a new term i.e. Back pressure. A brief definition of back pressure is as follows:
Back pressure is pressure that is applied at the discharge region of the nozzle.
Here the nozzle can be converging and diverge depending on its requirement of it. I will discuss the nozzle type and the isentropic flow through it.
Converging Nozzle
The derivation and the equation of the converging nozzle are as follows:
A subsonic flow is considered in the case of a converging nozzle. The diagram elaborates on the flow:
Here you can clearly see that the inlet of the nozzle is connected to the reservoir. The temperature is presented as Tr whereas the pressure is as Pr respectively.
the velocity at the inlet is neglected and the flow is isentropic. The reservoir has a huge volume so that is the main reason the fluid velocity’s not being considered.
The reservoir pressure and temperature are equal to the nozzle’s pressure and temperature.
Now the working is being followed and the back pressure is being reduced. After doing so the change in the flow pressure is observed.
The back pressure is equal to the P1 and that P1 is equal to the reservoir pressure. This is all due to the uniform distribution of pressure among the nozzle.
Similarly when the back pressure is reduced to P2 then the value of at the outlet becomes equal to P2 also. As a result of this procedure, the pressure of the nozzle decreases in the direction of the flow.
This all working is elaborated by the diagram mentioned below;
The back pressure is now reduced at pressure point three and that is equal to the critical pressure. Actually, pressure three equal to the critical pressure shows that the pressure that is required by the fluid increases the velocity of the fluid and this increases the speed of sound at the throat.
Now the back pressure is reduced to pressure point four. Here there is no change in the pressure and the flow is being observed as it is at the end position.
Now we will look forward to the equation that is related to the mass flow rate.
m=ρAV
m=PRTAMakRT
m=PAMakRT
We will do further simplification and the final result will be as follows:
m=AMaP0k(RT0)[1+(k-1)Ma2/2](k+1)/[2k-1]
Whenever there is a Mach number there are certain limitations as discussed above according to the equations. Here when there is a specified flow area the mass flow rate can be determined by differentiating the above equation and equalizing it to zero. The value of the Mach number here is one. We all the when the value of the Mach number is one (it is at the throat) and the mass flow is maximum at the throat.
Now the equation will be as follows:
m=A*P0kRT0(2k+1)(k+1)/[2k-1]
In order to have a maximum flow rate there are two parameters to be fulfilled. The temperature and the pressure at the inlet of stagnation of a given throat give the maximum flow rate in the case of an ideal gas.
It is a characteristic property that by changing the stagnation pressure and temperature we can control the flow rate values.
So these are the theoretical background and equation related to flow rate. Hence there is another point related to this topic and that is the critical Mach number.
The equation for it is the same as the formula for the Mach number but there are a few modifications, and they are as follows:
Ma*=Vc*
The formula can be expressed in the term of temperature, and the working is as follows:
Ma*=Vc.cc*
Ma*=Ma. cc*
Ma*=MakRTRkT*
Ma*=MaTT*
We can further simplify this equation and can get the final critical Mach number equation so by substituting the values of local and critical temperature, we get:
Ma*=Mak+12+(k-1)Ma2
So, this is the final equation. There is a difference in both the values of the Mach number.
The critical Mach number Ma* is the local velocity non-dimensionalized concerning the sonic velocity at the throat. The other one Ma is the local velocity non-dimensionalized concerning the local sonic velocity.
Their values also differ from one another. The value of Ma* is provided on a table that is listed against the Ma when the value of k is 1.4.
The table is shown below for your clarification:
So that is all from the isentropic flow through nozzles. Let’s move toward the next topic, related to the waves.
Where ever there is flow, there are waves created. As we have studied in depth how sound waves are made, the question is how shock waves are formed. Let us have a concept about it.
There are changes in the fluid properties that can either be temperature pressure, increase or decrease in volume, etc. These changes occur in a thin layer of the converging-diverging nozzle under supersonic flow conditions. So in this way, shock waves are created. Now I will explain the type of shock waves, their working principle, and the equations. So without wasting any time, have a look at it.
Normal Shock Wave
The definition of normal shock waves is as follows:
The normal shock waves are the ones that form in a plane normal to the direction of flow.
Some of the essential key points, along with the equations of normal shock waves, are explained below:
The shock wave is all irreversible and not being approximated as being isentropic.
The process includes all the energy, momentum, and conservation of mass relation to define the flow properties before and after shock.
The normal waves are different in the sense that they are thin and this property benefits the entrance and exit flow areas. The exit and the entrance flow area are the same.
Now moving towards the mathematical part. Let’s start with the conservation of mass. As you all know about the formula of conservation of mass but for convenience let me show you.
1AV1=2AV2
The equation can further be simplified with the cancellation of cross-sectional area.
For the conservation of energy, the equation is as follows:
h1+V122=h2+V222
Now let’s have an overview of the conservation of momentum:
AP1-P2=m(V2-V1)
While working on the equation for the normal shock waves we combine the law of conservation of mass and energy into one equation.
The equation is then plotted on the h-s diagram.
If you look at the diagram below, it shows all the important aspects that I am going to share.
The h-s diagram shows a line i.e., Fanno Line and that is the resultant curve. This curve has similar values of stagnation enthalpy and mass flux.
Moving towards the second curve i.e. the Rayleigh Line. There are two point on the h-s diagram and these two points are correspondence to the Mach (Ma=1).
Further you can see in the diagram that the upper part is for the subsonic flow whereas the lower part is for the supersonic flow.
The two lines Fanno and the Rayleigh line intersect at two points as you can see from the diagram. One point presents the condition that is before the shock and the second shows after the shock condition. At point 1, it is supersonic and before shock condition, whereas at point 2 it is subsonic and aftershock condition.
Also the high is the value of the Mach number before the shock there is a chance that the shock will occur.
When the Mach number is unity then the shock waves are simply sound waves.
One of the important points related to this is that the conservation of energy principle demands that the stagnation enthalpy should be constant throughout the process.
h01=h02
In the case of an ideal gas, the enthalpy is as follows:
T01=T02
After the shock, the temperature of the ideal gas remains constant.
Moving forward, there are some important equations that are related to the ideal gas. These equations show the before and after shock and after substituting the values required results can be obtained.
So following are two important equations.
T01T1=1+(k-12)Ma12
T02T2=1+(k-12)Ma22
We will further simplify the equation by taking T01=T02 and the result will be:
T2T1=1+Ma12(k-1)/21+Ma22(k-1)/2 (a)
In the case of an ideal gas, we know that:
1=P1RT1
2=P2RT2
The value of temperature can be easily substituted using the law of conservation of mass while the values of Mach number and c are used which we can substitute in equation(a). the values are as follows:
Ma= V/c
c=kRT
Now we can substitute all the values and get the result as follows:
T2T1=P2V2P1V1=P2Ma2c2P1Ma1c1=P2Ma2T2P1Ma1T1=(P2P1)2(Ma2Ma1)2 (b)
Now this is the final result we get after substituting all the values. We can further simplify this equation and can get the equation for the pressure ratio across the block and for that we will combine the equation (a) and (b):
P2P1=Ma11+Ma12(k-1)/2Ma21+Ma22(k-1)/2
If you recall the law of conservation of mass and energy, then after looking at the equation you will understand that it is the combination of laws.
Thus this equation about the Fanno Line for ideal gas.
The other curve is Rayleigh Line and its derivation is as follows:
P1-P2=mAV2-V1
P1-P2=2V22-1V12
As:
V2=(PRT)(Ma.c)2
V2=(PRT)(MakRT)2
V2=Pk Ma2
The pressure ratio can be as follows:
P2P1=1+kMa121+kMa22
Now we will move towards the final equation that is about the Fanno and the Rayleigh lines relating the Mach number upstream of a shock to that downstream of the shock. Let’s us have a look at an equation:
Ma22=Ma12+2/(k-1)2Ma12k/(k-1)
The oblique shock is a type of shock waves. It is better to say that there are various variations of waves. So moving toward the topic in order to define the oblique shock I will explain it through an example. So have a look at the example:
Example:
The space shuttle traveling through the atmosphere at supersonic speed creates a complicated pattern with shock waves. Such complex patterns and shock waves are called Oblique Shock Waves.
The following is the diagram that elaborates the shock waves:
Some of the essential key point and equations related to the oblique shock waves is as follows. Have a look at it:
Here in the diagram you can see there are some certain angles mentioned and they these angles helps in the formation of the oblique shock waves.
So talking about the first angle i.e. the theta and this is named as a turning angle or angle of deflection. The background of this angle is that at first, we consider the oblique shock waves traveling in a straight line. This straight line is much similar when the Ma>1 and in supersonic flow, a two-dimensional wedge half angle is formed. So here the fluid cannot flow through the wedge and at that point, it turns into the turning angle.
The other angle is about the shock angle or wave angle (). The background of this angle is that when the turning angle is formed then the straight oblique shock wave is formed and this wave is aligned with the wave angle.
For the conservation of mass, the wave angle should be greater than the two-dimensional half-wedge angle.
In the case of supersonic flows, Reynold’s number has a high value, and the boundary layer along the wedge is thin so its effects are not considered.
Now the flow is turned by another angle that is much similar to the wedge angle and it is named a deflection angle .
The deflection angle is the same as the half wedge angle.
Here there is an interesting fact about the half wedge and deflection angle i.e. when the thickness effect of the boundary layer is considered then the deflection angle is observed to be greater than the half wedge angle.
In the case of the oblique shock waves there are also the limitations of the Mach number. A decrease in the Mach number is observed in oblique shock waves.
Also oblique shock waves are possible when the upstream flow is supersonic.
Now moving towards some mathematical part of the oblique shock waves. The straight oblique shock wave is considered.
The diagram below shows the straight oblique shock waves:
Now here you can see that the straight wave is decamped into the velocity vector upstream and downstream of the normal and tangent components.
For working a small control volume is being considered and all the working happens on it.
If you look at the diagram closely, the upstream of the shock, all the fluid properties (such as pressure velocity) along the lower left face of the control volume are similar to those of the upper right face.
In this case, the law of conservation of mass equation is changed into the following equation:
1V1,nA=2V2,nA
Canceling the area of the control surface (A) on both sides we will get:
1V1,n=2V2,n
There is another important point related to the tangential component of velocity. So the tangential component of the velocity is parallel to the oblique shock and in order to prove this point the tangential momentum equation to the control volume is applied.
So conservation of momentum is being applied in the normal direction to oblique shock waves. So the equation we get is as follows that presented the forces that are only pressure forces:
P1A-P2A=ρV2,nAV2,n-ρV1,nAV1,n
P1-P2=2V2,n2-1V1,n2
Since we have considered a small control volume so we know that there is no transfer of heat and no transfer of work done. The stagnation enthalpy also does not change and eventually, the conservation of energy equation becomes as follows:
h01=h02=h0
h1+12V1,n2+12V1,t2
h2+12V2,n2+12V2,t2
Here the V1,t=V2,t. The equation will be reduced as follows:
h1+12V1,n2=h2+12V2,n2
Here is the final equation.
You might have observed that the equation of the conservation of mass, energy, and momentum have the same equations but when we are writing them in the terms of normal velocity components then they vary. But the equation for the normal shock is the same.
The equations that are derived for the normal shock waves can be applied oblique shock waves. Here is a condition that the oblique waves equation should be written in the terms of Mach number.
So we come to the conclusion that the equation for the oblique shock waves is much similar to the normal ones but the only difference is that the normal components of the Mach number are used in oblique ones.
It is also one of the important types of waves and it may differ from other ones also. Let us share some of the important key points related to it;
One of the important points about the supersonic flow is that when it travels in the opposite direction just in the upper portion of a two-dimensional wedge at an angled attack is greater than the half-angle sigma (δ).
The flow of such kind is known as expanding flow. But when the flow is in oblique shock then the flow is called the compressing flow.
The diagram shows the whole flow type and the angles created by it.
So there is not a abrupt change in the turning of flow by the shock but the Mach wave turn and thus the flow also turn by infinitesimal amount.
One of the important information about the flow is that the flow is isentropic.
In the downstream direction, a decrease in the pressure, temperature and density is observed whereas the Mach number increases.
Just have a look at the diagram you will see that Prandtl-Meyer is inclined at some angle called the Mach angle (μ) also the first expansion wave has an angle and we call it Mach angle. This angle is determined in the following way:
1=(1Ma1)
2=(1Ma2)
Now there is important to question how can we determine the Mach number 2. So for Ma2, there is a formula for it and that formula shows a turning angle across the expansion fan and can easily be calculated by integration. So the formula is as follows:
=v(Ma2)-v(Ma1)
Now, this is the formula for the turning angle across the expansion fan and can be used to find Ma2.
Here in this formula vMa is the Prandtl-Meyer function and it has an equation where we can find the unknown. So the equation is as follows:
vMa=k+1k-1( k-1k+1(Ma2-1))-( Ma2-1)
Here is an important point and i.e. that vMais an angle and it should not be confused with kinematic viscosity.
When the Mach number is unity then the Prandtl-Meyer function vMa taken as zero for getting the supersonic Mach number (Ma>1)
One of the interesting features of the Prandtl-Meyer function is that it has numerous advantages in our daily life.
The shock wave and boundary layer both have a unique significance. There are numerous advantages of both of these in our daily life.
The following are some important applications of shock waves and boundary layers. Have a look at them:
The boundary layer is susceptible to separation from aerodynamics whenever strong adverse pressure occurs
The shock wave on the other hand produces a strong pressure gradient.
Whenever the boundary layer and the shock wave interact with each other the result is a complex flow pattern and in some cases, the boundary layer separates from the region on which it is attached
The interaction between the shock wave and the boundary layer is viscous and inviscid interaction in which the viscous flow in the boundary layer encounters the essentially inviscid shock wave that is generated in the free stream.
The change in the shock wave and the boundary layer continues until an equilibrium condition is reached.
The shock wave and boundary layer have become one of the most pacing problems of modern fluid mechanics research.
Conclusion
Dear friends I hope you have enjoyed reading the article. I have tried best to explain extensively about the compressible flows, isentropic flows, shock waves, boundary layers, and the applications of both of them. That’s all my side. Thanks for reading.
The first law of thermodynamics is also known as the Conservation of energy Principle. I will explain what is energy principle is and the following are some important points of the Energy Principle:
The energy principle can be described as the following equation:
Ein-Eout=∆E
I will exemplify the energy equation through a simple example. For instance, the rock fell from the cliff and while falling from the cliff the rock gained speed and the speed doubled while coming down. The potential energy is converted into kinetic energy as the rock is falling from height. Here the air resistance is negligible here. All these factors confirm the conservation of energy principle.
One of the simple examples of the Conservation of Energy Principle in our daily life is the man who has a lot of energy i.e. the input. If he eats junk and gains weight and the energy will be stored in the form of fat also he exercises less and that is the output. But on the other, a man who eats less has less input and ultimately loses weight. So his input is small as compared to the output.
The conservation of energy principle states that
The change in energy content of a system is equal to the difference between the energy input and output.
If the mass, energy or other quantity enters the system from outside to the system and exists in the system. But if the quantity moves within the system then it is not considered to be a transferred quantity. So it is important to understand the boundaries of the system.
In a closed system, the energy can change to heat transfer and work transfer. In this case, the conservation of energy of the close system equation will be expressed as follows:
Qnet in+Wnet in=dEsysdt
The value of the net heat transfer rate is as follows:
Qnet in=Qin-Qout
The value of net power output is as follows:
Wnet in=W in-Wout
Here dEsysdt is the rate of change of the total energy content of the system.
In the case of a compressible system, the equation of total energy consists f internal kinetic and potential energies and the equation is as follows:
e=u+K.E+P.E
e=u+V22+gz
The energy transfer by heat is one of the important topics of the energy equation. The following are some of the important key points related to the energy transfer by heat:
The heat is in the form of a latent form of internal energy.
Heat transfer is defined as the movement of thermal energy by means of nature and the temperature is decreased in this case. So the transfer of thermal energy from one system to another due to temperature variations is known as the transfer of heat.
In the case of heat transfer, the heat is always transferred from a body of higher temperature to a body of lower temperature. When both temperatures maintain equal temperature then the process of transfer stops. In the case of bodies having equal temperature, there is no transferring of heat.
Adiabatic process is the one in which there is no transfer of heat. The system is said to be in adiabatic if the system is insulted and if the system and the surroundings are at the same temperature.
The adiabatic process is confused with the isothermal process. But there is no transfer of heat but in the adiabatic process, the temperature can be changed by the work transfer.
The energy transfer by work is also an important part of the energy equation. The following are some of the important key points related to energy transfer by work:
The energy interacts and results in the work.
The time rate of doing work is called the power and the power is denoted by the W.
The energy is increased when the work-consuming devices transfer energy to the fluid. A simple example of transferring energy is an electric fan. This moves the electric energy is converted into mechanical energy and this mechanical energy operates the motor of the fan and that motor starts the blades and the fan starts. But here we can say that energy is transferred and this energy transfer has no relation to the temperature.
The system has various kinds of transferring of work and the total work equation is as follows:
Wtotal=Wshaft+Wpressure+Wviscous+Wother
The shaft work is also one of the important part of energy equation. So following are some of the important key points related to the shaft work:
Machines such as turbines, pump, fans or compressors all have shaft and the work protrudes through the control surface by the shaft is known as shaft work.
The equation of the shaft work is as follows:
Wshaft=ωTshaft
Wshaft=2πnTshaft
Here omega is the angular speed of the shaft and n is the number of revolutions of the shaft per unit time.
The work done by the pressure forces is also one of the important topic that comes under the energy equation. So following are some important key points related to the work done by pressure forces:
In the case of work done by pressure forces, let us consider a gas that is compressed in a piston cylinder.
The diagram of gas compression in a piston cylinder is as follows:
The piston is moved at some distance and that differential distance is ds. The differential distance is under the effect of pressure forces PA where A is the cross sectional area of the piston whereas P is the pressure forces. Here the work is being done.
The equation for work done on the system is as follows:
Wpressure= δWboundry=PAVpiston
Here the value of Vpistonis as follows:
Vpiston=dsdt
We will start the derivation with a little theoretical background.
Let us consider a system that has arbitrary shape and the diagram is as follows:
The system moves with the effect of pressure. The pressure here acts in an inward direction and normal the surface. The equation for the time rate at which work is done by pressure on the differential part of the system is as follows:
Wpressure=-PdAVn
Wpressure=-PdA(V.n)
The equation for the normal component is as follows:
Vn=Vcos
Vn=V.n
So now I will show you the equation for the total rate of work done by the pressure forces:
Wpressure net in=-∫A P (V.n)=-∫APρ(V.n)dA
Now there is an equation that shows the general form of energy equation that is applied to the fixed, moving and deforming control volumes as follows:
Qnet in+Wshaft, net in+Wpressure, net in=ddt∫cvedV+∫cse(Vr.n)dA
So is the energy equation for the fixed, moving and deformed control volumes.