Solve the following set of linear algebraic equations numerically by MATLAB, put
ID: 3195238 • Letter: S
Question
Solve the following set of linear algebraic equations numerically by MATLAB, put the equations in vector ,x + 2y + 4z = 16 -3x + 2z = 48 3. matrix form and solve: Solve the above set of equations symbolically by "solve" command. Follow below, study how it works. (Copy/paste in an m-file and run; otherwise, you have to retype the whole thing if there is a mistake.) syms x yz eqi x+2"y+4*z 16 Move all xx, yy, zz] solve (eq1, eq2, eq3, x, y, z) Solve equations syabolically e The answers are rational numbers (long fractions) convert to decimal i 4. s Define symbols z,Y. : Move a11 arguments to one side: so that eql- % Do the same for the other two equations. Note order of variable names. xx-double (xx) s Repeat for yy, zz. 5. Generate a plot of: notation to generate the x vector in increments of 0.05 y(x)s e-or cos(wt + 45): 6 rad/s and 0 t S 10. Utilize the colon Attention: MATLAB works in radians, not degrees. Attention: Would need to use.* here when multiplying the exponential with the cosine, explain why. 6. Define then evaluate the following functions symbolically in MATLAB by defining symbolic functions. All numbers must be to 4 significant digits a) f(x,y) = x2y + 3 cos(V5xy)+0.5; @x=3.5.y = 4.5 b) (s +1)e-23s s2 + s + 1 + K' @s=2.K remains. X(s) Example: syms x y: f (x, y)-x2+ y: z(1.89,y): vpa (z, 4) this would return z evaluated at x = 1.89, y remains, with 4 significant digit numbers (no fraction bar numbers). f(x,y) Define then evaluate the following functions in MATLAB by substitution using "subs" command, all numbers must have decimal points with 4 significant digits (use vpa as in problem 6): a. 7. f(xy.z) = (Vzx+2) rly1.5 + 2 tan (y4x2zy) + In(7y/z) + 7.6531; @ y-h2 = 3.76, x remains. b. (s2 +1)e-st r(s) = s* + 4s't (+3)s2 +(K + 1)s + 4 : @ K = 4, = 1.33, to = 0.5, s remains. Example: syns x y z; f-x^2 + y + z; v = subs (f,{x,y),(1.89,2)); vpalv, 4). This substitutes x = 1.89 and y = 2 in f,2 remains. All numbers would have decimal points with 4 significant digits.Explanation / Answer
3)
A = [1 2 4 ; -3 0 2 ; 0 -1 3];
b = [16 ; 48 ; 8];
x = inv(A)*b
x =
-13.0000
5.5000
4.5000
4)
syms x y z
eq1 = x + 2*y + 4*z -16 ;
eq2 = -3*x + 2*z -48 ;
eq3 = -y + 3* z - 8 ;
[xx,yy,zz] =solve(eq1,eq2,eq3,x,y,z)
xx =
-13
yy =
11/2
zz =
9/2
Please rate
Please post rest questions again
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.