HW3_Matlab
HW3_Matlab
DATE: 09/24/2024,
NAME: Cesar A. Pascal
Homework # 3,
Read Chapters #4 and #5,
Problems:
5.1 (p. 197), 5.11 (p. 199)
Script:
>>
figure(1)
x = [0:0.1:10];
y = exp(x);
plot(x,y)
grid on
title('e^x')
xlabel('x-axis')
ylabel('y-axis')
%b
figure(2)
x = [0:0.1:10];
y = sin(x);
plot(x,y)
grid on
title('sin(x)')
xlabel('x-axis')
ylabel('y-axis')
%c
figure(3)
a = 5;
b = 2;
c = 4;
x = [0:0.1:10];
y = (a*x.^2)+(b*x)+c;
plot(x,y)
grid on
title('ax^2+bx+c')
xlabel('x-axis')
ylabel('y-axis')
%d
figure(4)
x = [0:0.1:10];
y = sqrt(x);
plot(x,y)
grid on
title('Square Root of x')
xlabel('x-axis')
ylabel('y-axis')
Answer:
Discussion: For this problem I first compute then plugging the number on it to graph it. Later
>> length =
[2.0000, 2.0024,
2.0047, 2.0070,
2.0094, 2.0128,
2.0183, 2.0308,
2.0500, 2.075];
Force = [0, 2000, 4000, 6000,7500, 8000, 8500, 9000, 9500, 10000];
diameter = 0.505;
Area = pi*((diameter/2)^2);
stress = Force./Area;
grid on
title('Tensile Testing')
xlabel('Strain')
ylabel('Stress')
Discussion:
On this problem I compute the equation for each of the different values then compute the graph.
Answer:
stress'
strain'
Stress:
1.0e+04 *
0.9985
1.9970
2.9956
3.7445
3.9941
4.2437
4.4933
4.7430
4.9926
Strain:
0.0012
0.0024
0.0035
0.0047
0.0064
0.0091
0.0154
0.0250
0.0375