A bit of MATLAB, a bit of linear algebra

Click For Summary
SUMMARY

The discussion focuses on numerical methods in MATLAB, specifically regarding the computation of polynomial vectors P and Q derived from the functions P(x) = (3/2)x² - 1/2 and Q(x) = (5/2)x³ - (3/2)x. The user computes the sums of the squares of P, the product of P and Q, and the squares of Q using MATLAB commands, yielding results of 201.0020, -2.4425e-015, and 143.8611 respectively. The key linear algebra operation identified is the dot product, which indicates that vectors P and Q are perpendicular due to the zero result of their dot product.

PREREQUISITES
  • Familiarity with MATLAB programming (version not specified)
  • Understanding of polynomial functions and their representation
  • Basic knowledge of linear algebra concepts, particularly dot products
  • Experience with numerical methods and vector operations
NEXT STEPS
  • Study MATLAB's vector operations and element-wise multiplication
  • Learn about polynomial interpolation and fitting in MATLAB
  • Explore the concept of dot products in linear algebra
  • Investigate numerical methods for solving linear systems
USEFUL FOR

Students and professionals in mathematics, engineering, and data science who are working with numerical methods, MATLAB programming, and linear algebra concepts.

Kouheikun
Messages
2
Reaction score
0
I'm taking a course on numerical methods using MATLAB, and right now we're discussing linear systems. This is the question I was given.

P(x) = (3/2)x^2 - 1/2
Q(x) = (5/2)x^3 - (3/2)x

Compute vectors P and Q using the following MATLAB commands.

X = -1:1/500:1;
N = length(X);
P = p(1)*X.^2 + p(2)*X + p(3)*1;
Q = q(1)*X.^3 + q(2)*X.^2 + q(3)*X + q(4);

Where p and q are the coefficient vectors of the polynomials P(x) and Q(x).

Compute and give the numerical result for:

(The sum from i=1 to N) of (Pi Pi)
(The sum from i=1 to N) of (Pi Qi)
(The sum from i=1 to N) of (Qi Qi)

What linear algebra operation is this? Express your answer in vector notation.

Based on the results of the above summations, what can we infer about P and Q and why?


I'm fine all the way up to the linear algebra questions.

I understand that X is a vector containing 1001 evenly spaced numbers between -1 and 1, and so vectors P and Q are vectors containing 1001 values of the functions P(x) and Q(x) respectively within the range x=-1 to x=1.

As for the summations, I'm using sum(P.*P) and the like to get these three sums (in order):
201.0020
-2.4425e-015
143.8611

So what linear algebra operation is this? I first thought of integration, since it's a summation of a function across a range of x values, but that's not linear algebra. I don't ever recall individual squaring the entries of a vector in first year lin alg. The statement "express your answer in vector notation" suggests that the three sums make up a notable 3x1 vector, but again, I'm completely at a loss.

Did I do the summation wrong, or do I just need to brush up on linear algebra? Help!
 
Physics news on Phys.org
If P and Q were 3 dimensional vectors living in x-y-z space, such that P = [Px Py Pz] and Q = [Qx Qy Qz], then sum(Pi*Qi) = PxQx + PyQy + PzQz

Does that look like any linear algebra operation that you know?

Kouheikun said:
As for the summations, I'm using sum(P.*P) and the like to get these three sums (in order):
201.0020
-2.4425e-015
143.8611

This says that P is not zero and Q is not zero, but this operation on P and Q is zero. When you figure out the operation, the fact that sum(Pi*Qi) gives zero should tell you something about those two vectors.
 
The dot product! And if the dot product is zero then the vectors are perpendicular.

Awesome thanks!
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
48
Views
6K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 8 ·
Replies
8
Views
3K