Question: Solve the following problems using MATLAB. Create a single *.m script file that contains the solutions for all three problems. Make sure that you follow
Solve the following problems using MATLAB. Create a single *.m script file that contains the solutions for all three problems. Make sure that you follow the given instructions to solve the problem. Remember that using solutions or concepts from the internet to solve the problems is considered a violation of Academic Integrity. Do not use any concepts that do not appear in the book and have not been covered in class.
Problem 2
:
In this problem you will be plotting the bacteria growth as a function of time. The growth of a specific strain of bacteria has been determined to follow the relationship y = y(subscript i)e^(kt) where y is the number of bacteria at a given time, y(subscript i) is the initial number of bacteria (assume y (sub i) is 1), k is a constant (1.386/hr), and t is the elapsed time in hours. Using the linspace function create an array for time from 0 to 7 hours in steps of 0.1 hours. Store the appropriate information in variables for ysubi, and k. Calculate the number of bacteria for each time period.Scientists and engineers often prefer to plot data using log scales or inverse of one of th parameters so that the data is displayed as a straight line so that information at other points may be easily extracted. Using the subplot command (Chapter 5) , plot the number of bacterial as a function of time using linear scales for both axes; a log scale for the y axis and a linear scale for the x axis; a log scale for the x axis and a linear scale for the y axis; and a log scale for both axes. Label the axes and add titles for all four plots. In comments indicate which of these plots if any produce a straight line
.Problem 3:In this problem you will be creating estimates of pi. One way to estimate the outcome of for a problem is to use a Monte Carlo simulation which uses a large number of random numbers and then compares the results of these numbers. For estimating , we can visualize a circle of radius 1 inside a square with a side of 2, both centered on zero.The area of the square is 4 and the area of the circle is pi. The ratio of the area of the circle to the area of the square is pi/4. Consequently, if a large number of points (N) with x and y values varying between 1 and -1 is generated, the number of points falling inside the circle would be Points in circle = N*pi/4The number of points fallinginside the circle can be determined by the condition x2+ y2<= 1.Generate row vectors of uniformly distributed random numbers containing 10000 x-values and 10000 y-values and 1000000 x-values and 1000000-y values.All these values should be between -1and 1.11-1-1 Programming Project53CMPSC 201 Fall 2017Use the built-in functions of length(Chapter 3) and find(Chapter 8) to determine the number of points falling in the circle for the row vectors of 10000 elements and the row vectors containing 1000000 elements. Then use these values to calculatethe estimate of . (Do not use any built-in functions other than find, length and randfor this problem.)The script file should generate row vectors of random numbers.You should have 2 scenarios: 10000 x-values and 10000 y-values the scenario of 1000000 x-values and 1000000-y values. Add comments to the end of this problem stating why you did not get the same value for pi for both scenarios.
Make sure that you have comments immediately before each problemthat describe the purpose of the function, the input needed, the output expected, and processing needed. Make sure that your file will run without any errors and any variables in the workspace. Do not store anything in the default variable ans.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
