Practice word problem for matlab program, Exercises of Mathematical Methods for Numerical Analysis and Optimization

Contains words problems that require use of matlab program to solve

Typology: Exercises

2024/2025

Uploaded on 02/19/2025

christopher-muganga
christopher-muganga 🇺🇬

3 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MATLAB Word Problems for Practice
1. Bank Interest Calculation
A customer deposits 5 million UGX in a savings account that earns an 8% annual interest rate,
compounded monthly. Write a MATLAB script to calculate the total amount in the account after 5
years.
2. Traffic Light Simulation
A traffic light cycles through green (30s), yellow (5s), and red (60s). Write a MATLAB function that,
given a time t (in seconds), determines the current light color.
3. Population Growth
A town has a current population of 50,000 and is growing at a rate of 3% per year. Write a MATLAB
function to predict the population after 10 years. Modify the function to find out in which year the
population exceeds 100,000.
4. Stock Market Prediction
You are tracking the daily prices of a stock for 30 days. Generate a random 30 1 vector representing
stock prices. Find the day with the highest price and the average price over 30 days. Plot the stock
prices over time.
5. Loan Repayment Schedule
A person takes a loan of 15 million UGX at a 10% annual interest rate, to be paid over 3 years with
equal monthly payments. Write a MATLAB function to calculate the monthly payment. Display a
table showing the remaining balance after each month.
6. Heat Transfer in a Metal Rod
A 1-meter-long metal rod is heated at one end to 100 C, while the other end is at 0 C. Use the finite
difference method to model the temperature distribution along the rod. Plot the temperature profile.
7. Earthquake Magnitude Comparison
The Richter scale measures earthquake magnitude logarithmically. Write a MATLAB function that
takes two earthquake magnitudes M1 and M2 and computes how many times more energy the
larger earthquake releases than the smaller one using the formula: E1 / E2 = 10^((M1 - M2) * 1.5).
8. Rocket Launch Simulation
A rocket is launched with an initial velocity of 500 m/s at an angle of 60 . Write a MATLAB script to
compute the maximum height, range, and flight time. Plot the trajectory of the rocket.
9. Water Tank Level Monitoring
pf3

Partial preview of the text

Download Practice word problem for matlab program and more Exercises Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

MATLAB Word Problems for Practice

  1. Bank Interest Calculation A customer deposits 5 million UGX in a savings account that earns an 8% annual interest rate, compounded monthly. Write a MATLAB script to calculate the total amount in the account after 5 years.
  2. Traffic Light Simulation A traffic light cycles through green (30s), yellow (5s), and red (60s). Write a MATLAB function that, given a time t (in seconds), determines the current light color.
  3. Population Growth A town has a current population of 50,000 and is growing at a rate of 3% per year. Write a MATLAB function to predict the population after 10 years. Modify the function to find out in which year the population exceeds 100,000.
  4. Stock Market Prediction You are tracking the daily prices of a stock for 30 days. Generate a random 30 1 vector representing stock prices. Find the day with the highest price and the average price over 30 days. Plot the stock prices over time.
  5. Loan Repayment Schedule A person takes a loan of 15 million UGX at a 10% annual interest rate, to be paid over 3 years with equal monthly payments. Write a MATLAB function to calculate the monthly payment. Display a table showing the remaining balance after each month.
  6. Heat Transfer in a Metal Rod A 1-meter-long metal rod is heated at one end to 100 C, while the other end is at 0 C. Use the finite difference method to model the temperature distribution along the rod. Plot the temperature profile.
  7. Earthquake Magnitude Comparison The Richter scale measures earthquake magnitude logarithmically. Write a MATLAB function that takes two earthquake magnitudes M1 and M2 and computes how many times more energy the larger earthquake releases than the smaller one using the formula: E1 / E2 = 10^((M1 - M2) * 1.5).
  8. Rocket Launch Simulation A rocket is launched with an initial velocity of 500 m/s at an angle of 60. Write a MATLAB script to compute the maximum height, range, and flight time. Plot the trajectory of the rocket.
  9. Water Tank Level Monitoring

A cylindrical water tank has a radius of 2m and a height of 5m. Water flows in at 0.1 m /s. Write a MATLAB function to compute how long it takes to fill the tank. Plot the water level vs. time.

  1. Wireless Signal Strength Signal strength decreases with distance according to the equation: S = S0 / d^2, where S0 = 100 is the initial strength and d is the distance in meters. Write a MATLAB script to plot signal strength vs. distance (1m to 100m).
  2. Road Trip Cost Estimator A car consumes 7 liters of fuel per 100 km, and fuel costs 5,000 UGX per liter. Write a MATLAB function that takes distance in km and computes the total fuel cost.
  3. Weather Data Analysis You have 365 days of temperature data stored in a 1 365 array. Write a MATLAB function to compute the average, maximum, and minimum temperatures. Plot the temperature data.
  4. Encryption and Decryption Implement a simple Caesar cipher in MATLAB that shifts letters in a string by 3 positions. Example: 'MATLAB' 'PDWODE'. Write a function to encrypt and decrypt messages.
  5. Coffee Drying Process Coffee beans are dried in the sun, reducing their moisture content from 50% to 12% over time. Use an exponential decay model to estimate how long it takes for the moisture to reach 12%.
  6. Image Processing - Edge Detection Read an image and apply an edge detection filter (Sobel or Canny). Convert the image to grayscale and detect edges. Display the original and processed images.
  7. Maze Solver (Pathfinding Algorithm) Write a MATLAB function to solve a 5 5 maze represented by a matrix of 0s (paths) and 1s (walls). Implement the Breadth-First Search (BFS) algorithm to find the shortest path.
  8. Disease Spread Simulation Model the spread of a disease using the SIR model (Susceptible-Infected-Recovered). Given initial conditions, simulate how an infection spreads over 30 days and plot the results.
  9. Solar Panel Energy Calculation A solar panel receives an average of 5 kWh/m /day of sunlight. Compute the total energy collected by a 2m 3m panel in 30 days.
  10. Flight Path Optimization