clear all
close all
clc
alpha=[0,5,8,12];
gamma=[0.05,0.1,0.15];
q=[0:0.01:2];
for i=1:3
gam=gamma(i);
for j=1:4
alph=alpha(j);
th=[];
for k=1:length(q)
theta=roots([gam 0 (1-q(k)) -q(k)*alph]); % solving the
polynomial
th=[th theta];
end
st1=[num2str(gam)];
st2=[num2str(alph)];
figure
plot(th,q)
title(sprintf('theta vs q for gamma= %s alpha= %s',st1,st2))
xlabel('theta')
ylabel('q')
end
end
%%%%please upvote if was able to help you.
hint : solve the cubic equation for theta and then plot the graph of theta vs...
? need matlab code to solve this two equation theta will be 0<theta<360 Solve this two equation theta will be 0 < theta < 360 0.08 cos theta = -0.19 4- 0.2 sin gamma + 0.24 cos beta 0.08 sin theta = -0.0.7 4- 0.2 cos gamma - 0.24 sin beta
The following procedure can be used to determine the roots of a cubic equation a_3x^3 + a_2x^2 + a_1x + a_0 = 0: Set: A =a_2/a_3, B = a_1/a_3, and C = a_0/a_3 Calculate: D = Q^3 + R^2 where Q = (3B - A^2)/9 and R = (9AB - 27C - 2A^3)/54. If D > 0, the equation has complex roots. It D = 0, all roots are real and at least two are equal. The roots are given...
in MATLAB Curve fitting Given the following data, find the best linear functional relationship and cubic functional relationship using “polyfit,” “polyval,” and “plot” built-in functions. Plot all three fits that you got from Matlab. A rough plot by hand is allowable. You do not need to provide any codes. x = [-3, -2, 0, 1, 3, 4, 6, 7, 8, 9]; y = [5, 7, 8, 10, 6, 2, -4, -6, -2, 1];
Use the circuit below to complete the given MATLAB script to plot the three currents I1, I2, and I3. Run MATLAB then pick an answer from the choices below that matches the MATLAB plot. MATLAB uncomplete script %phasor plot clc; clear all; close all; Z1=2; Z2=2j; Z3=2-2j; %no need to use the * as in 6*j %Vs=8/_45 theta=45*pi/180; %convert theta to radians R=8; [a,b]=pol2cart(theta,R); %note theta first in the arguments Vs=a+j*b; %cartesian form Z23= ___________; % Complete Zeq=____________ ; %...
Use the circuit below to complete the given MATLAB script to plot the three voltages Vr, Vc and VL. Run MATLAB then pick an answer from the choices below that matches the MATLAB plot. MATLAB uncomplete script clc; close all; clear all; Mvs= 10; Avs=30*pi/180; [Xvs Yvs]=pol2cart(Avs, Mvs); Vs=Xvs+j*Yvs; % Impedances values Zr=4; ZL=10j; Zc=-12j; % total equivalent impedance of series R, L and C Zeq = ; %complete % Calculate current It = ; %complete Vr= ; %complete Vc=...
1. A particle moves in one dimension, and its position vs. time is described by the function x0) e (t in seconds, x in meters) (a) At what time(s) is its velocity zero? At what time(s) is its acceleration zero? (b) Make a computer plot(Excel, Matlab or whatever you wish) of x vs. t from 1-o to 5 s. (c) What do you expect to see on the x vs. t graph at the time(s) that v-o? What do you...
Use the circuit below to complete the given MATLAB script to plot the three currents 11, 12, and 13. Run MATLAB then pick an answer from the choices below that matches the MATLAB plot. I Z1 13 212 1, 22, 23 Vs + 8/45° 22222 2.12 MATLAB uncomplete script %phasor plot clc; clear all; close all: Z1-2; Z2=2j; Z3=2-2j; %no need to use the as in 6*j %Vs=87_45 theta=45*pi/180;%convert theta to radians R-8: [a,b]=pol2cart(theta,R): %note theta first in the arguments...
Use MATLAB to plot the cdf of X in part (a). .13. A random variable X has cdf: for x <0 Ex(x)-11-le-a for x 0. 4 (a) Plot the cdf and identify the type of random variable. (b) Find P[X s 2], PX 0), P[X < 0], P[2< X < 6], P[X > 10
Graph the function and find f(0) 13 Graph fx)-x -2, ifxs-1 2 x, ifx >-1 8-6 4 2 2 4 6 8x -2 -6 -8
2. Solve the one-dimensional heat equation problem for a unit length bar with insulated ends with a prescribed initial linear temperature distribution: c2uxx = 111 , l4 (0,t)-14 (l,t)-0, 0 < x < 1 20-x) , Last Name A-M 3x, Last Name N -Z u(x,0) = The general solution to this problem is given in Example 4, page 563 in the text in terms of a Fourier Cosine Series. Write out the solution steps and evaluate the Fourier coefficients by...