1. Using estimates of rainfall, evaporation, and water consumption, the town eng
ID: 3881167 • Letter: 1
Question
1. Using estimates of rainfall, evaporation, and water consumption, the town engineer developed the following model of the water volume in the reservoir as a function of time
Where V is the water volume in liters, t is time in days, and r is the town’s consumption rate in liters per day. Write two user-defined functions. The first function should define function V(t) to evaluate V for any input of . The second function should use fzero to compute how long it will take for the water volume to decrease to x percent of its initial value of Liters. The inputs to the second function should be x and r. Test your functions for the case where x= 50 percent and r = 107 Liters/day.
2. We want to analyze the mass-spring system illustrated in the figure below for the case in which the weight W is dropped onto the platform attached to the center spring. If the weight is dropped from a height h above the platform, we can find the maximum spring compression x by equating the weight’s gravitational potential energy (h + x) W with the potential energy stored in the springs. Thus
Which can be solved for x as
And
Which gives the following quadratic equation to solve for x:
Create a function that computes the maximum compression x due to the falling weight. The function’s input parameters are k1, k2, d, W, and h. Test your function for the following two cases, using the values k1 = 104 N/m; k2 = 1.5 × 104 N/m; and d = 0.1 m.
W = 100 N h = 0.5 m
W = 2000 N h = 0.5 m
Use your function file to generate a plot of x versus h for 0h2 m. Use W = 100 N and the preceding values for k1, k2, and d.
Trying to figure out how this is done in MATLAB R2016. I can not figure out how to put it in as a function then do it as a command.
Please help
Explanation / Answer
1) Ans:
clear screen;
clear all;
close all;
x = input('Please enter the value of x: ');
r = input('Please enter the value of y: ');
fzero = 10^9; %%in litres %% defining the first function
syms t
solve((fzero*x/100)-(10^9)-(10^8*(1-exp(-t/100))) + (r*t) == 0)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.