You are on page 1of 18

Seatwork 1

Introduction
This program is about matrices. It lets the user to input the value of A1, A2, A3, B1, B2,
B3, C1, C2, C3, K1, K2 and K3. The program then put it into a matrix from and solve for X1, X2
and X3.
Abstract
In mathematics, matrix is a rectangular array of numbers, symbols, or expressions,
arranged in rows and columns. The numbers, symbols or expressions in the matrix are called
its entries or its elements. The horizontal and vertical lines of entries in a matrix are
called rows and columns, respectively. The size of a matrix is defined by the number of rows and
columns that it contains. A matrix with m rows and n columns is called an m x n matrix or m-by-
n matrix, while m and n are called its dimensions.

Methodology
A1=input('A1=');
A2=input('A2=');
A3=input('A3=');
B1=input('B1=');
B3=input('B2=');
B2=input('B3=');
C1=input('C1=');
C2=input('C2=');
C3=input('C3=');
K1=input('K3=');
K2=input('K2=');
K3=input('K1=');
M=[A1 B1 C1;A2 B2 C2;A3 B3 C3]
K=[K1;K2;K3]
X=inv(M)*K;
X1=X(1)
X2=X(2)
X3=X(3)
clear
return
Seatwork 2

Introduction
In this program the user will input V1 and V2 (voltages) and R1, R2, and R3 (resistances)
and the program will solve for V3 by using the formula V1+V2. Also the program will solve for
the I1, I2, and I3 (current).

Abstract
Voltage is the difference in electric potential between two points per unit electric charge.
The voltage between two points is equal to the work done per unit of charge against a
static electric field to move the test charge between two points. This is measured in units of volts
An electric current is a flow of electric charge. In electric circuits this charge is often
carried by moving electrons in a wire. It can also be carried by ions in an electrolyte, or by both
ions and electrons such as in an ionized gas.The SI unit for measuring an electric current is
the ampere, which is the flow of electric charge across a surface at the rate of one coulomb per
second.
The electrical resistance of an electrical conductor is a measure of the difficulty to pass
an electric current through that conductor. The inverse quantity is electrical conductance, and is
the ease with which an electric current passes. Electrical resistance shares some conceptual
parallels with the notion of mechanical friction. The SI unit of electrical resistance is
the ohm (Ω), while electrical conductance is measured in Siemens.

Methodology
disp ('enter the following');
V1= input ('V1=');
V2= input ('V2=');
R1= input ('R1=');
R2= input ('R2=');
R3= input ('R3=');
X= [1,-1,-1;R2,R3,0;0,R2,-R3];
V3= V1+V2;
Y= [0;V3;V2];
A= inv(X)*Y;
I1=A(1)
I2=A(2)
I3=A(3)
clear
return

Seatwork 3

Introduction
This program is about the human femur and bovine femur. This program will solve the
Young’s modulus, Shear modulus and Poisson’s ratio of both the human and bovine femur and it
will compare the Young’s modulus of both the human and bovine femur using a bar graph.

Abstract
The femur or thigh bone, is the most proximal bone of the leg in tetrapod vertebrates capable
of walking or jumping, such as most land mammals, birds, many reptiles such as lizards,
and amphibians such as frogs. In vertebrates with four legs such as dogs and horses, the femur is
found only in the hind limbs. The head of the femur articulates with the acetabulum in the pelvic
bone forming the hip joint, while the distal part of the femur articulates with
the tibia and kneecap forming the knee joint. By most measures the femur is the strongest bone
in the body. The femur is also the longest bone in the human body.

