0% found this document useful (0 votes)
16 views14 pages

Linear Algebra

The document outlines the course structure for ENR 112 - Linear Algebra, detailing the examination scheme, grading rubric, and an introduction to key concepts in linear algebra, including vectors and their operations in MATLAB. It provides objectives for various topics such as vector creation, basic operations, dot products, and vector spaces, along with activities and examples for students to practice. Additionally, it includes assignments to reinforce learning through practical application in MATLAB.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views14 pages

Linear Algebra

The document outlines the course structure for ENR 112 - Linear Algebra, detailing the examination scheme, grading rubric, and an introduction to key concepts in linear algebra, including vectors and their operations in MATLAB. It provides objectives for various topics such as vector creation, basic operations, dot products, and vector spaces, along with activities and examples for students to practice. Additionally, it includes assignments to reinforce learning through practical application in MATLAB.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

ENR 112 – Linear Algebra

Professor Bhawnath Tiwari, Baibhav Gupta & Mitaxi Mehta


Examination Scheme

Lab Assignments:- 60%


End Term:- 40%
Grade Rubric

Grades A A- B+ B B- C+ C D NP
Marks 90-100 80-89 70-79 60-69 50-59 40-49 35-39 30-34 0-29
Range
Linear Algebra

what is Linear Algebra?

Linear
 having to do with lines/planes/etc.
 For example, x + y + 3z = 7, not sin, log, x 2 , etc.

Algebra
 solving equations involving numbers and symbols
 from al-jebr (Arabic), meaning reunion of broken parts
 9 th century Abu Ja’far Muhammad ibn Muso al-Khwarizmi

 Linear algebra is the branch of mathematics that studies vectors, vector spaces, and linear
transformations.
 It helps solve problems involving systems of linear equations and describes geometric
concepts like lines and planes.

| 4
Linear Algebra

Why a whole course?

But these are the easiest kind of equations! I learned how to solve them in 7th grade! Ah, but engineers need to solve lots
of equations in lots of variables

3x1 + 4x2 + 10x3 + 19x4 − 2x5 − 3x6 = 141


7x1 + 2x2 − 13x3 − 7x4 + 21x5 + 8x6 = 2567
−x1 + 9x2 + 3 2 x3 + x4 + 14x5 + 27x6 = 26
1/2 x1 + 4x2 + 10x3 + 11x4 + 2x5 + x6 = −15

Often, it’s enough to know some information about the set of solutions without having to solve the equations at all!

Also, what if one of the coefficients of the xi is itself a parameter— like an unknown real number t?

In real life, the difficult part is often in recognizing that a problem can be solved using linear algebra in the first place: need
conceptual understanding.

| 5
Introduction to
Objective: Understand the basicvectors
concept of vectors and how to represent them in MATLAB.

Concepts:
Definition of a Vector: A vector is an ordered list of numbers representing a point in space, direction, or magnitude.
Array: In MATLAB, an array is a fundamental data type used to store collections of data elements. Arrays in MATLAB can
be multidimensional and are used to perform a wide variety of numerical computations.

Vector Notation in MATLAB

 Row Vector: Horizontal array of elements ; V=[1, 2, 3];


 Column Vector: Vertical array of elements; V=[1; 2; 3];
 Zero vector: A vector with all components zero; V=[0, 0, 0];

MATLAB Examples:

% Creating a row vector


v_row = [1, 2, 3];

% Creating a column vector


v_col = [1; 2; 3];

% Creating a zero vector


v_zero = [0; 0; 0];
v_zero = [0, 0, 0];

Activity:
Have students create their own row and column vectors in MATLAB. | 6
Introduction to Vectors
Creating Vectors
1. Using Square Brackets
v = [1 2 3 4 5]; % Row vector
v = [1; 2; 3; 4; 5]; % Column vector

2. Using Built-In Functions


 linspace: Creates a vector of linearly spaced values
v = linspace(1, 10, 10); % 10 values from 1 to 10

 colon operator: Creates a vector with a specified increment.


v = 1:2:10; % Vector with values 1, 3, 5, 7, 9
Accessing Elements
 Indexing
v = [10 20 30 40];
secondElement = v(2); % 20
 Slicing
subVec = v(2:4); % [20 30 40]

Visualizing Vectors
 Plotting
x = 1:10;
y = 2*x;
plot(x, y); % Plots y = 2*x

Activity:
Have students create their vectors, access specific elements from these vectors, and then plot them using MATLAB.
| 7
Basic Operations with Vectors
Objective: Perform basic vector operations in MATLAB, including addition, subtraction, and scalar multiplication.

Concepts:
Definition of a Vector: A vector is an ordered list of numbers representing a point in space, direction, or magnitude.

Vector Notation in MATLAB

 Vector Addition: u+v;


 Vector Subtraction: u-v;
 Scalar Multiplication: c*v;

MATLAB Examples:
% Define vectors
u = [2, 3];
v = [4, 5];
% Addition
sum_vec = u + v;
% Subtraction
diff_vec = u - v;
% Scalar Multiplication
scalar = 3;
scaled_vec = scalar * u;

Activity:
Provide a set of vectors and scalars for students to perform addition, subtraction, and scalar multiplication in MATLAB.

| 8
Dot Product and Its Applications
Objective: Calculate the dot product of vectors and understand its geometric meaning using MATLAB.

Concepts:
Dot Product Formula: u⃗ ⋅v⃗ =u1.v1+u2.v2
Geometric Interpretation: Related to the cosine of the angle between vectors.

MATLAB Examples:
% Define vectors
u = [1, 3];
v = [4, -2];

% Dot Product
dot_product = dot(u, v);

% Calculate magnitude of vectors


magnitude_u = norm(u);
magnitude_v = norm(v);

% Angle between vectors


cos_theta = dot_product / (magnitude_u * magnitude_v);
theta = acos(cos_theta); % in radians

Activity:
Students calculate dot products and angles between vectors in MATLAB. Discuss the results and their geometric
interpretations.

| 9
Vector Magnitude and Normalization
Objective: Compute the magnitude of vectors and normalize them using MATLAB.

Concepts:
Magnitude of a Vector:

Normalization: A vector divided by its magnitude.

Geometric Interpretation: Related to the cosine of the angle between vectors.

MATLAB Examples:
% Define vector
v = [3, 4];

% Magnitude
magnitude_v = norm(v);

% Normalization
normalized_v = v / magnitude_v;

Activity:
Have students calculate the magnitude and normalized version of various vectors in MATLAB.

| 10
Vector Spaces and Basis Vectors
Objective: Explore vector spaces and basis vectors in MATLAB.

Concepts:

Vector Space: A collection of vectors where addition and scalar multiplication are defined.
Basis Vectors: A set of vectors that span the space and are linearly independent.
Dimension: The number of vectors in a basis set.

MATLAB Examples:
% Define vectors
v1 = [1; 0];
v2 = [0; 1];

% Check if vectors are linearly independent


A = [v1, v2];
is_independent = rank(A) == size(A, 2); % rank should be equal to number of vectors

% Basis vectors in 2D
basis = [1, 0; 0, 1];

Activity:
Students verify whether given sets of vectors form a basis in MATLAB and determine the dimension of the vector space.

| 11
Assignment-1
Try out the following without the semicolon at the command prompt
a = [1 4 3 2];
 Convert a row vector to column vector
b = a';
 Extract 1st and 2nd element of “a” vector
c = a(1);
d = a(2);
e = a(2:end);
 Find a f = a(-1) vector?
Find sum of all elements of a?
g = sum(a);

Answer try the following using MATLAB?


ar1 = [3 1 4]
ar2 = [1 ; 2]
ar1 + ar2
ar3 = [2 4 9; 1 0 2; 2 1 0]
Try out the following at the command prompt
V=[16 5 9 4 2 11 7 14];
1.Extract the third element.
2.Extract the first, fifth, and sixth Elements?
3.Extract the third through the seventh elements?
4.Extract and Swap the halves of V?
5.Extract the last element?
6.Extract the fifth through the last elements?
7.Extract the second through the next to last elements?
8.Extract all the odd elements?
9.Reverse the order of the element?
10.Replace the second,third and fourth element of V by 10,15
and 20?
11.Replace second and third element by 30
Assignment

1.V(3);
2.V([1 5 6]);
3.V(3:7);
4.V2= V([5:8 1:4]);
5.V(end);
6.V(5:end);
7.V(2:end-1);
8.V(1:2:end);
9.V(end:-1:1);
10.V([2 3 4])=[10 15 20];
11.V([2 3])=30;

You might also like