Hi Class!
Welcome to ECE105 Class! In this class:
You will learn to use MATLAB to solve Math & Engineering problems.
Some of you already had my ECE103 class, you are going to find out the first 4 assignments are reviews; however, I add additional assignments to give you additional practice. After that, each week we are going to apply MATLAB to different applications, there are total of 10 applications.
The most important thing to do the first week is to meet your classmates & form a team of 2.
For Hybrid class: on the first day of class, I will make time for you to chat with each others & form a team of 2, do seating assignments in the class room. It is important to reach out to your classmate, because I treat each assignment like a test, as an instructor, I will not help you to find the solution for the test; however, you can reach out to your classmate, chat & compare notes, just no copy & paste.
(Note: some of you like to go SOLO, it is OK. However, when you go SOLO, you are really on your own; if you need help, I am going to ask you to reach out to your classmate).
Assignments are due every Friday by 11:59pm. Each assignment will be posted at least 1 weeks in advance. So, your strategy is to stay on top of schedule, never fall behind. If you are ahead of schedule, you have plenty of time to work out the problems, you are going "Down Hill"; if you are behind schedule, you don't have time and therefore rushing, you are going "Uphill". Believe it or not, going "Down Hill" is much easier than going "Uphill"!
I have dedicated this website for our class. It has all detailed instructions and rubric for each assignment for this class including all the resources that you need to complete your tasks.
Enjoy the class!
Coach
Class #21095 (Hybrid) : Thu 3:00pm - 3:50pm @ T1-112
_________________________________________________
___________________________________________________
Post 8/28, due on the first day of class (8/28)
(Note: You must complete the Syllabus Quiz on the first day of class or you be dropped from the class as "NO SHOW"
__________________________
Murphy's law:
Email never has a time delay until you submit it on Friday evening!
Then there will be a time delay, I may not receive it until Saturday morning and your assignment will be counted as late!
Solution:
option a: provide the screenshot of when the assignment was sent, I will credit your assignment as "On time".
option b: submit on Thursday evening!
________________________________________
Install MATLAB
Maricopa Community College District has acquired a Campus-Wide License to MATLAB, Simulink, and over 100 additional toolboxes. Students and faculty are covered by the Campus-Wide License and can install software on their home or laptop computers.
New MCCCD portal URL: https://www.mathworks.com/academia/tah-portal/maricopa-community-college-system-31495938.html
Access instructions:
1. Go to Maricopa Community College System’s MATLAB Portal to download the software.
§ If you have MATLAB installed on your Maricopa owned devices, no installation changes are needed.
§ Existing Mathworks accounts will be transitioned from GCC's instance to MCCCDs instance before the GCC MATLAB account is retired.
2. Click “Sign in to get started” under the Get MATLAB and Simulink section.
3. If you have not done so already, you will be asked to create a MathWorks account. Once registered, you will be associated to our MATLAB license and will be able to:
§ Download and activate software on your personal computer
§ Start using MATLAB Online from a web browser
For additional training, please view free online courses that can also be found on Maricopa Community College System’s MATLAB Portal under “Learn to Use MATLAB and Simulink.”
If you have trouble installing MATLAB, go to the MATLAB Portal and click “Need Installation Help” to get support.
PLEASE NOTE:
For the other existing MATLAB portals within Maricopa Community Colleges (Mesa Community College, Chandler-Gilbert, Paradise Valley, and Glendale Community College): These portals will no longer be available by the end of the calendar year. There are notices on these portals referring existing users to Maricopa Community College’s portal listed above. Moving forward, all users should transition to using the portal above to access MATLAB after the end of the current Fall 2023 semester.
Once installed, to access MATLAB Online, use web browser: https://matlab.mathworks.com/
(see links to assignments below)
(Experiment only, report not required)
________________________________________________
_____________________________________________________
____________________
______________________________________
________________________________________________
(Optional) Additional Practice #1 ( No report required)
Create an M-File(Script) to calculate the Acceleration of a Spacecraft Voyager 1
Run your script, compare notes with "Spoiler/Solution"
Physics:
Force: F = ma (m: mass, a:acceleration)
Work: W = F * d (F: force, d= distance)
Power = W/t (W: work, t: time)
Power = F * d/t = F*v = m*a*v (v: velocity)
Given:
mass = 721.9 kg
Power = 335 Watts
Velocity = 16,650 m/s
Calculate:
Acceleration (unit in m/s^2)
_____________________________________________________________
____________________________________________________
__________________________________________
____________________
_______________________________________
_______________________________
_______________________________
__________________________________________
Practice Complex number: basic operations (link to script)
____________________
Solutions / Missile Guidance using MATLAB (text)
% function: poly(x)
function output = poly(x)
disp('x=')
disp(x)
output = 3*x^3 + 5*x^2 - 2*x + 1;
end
% using function: poly(x)
clear;
clc;
a= 4;
poly(a)
% using function: poly(x) with multiple inputs
clear;
clc;
for a= [1,2,3,4]
poly(a)
end
_________________________________________________________________
% if_statement_example_01
clear
clc
disp('Example 01: using if statement')
disp('Calculate q= a/b')
a= 4
b= 0
if(b~=0) % ~= means NOT equal
q=a/b
end%note: if... end always goes in pair
if(b==0) % note: to compare, must use 2 equal sign"=="
disp('Hey! I do NOT like divide by 0, use other non-zero number')
end
% if_statement_example_02_tennis
clear
clc
disp('Tennis Strategy:')
for zone = [1,2,3,4]
disp('zone=')
disp(zone)
if(zone==1)
disp('Approach backhand slice down the line, ready for volley')
end
if(zone==2)
disp('Approach forehand slice down the line, ready for volley')
end
if(zone==3)
disp('Backhand topspin')
end
if(zone==4)
disp('Forehand topspin')
end
end % for loop
_________________________________________________
% logic_not.m
% experiment: logic NOT (inverter)
clc
for a=[0,1]
disp('if input a=')
disp(a)
disp('The output of NOT logic is:')
y=~a % ~ means NOT
end
% logic_and.m
% experiment: logic and
clc
for a=[0,1]
for b=[0,1]
disp('if input a=')
disp(a)
disp('if input b=')
disp(b)
disp('The output of AND logic is:')
y= a & b
end
end
% logic_or.m
% experiment: logic and
clc
for a=[0,1]
for b=[0,1]
disp('if input a=')
disp(a)
disp('if input b=')
disp(b)
disp('The output of AND logic is:')
y= a | b % | means or
end
end
% logic_xor.m
% experiment: logic xor (exclusive or)
clc
for a=[0,1]
for b=[0,1]
disp('if input a=')
disp(a)
disp('if input b=')
disp(b)
disp('The output of AND logic is:')
y= xor(a,b) % xor means exclusive or
end
end
% logic_dating_game.m
% experiment with logical operations
clc
disp('inputs:')
susan = 0
lisa = 1
ticket = 1
disp('outputs')
date=xor(susan,lisa)
dinner = date
concert = ticket & date
movie = ~date
___________________________________________________________________
Solutions / Assignment #10 (posted after due date)
Given:
Eiffel Tower: height = 300 m
acceleration due to gravity: g= 9.806 m/(s^2)
At the top of Eiffel Tower, we release a bowling ball.
(1) Find time it takes to hit the ground: tHit = ?
(2) Calculate the speed of Bowling Ball in (m/s) and (mph) with the following time interval 0.1*tHit
range (0 : 0.1*tHit : tHit)
(3) Top graph: Speed of Bowling Ball in (m/s)
(4) Bottom graph: Speed of Bowling Ball in (mph)
___________________________
Physics:
h = 0.5 * g * (tHit ^2)
tHit = sqrt(2 * h / g)
Speed: v= g*t (m/s)
v_mph = v * 2.23694 (mph) (Note: 1 m/s = 2.23694 (mph)
_____________________________
low Earth orbit (LEO), medium Earth orbit (MEO), or geostationary orbit (GEO).
Low Earth Orbit (LEO):
Satellites in LEO, like those used for communications or Earth observation, travel at high speeds and complete an orbit in about 90 minutes.
Medium Earth Orbit (MEO):
Satellites in MEO, such as those used for GPS navigation, have a longer orbital period than LEO satellites.
Geostationary Orbit (GEO):
Satellites in GEO, like those used for weather satellites or television broadcasting, appear to stay in the same position relative to Earth because they orbit at the same speed as the Earth's rotation.
% sat_orb_speed_vs_altitude.m
clc
h_km = 40000 % unit : km
h = h_km *1000 % unit : m
Re= 6370000 % unit: m
GMe=3.99*10^14 % unit: m^3/s^2
v=sqrt(GMe/(h+Re))
v_km_per_s = v/1000 % unit: km
v_mph = v * 2.23694 % unit: mph
v_mach = v_mph/768 % unit: Mach, 1 Mach = 768 mph
_______________________________________________________________
Solutions / Assignment #12
% bullet_speed_vs_height
clc
disp('4/16/2024 ECE105 / Usane Bolt')
% given:
g=9.806
m1=0.01 % unit: kg
m2=150 % unit: kg
h1 = 1 % unit: m
for h2=[0.7, 0.6, 0.5,0.4]
disp('----------------')
disp('h2=')
disp(h2)
v1=sqrt((2/m1)*(m1+m2)*g*(h1-h2)); % unit: m/s
v1_mph = v1*2.23694 % unit: mph
v1_mach = v1_mph / 768 % unit: mach #
end
Solutions / Assignment #13
Review Physics & Math for Projectile
% SPOILER: projectile distance vs angle: example @ theta = 10 degree
clc
disp('4/23/2024 ECE105 / Usane Bolt')
% given:
g= -9.806; % unit: m/s^2
v0_mph=200 % unit mph
v0= v0_mph/2.23694 ; % unit: m/s
theta = 10 % unit: degree
vx0= v0*cosd(theta) % unit: m/s
vy0= v0*sind(theta) % unit: m/s
vx=vx0; % note: vx is constant, no influence from gravity
% At landing, t= t_land, y=0
% note: y= 0.5 * g*t^2 + vy0*t = t(0.5*g*t + vy0)
t_land = -2* vy0/g
x_land= vx* t_land % unit: m
***
No report is required
Solution provided by ChatGPT
https://chatgpt.com/share/68337ebb-4d20-800b-bd50-11a865e64d18
Course Evaluation
Section #21095
Link: https://forms.gle/7ukL3CM7KAqafUVP6
_______________________________________________________________
(Featuring: Thea / CSC120 / Fall2019)