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:...
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...
(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...
Your task is to estimate how far an object traveled during the time interval 0≤t≤80≤t≤8, but...
Your task is to estimate how far an object traveled during the time interval 0≤t≤80≤t≤8, but you only have the following data about the velocity of the object. time (sec) 0 1 2 3 4 5 6 7 8 velocity (feet/sec) -4 -3 -2 -4 -2 4 2 1 2 To get an idea of what the velocity function might look like, you pick up a black pen, plot the data points, and connect them by curves. Your sketch looks...
Item 5 The equilibrium constant of a system, K, can be related to the standard free...
Item 5 The equilibrium constant of a system, K, can be related to the standard free energy change, ΔG, using the following equation: ΔG∘=−RTlnK where T is standard temperature in kelvins and R is the gas constant. Under conditions other than standard state, the following equation applies: ΔG=ΔG∘+RTlnQ In this equation, Q is the reaction quotient and is defined the same manner as K except that the concentrations or pressures used are not necessarily the equilibrium values. Part A Acetylene,...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT