Question

Using MATLAB's command of "ODE45", generate plots of H1(t) and H2(t) on the same graph given...

Using MATLAB's command of "ODE45", generate plots of H1(t) and H2(t) on the same graph given the following information

H1= 10

H2= 5

H1' (aka the derivative of h1) = -Q / 19.6

H2' = Q/19.6

Q= 0.015 (H1-H2)

Include your entire code and the picture of the graph it provides

Homework Answers

Answer #1

Code:

clear all;

clc;

% Since diffrential equations for H1' and H2' are interdependent via Q,

% so they will be solved simulatneosuly

% given system of diffrential equations

f = @(t,x) [(-0.015*(x(1)-x(2)))/19.6; (0.015*(x(1)-x(2)))/19.6];

% solve the system using ode45

tspan = [0 5];

y0 = 0;

[t,y] = ode45(@(t,y) (-0.015*(x(1)-x(2)))/19.6, tspan, y0);

[t,xa] = ode45(f,[0 1.5],[10 5]);

% plot the solution

plot(t,xa(:,2))

title('y(t)')

xlabel('t'), ylabel('y')

grid on

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
I'm trying to make a two box plots side by side on the SAME graph in...
I'm trying to make a two box plots side by side on the SAME graph in R, to show case the following: Treatment Distance 1 Control 50.0 2 Control 60.5 3 Control 63.5 4 Control 77.5 5 Control 51.5 6 Control 39.0 7 Control 80.0 8 Control 57.0 9 Control 55.0 10 Control 41.0 11 Control 18.0 12 Control 95.0 13 Control 52.0 14 Control 63.5 15 Control 58.0 16 Control 128.0 17 Control 106.5 18 Control 83.1 19 Control...
Familiarize yourself with the subplot and hold command. Using the subplot and plot commands, plot the...
Familiarize yourself with the subplot and hold command. Using the subplot and plot commands, plot the volume of a sphere as a function of it’s radius for values of radius from 1 to 10. On the same graph plot the surface area of a sphere as a function of the radius ( from radius = 1 to 10). Use different colors for the two plots ( help plot will give details on how to select colors). Use the following formulas:...
Using Python: Create a code to generate 1001 values between 0 and 10 (essentially, start from...
Using Python: Create a code to generate 1001 values between 0 and 10 (essentially, start from 0 and use increment 0.01) and for each value ? ∈ [0,10] calculate sin(?) and the derivative of ?(x) = sin(?) using the central difference method: ????(?)/?? = ?(?+0.01)−?(?−0.01) 2∙0.01 . Output the result in a file using the print command: print (?, ???(?) , ????(?), ??? =′ ′, ??? =′\ ? ′ , ???? = ??) Recall that the output file must be...
Graph the T-accounts using a PEN or a PENCIL. upload the photograph of your graph. The...
Graph the T-accounts using a PEN or a PENCIL. upload the photograph of your graph. The following describes a banking system of a country. i) all banks have the same target reserve ratio of 4% ii) there is a currency drain of 6% iii) initially, banks hold no excess reserves iv) all the money loaned out gets redeposited in another bank a) An individual deposits their monthly pay of $3,000 in the first bank. On a T-account, show what happens...
For a given dataset in a csv file answer the following using unix command only: 3)...
For a given dataset in a csv file answer the following using unix command only: 3) The 2nd column is the unique identifier for a Facebook post. What are the other columns? 4) How many Facebook posts are there in the file? 5) What is the date range for Facebook posts in this file? (Assume that the data is in order) 6) How many unique pages are there? 7) How many unique posts are there? [Hint: one page can have...
(16 marks total) Using the IS-LM model discussed in chapter 10, suppose you’re given the following...
(16 marks total) Using the IS-LM model discussed in chapter 10, suppose you’re given the following information: • The consumption function is given by C = 40 + 0.5 (Y − T). • The investment function is given by I = 150 − 10r. • T = 120, and G = 170. (a) Find planned expenditure P E as a function of Y and r. (b) For the case where r = 8, find the value of Y that produces...
Calculate the Y values corresponding to the X values given below. Find the critical values for...
Calculate the Y values corresponding to the X values given below. Find the critical values for X for the given polynomial by finding the X values among those given where the first derivative, dy/dx = 0 and/or X values where the second derivative, d­2y/dx2 = 0. Be sure to indicate the sign (+ or -) of dy/dx and of d2y/dx2 tabled values. Reference Power Point Lesson 13 as needed. Using the first and second derivative tests with the information you...
Calculate the Y values corresponding to the X values given below. Find the critical values for...
Calculate the Y values corresponding to the X values given below. Find the critical values for X for the given polynomial by finding the X values among those given where the first derivative, dy/dx = 0 and/or X values where the second derivative, d­2y/dx2 = 0.    Be sure to find the sign (+ or -) of dy/dx and of d2y/dx2 at all X values. Reference Lesson 13 and the text Appendix A (pp 694 – 698), as needed. Using the...
1. Please keep using the same information (that was provided in the previous questions) to answer...
1. Please keep using the same information (that was provided in the previous questions) to answer the question below.                               Date                     DJIA (imaginary index)            1.            Oct. 12, 2015 11,000                2.            Oct. 10, 2016 11,100                3.            Oct. 16, 2017 13,300                4.            Oct. 14, 2018 15,000                5.            Oct. 07, 2019 16,500                6.            Oct. 03, 2020 26,500 Determine the growth rate (in %) of the DJIA during the entire period (from Oct. 12, 2015 to Oct....
6.7 The production function Q=KaLb where 0≤ a, b≤1 is called a Cobb-Douglas production function. This...
6.7 The production function Q=KaLb where 0≤ a, b≤1 is called a Cobb-Douglas production function. This function is widely used in economic research. Using the function, show the following: a. The production function in Equation 6.7 is a special case of the Cobb-Douglas. b. If a+b=1, a doubling of K and L will double q. c. If a +b < 1, a doubling of K and L will less than double q. d. If a +b > 1, a doubling...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT