Engr 103 Hw#9

docx

School

The City College of New York, CUNY *

*We aren’t endorsed by this school

Course

103

Subject

Mathematics

Date

Jan 9, 2024

Type

docx

Pages

10

Uploaded by JusticeScorpionPerson9187

Report
ENGR 10300 MAT LAB HW#9 Question#5.1: >> x = linspace(0,35,100); y = 0.4*sqrt(1.8.*x); plot(x,y) axis([0,35,0,3.5]); Graph: Question#5.2 f=@(x) tan(cos(x))-sin(tan(x));
x=[0 2*pi]; fplot(f,x); xlabel('x'); title('tan(cos(x))-sin(tan(x))') 292 values are needed for x to obtain the same plot Question#5.3: >> n = linspace(1,20,100); >> y = (0.2+0.8i).^n; >> plot(y), xlabel('Real Value'),ylabel('Imaginary Value'), title('Imaginary vs Real'),axis equal
Question#5.2-1: t = linspace(0,8,100); z = exp(-0.5*t).*cos((20*t)-6); v = linspace(-8,8,100); u = 6*log10((v.^2)+20); subplot(2,1,1) plot(t,z),xlabel( 't' ),ylabel( 'z' ),title( 't vs z' ) subplot(2,1,2) plot(v,u),xlabel( 'v' ),ylabel( 'u' ),title ( 'v vs u' ) Graph:
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question#3: A: f=@(x) x.^3-3*x.^2+5*x.*sin(pi*x/4-5*pi/4)+3; x=-1:0.01:4; y=f(x); x1=[-1 4]; y1=x1*0; plot(x1,y1, 'k' ); % plot the x-axis hold on plot(x,y, 'LineWidth' ,1.5); xlabel( 'x' , 'fontsize' ,14); ylabel( 'f(x)' , 'fontsize' ,14); B: f=@(x) x.^3-3*x.^2+5*x.*sin(pi*x/4-5*pi/4)+3; x=-1:0.01:4; % x limits found using trial and error method y=f(x); x1=[-1 4]; y1=x1*0; plot(x1,y1, 'k' ); % plot the x-axis hold on x1=-0.48; x2=1.14; x3=3.83; Root1 = fzero(f,x1); Root2 = fzero(f,x2);
Root3 = fzero(f,x3); disp( 'The actual roots of the equation are: ' ), Root1,Root2,Root3 x2=[Root1 Root2 Root3]; y2=f(x2); plot(x,y, '-' ,x2,y2, 's' , 'LineWidth' ,1.5); xlabel( 'x' , 'fontsize' ,14); ylabel( 'f(x)' , 'fontsize' ,14); The actual roots of the equation are: Root1 = -0.4795 Root2 = 1.1346 Root3 = 3.8318
Question#7: i = 0; sum = 0; n=1; while i<200 sum =sum+((-1)^i)/(2*i+1); i = i+1; diff(n)=sum-pi/4; n = n+1; end n = 1:200; plot(n,diff) xlabel( '# of terms' ) ylabel ( 'difference' ) Graph: Question#20: Sorry professor, but this was a tough question for me since we are given two unknown variables within the same equation. Question#21:
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
t=[2005:2009]; T=[18,19,21,17,20]; figure(2); stem(t,T); figure(3); bar(t,T); figure(4); stairs(t,T); Graphs:
Question#23: Part A: r=0.1:0.01:100; V=(4/3)*pi*r.^3; A=4*pi*r.^2; subplot(2,1,1)
plot(r,V) xlabel('r') ylabel('V') axis([60 100 0 6*10^6]) subplot(2,1,2) plot(r,A) xlabel('r') ylabel('A') axis([60 100 0 15*10^4]) Part B: >> A=1:1:10^4; r=sqrt(A/(4*pi)); V=(4/3)*pi*r.^3; subplot(2,1,1)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
plot(A,r) axis([3000 10000 0 30]) xlabel('A') ylabel('r') subplot(2,1,2) plot(A,V) axis([3000 10000 0 10*10^4]) xlabel('A') ylabel('v')