Activity 1

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

ME 382

Control Engineering Laboratory

Activity 1
SCRIPT FILE

Name :ALDWIN AJOC Course & Year: BSME - 3

Section: P1 Date : September 11 2023

Engr. Lotis Patunob, PECE


Instructor

Activity 1

STARTING WITH SCILAB


PROBLEMS
Solve the following problems in the scilab window or in the console.

1. Calculate:

a.

Commands:
clc
//Activity 1.
a = (1/3)^2 + (3*sqrt(16)) * (4^(1/3))/(sqrt(16)^3) - (10 - 1/4)^2;
disp(a);

Answer:

-94.65375119

b.

Commands:

clc
//Activity 1.
b = (1/4)^3 - (3*sqrt(16)) + (4^(1/3))/(sqrt(16)^3) *(10 + 1/4)^2;
disp(b);
Answer:

-9.626526367
2. Calculate:

a.

Commands:
c = (cos(5*%pi/3)^2 * sin(5*%pi/3)^2 + tan(5*%pi/3)) * 6 * (1/tan(5*%pi/3))^2;
disp(c);

Answer:

-3.0891016

b.

Commands:

d = asin((5/2)^3) + (acos(3) / asin(3)) * asec(1/3);


disp(d);

Answer:

0.6952481 - 4.4235338i

3. Define the variables x and y as x = 8.3 and y = 2.6, then evaluate:

a.

Commands:

x = 8.3;
y = 2.6;
e = (y^2)/(2*x) + sqrt(3*y^2*x);
disp(e);
Answer:

13.381203
b.

Commands:

x = 8.3;
y = 2.6;
f = ((12*x)^(1/y)) / exp(-x) + ((x + y)^2) / sqrt(x^4);
disp(f);
Answer:

23617.678

1. Given the value of verify the following trigonometric identities.

a.

Commands:
// Define the value of x
x = 3*%pi/2;
// Calculate the left-hand side of the identity: tan(3x)
lhs = tan(3*x);
// Calculate the right-hand side of the identity: (3*tan(x) - tan(x)^3) / (1 - 3*tan(x)^2)
rhs = (3*tan(x) - tan(x)^3) / (1 - 3*tan(x)^2);
// Check if the identity holds
if lhs == rhs
disp('The identity is verified.');
else
disp('The identity is NOT verified.');
end
Answer: The identity is verified.
Commands:

// Check if the identity holds


if lhs == rhs
disp('The identity is verified.');
else
disp('The identity is NOT verified.');
end
x = 3*%pi/2;
lhs = cos(x/2);
rhs = sqrt(1 + cos(x))/2;
if abs(lhs - rhs) < 1e-6 then
disp("Identity is verified: cos(x/2) = ± (√(1+cos(x))/2)");
else
disp("Identity is false");
end
Answer: Identity is false

4. Triangle Problem, download figures for triangle.

Determine the length of segment BD and the other sides of the triangle.
Commands:

Answer:

You might also like