Methodology
C11= 20;
C22= 21.7;
C33= 30;
C44= 6.56;
C55= 5.85;
C66= 4.74;
C12= 10.9;
C13= 11.5;
C23= 11.5;
C=
[C11,C12,C13,0,0,0;C12,C22,C23,0,0,0;C13,C23,C33,0,0,0;0,0,0,C44,0,0;0,0,0,0,C55,0;0,0,0,0,
0,C66];
X= det(C);
A11= (C22*C33-(C23)^2)/X;
A33= (C11*C22-(C12)^2)/X;
A13= (C12*C23-C13*C22)/X;
A44= 1/C44;
A22= (C33*C11-(C13)^2)/X;
A12= (C13*C23-C12*C33)/X;
A23= (C12*C13-C23*C11)/X;
A55= 1/C55;
A66= 1/C66;
A21= A12;
A31= A13;
A32= A23;
A=
[A11,A12,A13,0,0,0;A21,A22,A23,0,0,0;A31,A32,A33,0,0,0;0,0,0,A44,0,0;0,0,0,0,A55,0;0,0,0,
0,0,A66];
Y1= 1/(A(1,1));
Y2= 1/(A(2,2));
Y3= 1/(A(3,3));
S23= 1/(A(4,4));
S31= 1/(A(5,5));
S12= 1/(A(6,6));
V11= ((Y1/(2*S12)))-1;
V12= ((Y2/(2*S31)))-1;
V13= ((Y3/(2*S23)))-1;
N1= ((Y1+Y2+Y3)/3);
N2= ((S23+S31+S12)/3);
N3= ((V11+V12+V13)/3);
disp('Youngs modulus for human femur:')
disp(N1)
disp('Shear modulus for human femur:')
disp(N2)
disp('Poissons ratio for human femur:')
disp(N3)
H11= 14.1;
H22= 18.4;
H33= 25;
H44= 7;
H55= 6.3;
H66= 5.28;
H12= 6.34;
H13= 4.84;
H23= 6.94;
H=
[H11,H12,H13,0,0,0;H12,H22,H23,0,0,0;H13,H23,H33,0,0,0;0,0,0,H44,0,0;0,0,0,0,H55,0;0,0,0,
0,0,H66];
I= det(H);
J11= (H22*H33-(H23)^2)/I;
J33= (H11*H22-(H12)^2)/I;
J13= (H12*H23-H13*H22)/I;
J44= 1/H44;
J22= (H33*H11-(H13)^2)/I;
J12= (H13*H23-H12*H33)/I;
J23= (H12*H13-H23*H11)/I;
J55= 1/H55;
J66= 1/H66;
J21= J12;
J31= J13;
J32= J23;
J=
[J11,J12,J13,0,0,0;J21,J22,J23,0,0,0;J31,J32,J33,0,0,0;0,0,0,J44,0,0;0,0,0,0,J55,0;0,0,0,0,0,J66];
K1= 1/(J(1,1));
K2= 1/(J(2,2));
K3= 1/(J(3,3));
O23= 1/(J(4,4));
O31= 1/(J(5,5));
O12= 1/(J(6,6));
L11= ((K1/(2*O12)))-1;
L12= ((K2/(2*O31)))-1;
L13= ((K3/(2*O23)))-1;
M1= ((K1+K2+K3)/3);
M2= ((O23+O31+O12)/3);
M3= ((L11+L12+L13)/3);
Z=[N2,M2]
disp('Youngs modulus for bovine femur:')
disp(M1)
disp('Shear modulus for bovine femur:')
disp(M2)
disp('Poissons ratio for bovine femur:')
disp(M3)

ax1= subplot(2,1,1);
bar(ax1,Z,0.5)

clear
return

Quiz 1

Introduction
This program computes for the Shear modulus, Young’s modulus and Poisson’s ratio of
the posterior, anterior, medial and lateral. This program will also show the values in graph form.

Abstract
In materials science, shear modulus or modulus of rigidity, denoted by G, or
sometimes S or μ, is defined as the ratio of shear stress to the shear strain.
An elastic modulus or Young’s modulus is a number that measures an object or
substance's resistance to being deformed elastically when a stress is applied to it. The elastic
modulus of an object is defined as the slope of its stress–strain curve in the elastic deformation
region. A stiffer material will have a higher elastic modulus.

Methodology
c11= 8.7;
c22= 20.4;
c33= 28.6;
c44= 6.73;
c55= 5.55;
c66= 4.34;
c12= 11.2;
c13= 11.2;
c23= 10.4;
c=
[c11,c12,c13,0,0,0;c12,c22,c23,0,0,0;c13,c23,c33,0,0,0;0,0,0,c44,0,0;0,0,0,0,c55,0;0,0,0,0,0,c66]
;
x= det(c);
a11= (c22*c33-(c23)^2)/x;
a33= (c11*c22-(c12)^2)/x;
a13= (c12*c23-c13*c22)/x;
a44= 1/c44;
a22= (c33*c11-(c13)^2)/x;
a12= (c13*c23-c12*c33)/x;
a23= (c12*c13-c23*c11)/x;
a55= 1/c55;
a66= 1/c66;
a21= a12;
a31= a13;
a32= a23;
a=
[a11,a12,a13,0,0,0;a21,a22,a23,0,0,0;a31,a32,a33,0,0,0;0,0,0,a44,0,0;0,0,0,0,a55,0;0,0,0,0,0,a66]
;
y1= 1/(a(1,1));
y2= 1/(a(2,2));
y3= 1/(a(3,3));
s23= 1/(a(4,4));
s31= 1/(a(5,5));
s12= 1/(a(6,6));
v11= ((y1/(2*s12)))-1;
v12= ((y2/(2*s31)))-1;
v13= ((y3/(2*s23)))-1;
n1= ((y1+y2+y3)/3);
n2= ((s23+s31+s12)/3);
n3= ((v11+v12+v13)/3);

h11= 20.9;
h22= 22.3;
h33= 30.1;
h44= 6.45;
h55= 6.04;
h66= 4.87;
h12= 11.2;
h13= 11.2;
h23= 11.5;
h=
[h11,h12,h13,0,0,0;h12,h22,h23,0,0,0;h13,h23,h33,0,0,0;0,0,0,h44,0,0;0,0,0,0,h55,0;0,0,0,0,0,h6
6];
i= det(h);
j11= (h22*h33-(h23)^2)/i;
j33= (h11*h22-(h12)^2)/i;
j13= (h12*h23-h13*h22)/i;
j44= 1/h44;
j22= (h33*h11-(h13)^2)/i;
j12= (h13*h23-h12*h33)/i;
j23= (h12*h13-h23*h11)/i;
j55= 1/h55;
j66= 1/h66;
j21= j12;
j31= j13;
j32= j23;
j= [j11,j12,j13,0,0,0;j21,j22,j23,0,0,0;j31,j32,j33,0,0,0;0,0,0,j44,0,0;0,0,0,0,j55,0;0,0,0,0,0,j66];
k1= 1/(j(1,1));
k2= 1/(j(2,2));
k3= 1/(j(3,3));
o23= 1/(j(4,4));
o31= 1/(j(5,5));
o12= 1/(j(6,6));
l11= ((k1/(2*o12)))-1;
l12= ((k2/(2*o31)))-1;
l13= ((k3/(2*o23)))-1;
m1= ((k1+k2+k3)/3);
m2= ((o23+o31+o12)/3);
m3= ((l11+l12+l13)/3);

C11= 20.6;
C22= 22;
C33= 30.5;
C44= 6.28;
C55= 5.68;
C66= 4.63;
C12= 10.8;
C13= 11.7;
C23= 11.8;
C=
[C11,C12,C13,0,0,0;C12,C22,C23,0,0,0;C13,C23,C33,0,0,0;0,0,0,C44,0,0;0,0,0,0,C55,0;0,0,0,0,
0,C66];
X= det(C);
A11= (C22*C33-(C23)^2)/X;
A33= (C11*C22-(C12)^2)/X;
A13= (C12*C23-C13*C22)/X;
A44= 1/C44;
A22= (C33*C11-(C13)^2)/X;
A12= (C13*C23-C12*C33)/X;
A23= (C12*C13-C23*C11)/X;
A55= 1/C55;
A66= 1/C66;
A21= A12;
A31= A13;
A32= A23;
A=
[A11,A12,A13,0,0,0;A21,A22,A23,0,0,0;A31,A32,A33,0,0,0;0,0,0,A44,0,0;0,0,0,0,A55,0;0,0,0,
0,0,A66];
Y1= 1/(A(1,1));
Y2= 1/(A(2,2));
Y3= 1/(A(3,3));
S23= 1/(A(4,4));
S31= 1/(A(5,5));
S12= 1/(A(6,6));
V11= ((Y1/(2*S12)))-1;
V12= ((Y2/(2*S31)))-1;
V13= ((Y3/(2*S23)))-1;
N1= ((Y1+Y2+Y3)/3);
N2= ((S23+S31+S12)/3);
N3= ((V11+V12+V13)/3);

m=[s23 s31 s12 n2; o23 o31 o12 m2; S23 S31 S12 N2];
bar(m)
set(gca,'xticklabel',{'Anterior','Medial','Lateral'})
clear
return

Midterms
Introduction
This program will solve for the values of Y1, Y2, Y3 (Young’s modulus) and S23, S31
and S12 (Shear modulus) and put them in a line graph.

Abstract
In materials science, shear modulus or modulus of rigidity, denoted by G, or
sometimes S or μ, is defined as the ratio of shear stress to the shear strain.
An elastic modulus or Young’s modulus is a number that measures an object or
substance's resistance to being deformed elastically when a stress is applied to it. The elastic
modulus of an object is defined as the slope of its stress–strain curve in the elastic deformation
region. A stiffer material will have a higher elastic modulus.

Methodology
C11= 20;
C22= 21.7;
C33= 30;
C44= 6.56;
C55= 5.85;
C66= 4.74;
C12= 10.9;
C13= 11.5;
C23= 11.5;
C=
[C11,C12,C13,0,0,0;C12,C22,C23,0,0,0;C13,C23,C33,0,0,0;0,0,0,C44,0,0;0,0,0,0,C55,0;0,0,0,0,
0,C66];
X= det(C);
A11= (C22*C33-(C23)^2)/X;
A33= (C11*C22-(C12)^2)/X;
A13= (C12*C23-C13*C22)/X;
A44= 1/C44;
A22= (C33*C11-(C13)^2)/X;
A12= (C13*C23-C12*C33)/X;
A23= (C12*C13-C23*C11)/X;
A55= 1/C55;
A66= 1/C66;
A21= A12;
A31= A13;
A32= A23;
A=
[A11,A12,A13,0,0,0;A21,A22,A23,0,0,0;A31,A32,A33,0,0,0;0,0,0,A44,0,0;0,0,0,0,A55,0;0,0,0,
0,0,A66];
Y1= 1/(A(1,1));
Y2= 1/(A(2,2));
Y3= 1/(A(3,3));
S23= 1/(A(4,4));
S31= 1/(A(5,5));
S12= 1/(A(6,6));
V11= ((Y1/(2*S12)))-1;
V12= ((Y2/(2*S31)))-1;
V13= ((Y3/(2*S23)))-1;
x1 = linspace(Y1,Y2,Y3);
x2 = linspace(S23,S31,S12);
y1 = sin(x1)
y2 = cos(x2)
plot(x1,y1,x2,y2)

clear
return
Seatwork 4
Introduction
This program will show the graph of electric field using Coulomb’s constant. It will also
show the direction of the electrical charges.

Abstract
An electric field is a force field that surrounds electric charges that attracts or repels other
electric charges. Mathematically the electric field is a vector field that associates to each point in
space the force, called the Coulomb force, that would be experienced per unit of charge, by an
infinitesimal test charge at that point. The units of the electric field in the SI system
are newton per coulomb or volts per meter.

Methodology
k = 8.987E9;
p = [2,2];
Q = [1];
[a,b] = meshgrid(0:0.05:4);

c = zeros(size(a));
for ii = 1:numel(Q)
c = c + k * Q(ii) ./ hypot(p(ii,1)-a, p(ii,2)-b);
end

hContour = contourf(a,b,c);
hColorbar = colorbar;
ylabel(hColorbar,'Electric potential')
[Ea,Eb] = gradient(c);
validColumns = all(isfinite(Ea) & isfinite(Eb));
hold on
hLines =
streamslice(a(:,validColumns),b(:,validColumns),Ea(:,validColumns),Eb(:,validColumns));
set(hLines,'Color','r');

clear
return

You might also like