Question

In: Mechanical Engineering

Use MATLAB to determine the intersection point for the sets of equations shown below.

Use MATLAB to determine the intersection point for the sets of equations shown below. Use the backslash when possible.Graph the equations with different colors, and plot the intersection point with a red star marker. If the equations do not intersect, graph them anyway.

Include a legend:

a) -4x1 + 2x2 = 10                                                                                b)-4x1+2x2^3 = 10

x1 + x2 = -8                                                                                           x1+ x2 = -8                   

Solutions

Expert Solution

Program a)

clear all;
clc;
syms x1 x2
f1(x1,x2)=-4*x1+2*x2-10;
f2(x1,x2)=x1+x2+8;
ez1=ezplot(f1);
set(ez1,'color','blue')
hold on;
ez2=ezplot(f2);
set(ez2,'color','black');
hold on;

%following procedure is to find x2 such that f1=f2 (i.e. intersection
%point) and then finding x1 from x2.

b=solve(((2*x2-10)/4)+8+x2==0); % x2 for f1=f2
a=-b-8; %x1 from x2
plot(a,b,'*','color','red')
legend('-4x1 + 2x2 = 10','x1 + x2 = -8','intersection point')
title('Case(a)');

Graph

Program b)

clear all;
clc;
syms x1 x2
f1(x1,x2)=-4*x1+2*(x2^3)-10;
f2(x1,x2)=x1+x2+8;
ez1=ezplot(f1,[-8,8]);
set(ez1,'color','blue')
hold on;
ez2=ezplot(f2,[-8,8]);
set(ez2,'color','green')

%following procedure is to find x2 such that f1=f2 (i.e. intersection
%point) and then finding x1 from x2.

b=solve(((2*(x2^3)-10)/4)+8+x2==0); % x2 for f1=f2
a=-b-8; %x1 from x2
plot(a,b,'*','color','red')
legend('-4x1 + 2(x2^3) = 10','x1 + x2 = -8','intersection point')
title('Case(b)');

Graph


Related Solutions

For the following problems, use Octave/Matlab to determine whether the following sets
For the following problems, use Octave/Matlab to determine whether the following sets span \(\mathbb{R}^{3}\). Remember you need to pick an arbitrary element in \(\mathbb{R}^{3}\) and see if you can write it as a linear combination of the set of vectors.For each problem, do the following:1) - Write the row reduced echelon matrix found by Octave.2) - Tell me if this set spans \(\mathbb{R}^{3}\).3) - If this set spans \(\mathbb{R}^{3}\), solve for \(\alpha, \beta, \ldots\) (in other words, tell me how...
Please write a MATLAB code that shows the intersection point of resistance circle and reactance arc...
Please write a MATLAB code that shows the intersection point of resistance circle and reactance arc on Smith Graph, according to the given load impedance value. Assuming that the characteristic impedance of the transmission line is taken as 50 ohms.
Two sets are separated if the intersection of the closure of one of the sets with...
Two sets are separated if the intersection of the closure of one of the sets with the other is empty. a) Prove that two closed and disjoint sets of some metric space are separate. b) Prove that two open and disjoint sets of some metric space are separate.
For each of the following data sets, write a system of equations to determine the coefficients...
For each of the following data sets, write a system of equations to determine the coefficients of the natural cubic spline passing through the given points. x| 2 4 7 ------------- y| 2 8 12
For each of the following data sets, write a system of equations to determine the coefficients...
For each of the following data sets, write a system of equations to determine the coefficients of the natural cubic spline passing through the given points. x| 3    4 6 ------------------ y| 10 15 35
Use the chi-square test for goodness of fit to determine if the data shown below are...
Use the chi-square test for goodness of fit to determine if the data shown below are consistent with an inheritance pattern of simple dominance. Use p = 0.05 for determining significance. Cross: Aa x Aa Offspring: 70 dominant phenotype 30 recessive phenotype A. The data are consistent with a simple dominance pattern of inheritance. B. The data are not consistent with a simple dominance pattern of inheritance.
Use normal vectors to determine the intersection, if any, for each of the following groups of...
Use normal vectors to determine the intersection, if any, for each of the following groups of three planes. Give a geometric interpretation in each case and the number of solutions for the corresponding linear system of equations. If the planes intersect in a line, determine a vector equation of the line. If the planes intersect in a point, determine the coordinates of the point. a x + 2y + 3z = −4 b x + 2y + 3z = −4...
A firm’s labour demand and labour supply equations are shown below.
A firm’s labour demand and labour supply equations are shown below.          Labour demand equation: Ld = 40 – 2(w)          Labour supply equation: Ls = −20 + 3(w),where w is the wage per hour worked.Instructions: Round your answers to the nearest whole number.a. The equilibrium wage is $___ , and the equilibrium quantity of labour employed is ___ people.b. The workers, thinking that their wages are too low, decide to strike. After tense negotiations, the firm decides to raise...
The intersection (∩) of two sets (s1, s2) is the set of all elements that are...
The intersection (∩) of two sets (s1, s2) is the set of all elements that are in s1 and are also in s2. Write a function (intersect) that takes two lists as input (you can assume they have no duplicate elements), and returns the intersection of those two sets (as a list) without using the in operator or any built-in functions, except for range() and len(). Write some code to test your function, as well. Note: Do not use the...
Using Minitab and given the data sets below a) determine if there is a difference in...
Using Minitab and given the data sets below a) determine if there is a difference in the means at an alpha level 0.05; b) determine if the variability of data set A is larger. Data A Data B 35.8 40.9 40.4 35.7 30.3 36.7 46.8 37.3 34.1 41.8 34.0 39.9 39.1 34.6 45.0 38.8 41.9 35.8 40.2 35.6
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT