Wednesday, December 9, 2015

Day 25 - Wrap up - Cluck Cluck Maker

Finished egg incubator, it is called the Cluck Cluck Maker. (Vinthai helped alot)
Here is a picture of the box being made.

Stepper motor before adding the egg
Here is a picture of the box being made.
How the egg will rotate

Here is a picture of the box being made.

The inside before closing and collecting data of CCM
 Here is a picture of the box being made.

Done and collecting data

 Here is a picture of the station.
Collecting station

Here is a picture of the labview code.

Graphical part

Interface part


Conclusion: Done. It's been fun building a box and code that controllers temperature of a box with a fan, heater, relay, stepper motor and DC motor, and labview code. YAY!!!

Day 24 - labview D9 - Everything for the Chicken

We used the following days to integrate all the componets we have been working on for the past weeks to get the egg incbutar project done.
Here is a picture of stepper.
Stepper connected before box


Here is a picture of relay.
Relay and fan before being put in box
Conclusion: Used all previous labview vi's together to get egg incubator project ready.

Day 23 - labview D8 Stepper Motor Part2

We finished up the day with more stepper motor control stuff. We finsihed up getting a real working spin on the stepper motor through Labview.
 Picutre of the relay logic working with switches.

Logic to control Dc motor "fan" with relay logic



Conclusion: Got more stuff done towards the project. Fan, DC motor, stepper motor.

Day 22 - labview D7 Motor Control part2 and Stepper Motors

We finished going over motor control with a real working night rider. We used the night rider program again. We also worked with the fan and temperture in Labview.
Picutre of labview of updated night rider controllering led.
Night rider led running


Conclusion: Learned how to control fan with temperature. Use night rider code as a "stepping" stone for the stepper motor.

Homework:Get stuff to work for project.

Day 21 - labview D6, Digital and Motor Control

We started the day with digital logic and learning how to do binary math.
Picture below.
Example of binary math
We then talked about relays, coils, and what the color wires were to pin layout.

Conclusion: We talked about DC motors, and how relays work. We did some binary math

Homework: Microphone homework, was checked. lost the vi :(


Day 20 - labview D5 Microphone data

We started the dam with an exercie getting microphone data. We had to connect to Labquest mini and create filters and graphs in Labview to get selected range.
Picture below.
Microphone Vi

Conclusion: Learned how to connect microphone to LabQuest mini and create the appropriate labview Vi to read and graph sound data.

Homwork:

Day 19 - labview D4, Debugging and More on Case

We learned how to use debugging features in Labview. We also went over more Case structure stuff.

Conclusion: Went over case structure and learned how to use debugging.Using logic, booliean and following math operations to correctly debug.

Day 18 - labview D3, Data Acquisition

We started the day with installing drivers to connect LABQuest Mini. Once we were able to do we went on to collect data and use/ modify previous labview vi to change collected data to C or F degrees. We worked on case structures as well.
We also worked on a nightrider program, picture below.
Night rider
 Picitre of Case structure.
Case structure with message


Conclusion:
We learned how to use case structures and write night rider program.
Homework:







Thursday, November 12, 2015

Day 17 - labview D2,Homework 16


We started the day with going over the data types in LabView. We then talked about making graphs and conversions in LabView. Followed to SubVi's application.
 Picture of LabView graphs.

PV = nRT activity



Conclusion:
Learn different types of data for each kind of LabView dongle. Booliean, dbl, 32 bit. Each color wire in LabView means a different type of data flow.


Homework: Picture of Homework checked.
HMWK 16, Temperature conversion and graphing

Thursday, November 5, 2015

Day 16 - lab view D1,Homework 15



We started our first LabView day with an intro of all the things LabView could do, basically watched some videos and how and what LabView is. Some things that we did in class were simple math and matlab operations in LabView to see the difference between LabView and Matlab.
Picutre of math done in labview.
Basic Math in LabView


Conclusion:
Learn that LabView is a graphical program to connect, control, and collect data and devices. Very powerful and useful to know.

Homework: Doing math stuff in LabView Q4 checked, Picture below.
HMWK 15 Quadratic in LV







Wednesday, November 4, 2015

Day - 15 Interlation and polyfit, polyval

We started the day with interpolation and went it means. Matlab does this easily with the interp1 command. However there are many types of interpolation like cubic, linear and spline to name a few. We then move onto a  practical example using the thermodynamic properties, here is a picture:
Thermodynamic properties example.
 We then discussed curve fitting and talked about polyfit and polyval. We also talked abut smoothing out the graph to make it look nicer.

Conclusion:
Interpolation is important part of data graphing  since it fills the hole in data. Interpolating beyond data archived is tricky. Polyfit and polyval are good ways of finding the curve fits of data to better represent what is going on.

%% HMWK 15 - 1
y = x.^3+2*x.^2-x+3 %y function
x = [-1:0.2:1] %x length of 11
area = trapz(x,y) %trapz function
area1 = quad('x.^3+2*x.^2-x+3',-1,1) %area of quad
area2 = quadl('x.^3+2*x.^2-x+3',-1,1) %area of quad1
t = [0:1]
%HMWK 15 - 2
syms y(t)   %syms for y function
y(t) = dsolve(diff(y,t) == t^2+y, y(0)==0) %y function solver at t = 0
aa = subs(y(t),'t',[0:1]) %%subs t 0 to 1 for y solved eq
double(aa(2)) %double answers to see
%HMWK 15 - 3
syms u(x)
u(x) = dsolve(diff(u,x,3) == u(x))
aa = subs(u(x),'x',[0:1])
Du = diff(u, x);
D2u = diff(u, x, 2);
u(x) = solve(diff(u, x, 3) == -u/2*u'',u(0) == 0)

Thursday, October 22, 2015

Day 14 - Symbolic Plotting

We started the day learning different types of plotting with ezplot command. We learned other useful ez commands like ezmeh ezsurf and ezplot3 to name a few. We then move onto a ballistic problem again, here is a picture:
The real one for ballistic problem.
We then worked on calculus and integration in matlab. And finished the day with differential  equations examples.
Here are some pictures of examples done in class.




Conclusion:
Today was a day of learning about the ways to plot with the ez command. We then spent the rest of the day seeing how matlab takes cares of some calculus, integration and differential equations.


%%Hmwk 14
v = [1 2 3 4 5 6] %volume
t = [2494 1247 831 623 499 416] %temperture
z = interp1(v,t,3.8)    %interplation of v at 3.8
z1 = interp1(v,t,3.8,'cubic')   %interplation of v at 3.8 cubic
z2 = interp1(t,v,1000)  %interplation of t at 1000 linear
z3 = interp1(t,v,1000,'cubic') %interplation of t at 1000 cubic
%%Hmwk 14-2
plot(v,t)
coef1 = polyfit(v,t,1) %eq for 1 order
coef2 = polyfit(v,t,2) %eq for 2nd order
coef3 = polyfit(v,t,3) %eq for 3rd order
coef4 = polyfit(v,t,4) %eq for 4th order
c1 = polyval(coef1,v)   %polyval of v 1
c2 = polyval(coef2,v)   %polyval of v 2
c3 = polyval(coef3,v)   %polyval of v 3
c4 = polyval(coef4,v)   %polyval of v 4
plot(v,t,'o',v,c1)  %plot w/ 1st order
plot(v,t,'o',v,c2)  %plot w/ 2nd order
plot(v,t,'o',v,c3)  %plot w/ 3rd order
plot(v,t,'o',v,c4)  %plot w/4 order
%% Hmwwk 14-3
n = 1
v = [1 2 3 4 5 6] %volume
P = [2494 1247 831 623 499 416] %temperture
R = 8.314 %R value
k = polyfit(1./v,P,1) %polyfit slop
k2 = polyval(k,1./v) %Polyval uses polfit eq and plus number into
k3 = plot(1./v,k2) %plot of slope
temp = k(1)./R  %temperture close to 300K

Tuesday, October 20, 2015

Day 13 - Symbolic math

 We started the day with structure array example, finishing he one from last class. We then move on to a symbolic algebra example with the use of  𝑘=𝑘𝑜𝑒−𝑄/𝑅𝑇. Here is a picture:
Symbolic example in class.
We then move onto manipulation symbolic expressions. We then move on to a ballistic problem. Here is a picture:
Ballistic problem part 1.

 Conclusion:
We again worked with structure array to get a better understanding. We spent the rest of the time using symbolic math to solve problems. Let matlab do all the hard algebra is a good idea.



%hmwk 13

%hmwk 13-1
format short eng
syms pi f m g L I
eq1 = 2*pi*f == sqrt(m*g*L/I) %eq of penduilum
solve (eq1,'L') %solve for L
%hmwk 13 - 2
syms v0 t th g
dx = sym('v0*t*cos(th)')
dx1 = subs(dx,{v0,th},{100,(pi/4)})
dy = sym('v0*t*sin(th)-.5*g*t^2')
dy1 = subs(dy,{v0,g,th},{100,9.8,(pi/4)})
ezplot(dx1,dy1,[0,20])
title('ballastic distance')
xlabel('distance in meters')
ylabel('height in meters')
t = [0:.5:20]
%% 13 - 3
syms t
h = -0.12*t^4 + 12*t^3 - 380*t^2 + 4100*t +220
v = diff(h) %diff of h = velocity
acc = diff(v) %diff of velocity = accel
ans1 = max(double(solve(h,'t'))) %for real alt
ans2 = max(double(solve(v,'t'))) %for real velocity
ans3 = max(double(solve(acc,'t'))) %for real accleration
subplot(2,2,1)  %plot alt
ezplot(h,[0:48])
title('altitude')
xlabel('time')
ylabel('height in meters')
subplot(2,2,2) %plot speed
ezplot(v,[0:48])
title('velocity')
xlabel('time')
ylabel('speed')
subplot(2,2,3) %plot acc
ezplot(acc,[0:48])
title('acceleration')
xlabel('time')
ylabel('acc')
hmaxt =solve(v,'t')
hmax=real(max(double(subs(h,'t',hmaxt)))) %max height 17000 when third v = 0
%% 13- 4
syms f x n
f = sym(20*x) %force
work = int(f,'0','n-1') %work eq
% work = 10*(n-1 )^ 2
w2 = subs(work,'n','2') %sub in 2 feet for n
w3 = max(double(solve('25 = 10*(n-1)^2'))) %amount streched
%% 13 - 5
syms x tan(x)
y = sym('tan(x)')
y1 = int(y)     %int of tanx
eq1 = matlabFunction(y1) %matlab function
fplot(eq1,[-5,5]) %fplot of a function


Thursday, October 15, 2015

Day - 12 Arrays and different data types

 We started he day with array types in matlab. Then talked about the data types, such as classes for each type. We discussed floating point number, integers and double. Finally went over string and char and then move onto symbolic and logical data. We finished the with creating a structure array with planetary data and called the data in the m-file.
Here are some pictures of examples done in class.

Conclusion:
 We learned of different arrays and different data types. Each matrices type of data have classes. We worked with logical and symbolic functions.


%HMWK 12
%12 - 1
syms x a b c d X %loads variables
ex1 = x^2-1 %
EX1 = sym('x^2 - 1 ')
eq1 = sym(' x^2=1 ')
EQ1 = sym('x^2 = 1 ')
subs(ex1,x,4) %answwer is 15
subs(EX1,x,4) %answer is 15
subs(eq1,x,4) %answer is 16==1
%12 - 2
v = [0:10]
subs(ex1,x,v) %answwer is array
subs(EX1,x,v) %answer is array
subs(eq1,x,v) %answer is [==] exprssion
%12 - 3
ex4 = a*x^2 + b*x + c
EX4 = sym('a*x ^2 + b*x + c ')
eq4 = sym('a*x^2 + b*x + c=0 ')
EQ4 = sym('a*x ^2 + b*x + c = 0 ')
subs(ex4,{'a' 'b' 'c' 'x'},{3 4 5 1:0.5:5}) %answer in fractions
subs(EX4,{'a' 'b' 'c' 'x'},{3 4 5 1:0.5:5}) %answer same as above
subs(eq4,{'a' 'b' 'c' 'x'},{3 4 5 1:0.5:5}) %answer == returns
subs(EQ4,{'a' 'b' 'c' 'x'},{3 4 5 1:0.5:5}) %answer same as above
%12 - 4
%They are symbolic
%12 - 5
syms m g l L f %loads variables
X = sym('f*2*pi = sqrt(m*g*L/l)') %epressed version
solve(X,'L') %solving X for L
%12 - 6
syms mtops mbottoms x %loads variable
water = sym(' 50 = 0.2*mtops + 0.65*mbottoms')    %water
ethanol = sym('-100*x + 0.35*mtops + 0.25*mbottoms')    %ethanol
methanol = sym(' 50 = 100*x + 0.45*mtops + 0.1*mbottoms')     %methanol
[mtops mbottoms x] = solve(water,ethanol,methanol) %answer
k = double([mtops mbottoms x]) %converts symbloic answers into double bytes for fprint
k1 = sprintf(' mass top %3.2f \n mass bottom %3.2f \n percent methanol %3.2f \n',k) %outprint
msgbox(k1) %display box

Tuesday, October 13, 2015

Day - 11 Solving System of Equations


We started the day with working on circuit problem here is a picture:

Solving Simultaneous Equations in an Electric Circuit ex.
We then talked about reduced row echelon function, rref and we can rewrite matrices in that form.
We then did an example of  a material balances desalination unit. Here is a picture:

Material Balances on a Desalination Unit

We then move onto a Force on a Statically Determinate Truss example. Here is picture:

A Force on a Statically Determinate Truss

Lastly we finish the day with special types of matrices like pascal and magic.

Conclusion:
Solving linear algebra systems is easy with matlab. However using which type on method is important, like ref, rref, or other forms like the first example tied in class.

%%HMWK 11
%hmwk 11-1
doublea = 5 - 3i %double complex, 16 bytes
singlea = single(5 - 3i)  %Single complex, 8 bytes
k1 = doublea^100 %double complex raise 100 power
k2 = singlea^100 %single comples raise 100 power
% k1 returns intergers vaules of double complex
% k2 returns -inf and +inf in single complex
% the reason being the scope of single cant handle 100 power byte "weight"
%hmwk 11-2
char(85) %one element
num2str(8)
char(56)
char(53)
%hmwk 11-3
mess = input('words','s') %message input
encode = char(mess+11) %encode message
decode = char(encode-11) %decode message
%hm11-4
k = 1;
response = menu('Would you like to enter planetary data?','yes','no');
while response==1
disp('Remember to enter strings in single quotes')
planetary(k).name = input('Enter a planet names','s');
planetary(k).mass = input('Enter the mass in multiples of earth''s mass: ');
planetary(k).year = input('Enter the length of the planetary year in Earth years: ');
planetary(k).velocity = input('Enter the mean orbital velocity in km/sec: ');
planetary(k)
increment = menu('Was the data correct?','Yes','No');
switch increment
case 1
increment = 1;
case 2
increment = 0;
end
k = k+increment;
response = menu('Would you like to enter more planetary data?','yes','no');
end
plan2 = {planetary.name; planetary.mass; planetary.year; planetary.velocity}
oo = struct2table(planetary) %struct table command

%hmwk 11-5
metal = {'Aluminum' ,'Copper ','Iron ','Molybdenum ','Cobalt ','Vanadium '} %metal names
sy = ['AL', 'Cu', 'Fe', 'Mo', 'Co', 'V'] %element symbolys
atomicn = int8([13 29 26 42 27 23]) %atomic number of elements
atomicw = [26.98 63.55 55.85 95.94 58.93 50.94] %atomic weight of elements
den = single([2.71 8.94 7.87 10.22 8.9 6.0]) %density of each element g/cm
ty = ['FCC','FCC','BCC','BCC','HCP','BCC'] %type of structre per element
super = {metal sy atomicn atomicw den ty} %super cell of 6 different arrays
cell2table(super)
sup1 = [super{1}(4) super{4}(4) super{6}(10:12)] %cell sup1 is forth deep in super cell
sup2 = [super{1}]' %names of elements in metal cell
sup3 = sum(super{4}/length(super{4})) %average atomic weight of forth column