Mathematics desk | ||
---|---|---|
< October 11 | << Sep | October | Nov >> | October 13 > |
Welcome to the Wikipedia Mathematics Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
I am looking for a good way to multiply matrices of functions, or matrices of arrays in Matlab. The description of my problem is as follows:
(In the following, uppercase letters denote matrices and lowercase letters denote scalars.)
I want to find Z = A(x)*B(x) where,
A(x) = [a11(x), a12(x), ..... , a1n(x); a21(x), a22(x), ....., a2n(x); ..............................; an1(x), an2(x), ....., ann(x)];
B(x) = [b11(x), b12(x), ..... , b1n(x); b21(x), b22(x), ....., b2n(x); ..............................; bn1(x), bn2(x), ....., bnn(x)];
Here, (.)(x) means (.) is a function of x.
For example, the first element of Z would be
z11(x) = a11(x)*b11(x) + a12(x)*b21(x) + ... + a1n(x)*bn1(x)
Furthermore, I need to integrate Z(x) from x = a to b to get ZI, which would be a simple nxn matrix.
The functions aij(x) and bij(x) are known numerically, so each one of them is a 1D array (say, of size m).
As an example, consider 2x2 matrices
A = [a11(x), a12(x); a21(x), a22(x);]
B = [b11(x), b12(x); b21(x), b22(x);]
Where,
x = [1,2,3,4,5];
a11(x) = x + 1 = [2 3 4 5 6]
a12(x) = x.^2 = [ 1 4 9 16 25]
a21(x) = x - 1 = [ 0 1 2 3 4]
a22(x) = 1.5*x = [ 1.5000 3.0000 4.5000 6.0000 7.5000]
b11(x) = sin(x) = [ 0.8415 0.9093 0.1411 -0.7568 -0.9589]
b12(x) = cos(x) = [ 0.5403 -0.4161 -0.9900 -0.6536 0.2837]
b21(x) = exp(-x) = [0.3679 0.1353 0.0498 0.0183 0.0067]
b22(x) = [1 1 1 1 1]
Then
Z = A*B = [a11(x)*b11(x) + a12(x)*b21(x), a11(x)*b12(x) + a12(x)*b22(x); a21(x)*b11(x) + a22(x)*b21(x), a21(x)*b12(x) + a22(x)*b22(x)]
That is, the terms of Z are the functions of x, such that for x = [1,2,3,4,5]
z11 = a11.*b11 + a12.*b21 = [2.0508 3.2692 1.0126 -3.4910 -5.5851]
z12 = a11.*b12 + a12.*b22 = [ 2.0806 2.7516 5.0400 12.7318 26.7020]
z21 = a21.*b11 + a22.*b21 = [ 0.5518 1.3153 0.5063 -2.1605 -3.7852]
z22 = a21.*b12 + a22.*b22 = [1.5000 2.5839 2.5200 4.0391 8.6346]
and integral of Z over x = 1 to 5 will be approximately (using trapezoidal rule)
ZI = [-0.9763, 34.9147; -1.9556, 14.2103]
I am looking for a simple way to do this in the general case. It must be possible to do it somehow using a matrix with three indices, but so far I have not been able to come up with a way.
Any help will be *greatly* appreciated. deeptrivia ( talk) 02:53, 12 October 2008 (UTC)
A(1,1,:) = a11; B(1,1,:) = b11; A(2,1,:) = a21; B(2,1,:) = b21; etc...
for k = 1:n Z(:,:,k) = A(:,:,k)*B(:,:,k); end Z = sum(Z*dx,3);
function [varargout] = mtimes(varargin) if nargout == 0 builtin('mtimes', varargin{:}); else [varargout{1:nargout}] = builtin('mtimes', varargin{:}); end
How can I suitably modify this? Thanks, deeptrivia ( talk) 16:49, 12 October 2008 (UTC)
Hello, I am working on a homework problem and I am not necessarily even looking for a hint but it seems to be wrong and I just want to see what others think. It's number 3 from Chapter 5 of Royden's book, 3rd edition. It says
If is continuous on [a, b] and assumes a local maximum at , then .
Any way, the outer two inequalities are immediate, so the inner two are the problem. In case you do not know what a "derivate" is, because it does not seem to be a very common term, the definitions for the two needed ones are
and
So, my problem is this. If there is a local maximum at , then for all , for some . Then, should be negative for close enough to so that should be nonpositive, whereas we are asked to prove it is nonnegative. Similarly, should be positive so that should be nonnegative, whereas we are asked to prove it is nonpositive.
Am I completely missing something here? I'm not looking for a solution. I just want to understand this part. Thanks StatisticsMan ( talk) 03:04, 12 October 2008 (UTC)
Find the coordinates of the stationary points on the graph .
So I differentiated to get And then found the x coordinates to be 0 and 4 and therefore the coordinates are (4, -16) and (0, 16)
However then I have to give the points of intersection with the axes which I dont know how to do. I know the intersection with the y axis from above is (0,16) but how do i get the x intersections.
This is what i tried:
Multiplied out the using the binomial theorem to get:
Is this correct? If so what now? -- RMFan1 ( talk) 12:55, 12 October 2008 (UTC)
Yes I know how you find intersections i just dont know how i can simplify the above. I could also have so that but when I try to solve with the quadratic formula, the discriminant is negative so I cant simplify it. -- RMFan1 ( talk) 13:34, 12 October 2008 (UTC)
Let A be a 3×2 matrix and B a 2×3 matrix. Suppose that
Find BA. Your solution should also show that there is a unique right answer. siℓℓy rabbit ( talk) 15:15, 12 October 2008 (UTC)
I suppose I should give the answer, although I was expecting this to generate somewhat more interest.
Method 1. Note that AB2=6AB. That is ABAB=6AB. Since AB is of rank 2, both A and B are also rank 2, and so A:R2→R3 is injective and B:R3→R2 is surjective. Thus A is cancellable on the left and B is cancellable on the right of ABAB=6AB, and so BA=6I.
Method 2. From ABAB=6AB, we have
Since rank(ATA) = rank(A) = 2 and rank(BBT) = rank(B) = 2, we have
Remark. I seem to recall that there was a way to solve this problem using orthogonality somehow (e.g., the SVD or QR decomposition). I was unable to recall the details for the purposes of this solution, but feel free to add a "Method 3" if you can get this to work. Cheers, siℓℓy rabbit ( talk) 14:36, 13 October 2008 (UTC)
Con you tell be the cost to transport 100 lbs of material in a car that gets 25 mpg / gas @ $3.50 gal. My husband feels that the 'junk' I was to take is worth less than the gas. We will travel 1000 miles. Many Thanks Twinkle2toes ( talk) 21:48, 12 October 2008 (UTC)
Mathematics desk | ||
---|---|---|
< October 11 | << Sep | October | Nov >> | October 13 > |
Welcome to the Wikipedia Mathematics Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
I am looking for a good way to multiply matrices of functions, or matrices of arrays in Matlab. The description of my problem is as follows:
(In the following, uppercase letters denote matrices and lowercase letters denote scalars.)
I want to find Z = A(x)*B(x) where,
A(x) = [a11(x), a12(x), ..... , a1n(x); a21(x), a22(x), ....., a2n(x); ..............................; an1(x), an2(x), ....., ann(x)];
B(x) = [b11(x), b12(x), ..... , b1n(x); b21(x), b22(x), ....., b2n(x); ..............................; bn1(x), bn2(x), ....., bnn(x)];
Here, (.)(x) means (.) is a function of x.
For example, the first element of Z would be
z11(x) = a11(x)*b11(x) + a12(x)*b21(x) + ... + a1n(x)*bn1(x)
Furthermore, I need to integrate Z(x) from x = a to b to get ZI, which would be a simple nxn matrix.
The functions aij(x) and bij(x) are known numerically, so each one of them is a 1D array (say, of size m).
As an example, consider 2x2 matrices
A = [a11(x), a12(x); a21(x), a22(x);]
B = [b11(x), b12(x); b21(x), b22(x);]
Where,
x = [1,2,3,4,5];
a11(x) = x + 1 = [2 3 4 5 6]
a12(x) = x.^2 = [ 1 4 9 16 25]
a21(x) = x - 1 = [ 0 1 2 3 4]
a22(x) = 1.5*x = [ 1.5000 3.0000 4.5000 6.0000 7.5000]
b11(x) = sin(x) = [ 0.8415 0.9093 0.1411 -0.7568 -0.9589]
b12(x) = cos(x) = [ 0.5403 -0.4161 -0.9900 -0.6536 0.2837]
b21(x) = exp(-x) = [0.3679 0.1353 0.0498 0.0183 0.0067]
b22(x) = [1 1 1 1 1]
Then
Z = A*B = [a11(x)*b11(x) + a12(x)*b21(x), a11(x)*b12(x) + a12(x)*b22(x); a21(x)*b11(x) + a22(x)*b21(x), a21(x)*b12(x) + a22(x)*b22(x)]
That is, the terms of Z are the functions of x, such that for x = [1,2,3,4,5]
z11 = a11.*b11 + a12.*b21 = [2.0508 3.2692 1.0126 -3.4910 -5.5851]
z12 = a11.*b12 + a12.*b22 = [ 2.0806 2.7516 5.0400 12.7318 26.7020]
z21 = a21.*b11 + a22.*b21 = [ 0.5518 1.3153 0.5063 -2.1605 -3.7852]
z22 = a21.*b12 + a22.*b22 = [1.5000 2.5839 2.5200 4.0391 8.6346]
and integral of Z over x = 1 to 5 will be approximately (using trapezoidal rule)
ZI = [-0.9763, 34.9147; -1.9556, 14.2103]
I am looking for a simple way to do this in the general case. It must be possible to do it somehow using a matrix with three indices, but so far I have not been able to come up with a way.
Any help will be *greatly* appreciated. deeptrivia ( talk) 02:53, 12 October 2008 (UTC)
A(1,1,:) = a11; B(1,1,:) = b11; A(2,1,:) = a21; B(2,1,:) = b21; etc...
for k = 1:n Z(:,:,k) = A(:,:,k)*B(:,:,k); end Z = sum(Z*dx,3);
function [varargout] = mtimes(varargin) if nargout == 0 builtin('mtimes', varargin{:}); else [varargout{1:nargout}] = builtin('mtimes', varargin{:}); end
How can I suitably modify this? Thanks, deeptrivia ( talk) 16:49, 12 October 2008 (UTC)
Hello, I am working on a homework problem and I am not necessarily even looking for a hint but it seems to be wrong and I just want to see what others think. It's number 3 from Chapter 5 of Royden's book, 3rd edition. It says
If is continuous on [a, b] and assumes a local maximum at , then .
Any way, the outer two inequalities are immediate, so the inner two are the problem. In case you do not know what a "derivate" is, because it does not seem to be a very common term, the definitions for the two needed ones are
and
So, my problem is this. If there is a local maximum at , then for all , for some . Then, should be negative for close enough to so that should be nonpositive, whereas we are asked to prove it is nonnegative. Similarly, should be positive so that should be nonnegative, whereas we are asked to prove it is nonpositive.
Am I completely missing something here? I'm not looking for a solution. I just want to understand this part. Thanks StatisticsMan ( talk) 03:04, 12 October 2008 (UTC)
Find the coordinates of the stationary points on the graph .
So I differentiated to get And then found the x coordinates to be 0 and 4 and therefore the coordinates are (4, -16) and (0, 16)
However then I have to give the points of intersection with the axes which I dont know how to do. I know the intersection with the y axis from above is (0,16) but how do i get the x intersections.
This is what i tried:
Multiplied out the using the binomial theorem to get:
Is this correct? If so what now? -- RMFan1 ( talk) 12:55, 12 October 2008 (UTC)
Yes I know how you find intersections i just dont know how i can simplify the above. I could also have so that but when I try to solve with the quadratic formula, the discriminant is negative so I cant simplify it. -- RMFan1 ( talk) 13:34, 12 October 2008 (UTC)
Let A be a 3×2 matrix and B a 2×3 matrix. Suppose that
Find BA. Your solution should also show that there is a unique right answer. siℓℓy rabbit ( talk) 15:15, 12 October 2008 (UTC)
I suppose I should give the answer, although I was expecting this to generate somewhat more interest.
Method 1. Note that AB2=6AB. That is ABAB=6AB. Since AB is of rank 2, both A and B are also rank 2, and so A:R2→R3 is injective and B:R3→R2 is surjective. Thus A is cancellable on the left and B is cancellable on the right of ABAB=6AB, and so BA=6I.
Method 2. From ABAB=6AB, we have
Since rank(ATA) = rank(A) = 2 and rank(BBT) = rank(B) = 2, we have
Remark. I seem to recall that there was a way to solve this problem using orthogonality somehow (e.g., the SVD or QR decomposition). I was unable to recall the details for the purposes of this solution, but feel free to add a "Method 3" if you can get this to work. Cheers, siℓℓy rabbit ( talk) 14:36, 13 October 2008 (UTC)
Con you tell be the cost to transport 100 lbs of material in a car that gets 25 mpg / gas @ $3.50 gal. My husband feels that the 'junk' I was to take is worth less than the gas. We will travel 1000 miles. Many Thanks Twinkle2toes ( talk) 21:48, 12 October 2008 (UTC)