help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multiplying Basis Sets by Eigenfunctions


From: Thomas Markovich
Subject: Multiplying Basis Sets by Eigenfunctions
Date: Sun, 5 Oct 2008 14:00:55 -0500

Hi,

Currently I have a problem for which, after reading all the literature I could find, has no apparently solution.

Basically, I am trying to multiply my basis set of functions by my matrix of eigenvectors to give me eigenfunctions.

What this looks like is, lets say that I have a set for n=2, I have a row vector of

[e^-2*i*x, e^-ix, e^0, e^ix, e^2ix] and I would need to multiply this by a matrix of eigenvectors to give me a column vector of eigenfunctions. Unfortunately, all I can come up with is to do this by hand. Here is what I have tried in Octave.
For n = 5, I do

[EVECT,EIG] = eig(a)
EVECT = (numbers are unimportant, all that matters is that its a 11x11 matrix)

octave-3.0.2:3> BasisSet = [sin(-5.*x),sin(-4.*x),sin(-3.*x),sin(-2.*x),sin(- x),sin(0),sin(x),sin(2.*x),sin(3.*x),sin(4.*x),sin(5.*x)]
error: `x' undefined near line 3 column 21
error: evaluating binary operator `.*' near line 3, column 19
error: evaluating argument list element number 1
error: evaluating assignment expression near line 3, column 10
octave-3.0.2:3> x = [-pi,pi];
octave-3.0.2:4> x = [-pi,pi]
x =

  -3.1416   3.1416

octave-3.0.2:5> BasisSet = [sin(-5.*x),sin(-4.*x),sin(-3.*x),sin(-2.*x),sin(- x),sin(0),sin(x),sin(2.*x),sin(3.*x),sin(4.*x),sin(5.*x)]
BasisSet =

 Columns 1 through 11:

6.1232e-16 -6.1232e-16 -4.8986e-16 4.8986e-16 3.6739e-16 -3.6739e-16 -2.4493e-16 2.4493e-16 1.2246e-16 -1.2246e-16 0.0000e+00

 Columns 12 through 21:

-1.2246e-16 1.2246e-16 2.4493e-16 -2.4493e-16 -3.6739e-16 3.6739e-16 4.8986e-16 -4.8986e-16 -6.1232e-16 6.1232e-16

octave-3.0.2:7> BasisSet * EVECT
error: operator *: nonconformant arguments (op1 is 1x21, op2 is 11x11)
error: evaluating binary operator `*' near line 7, column 10
octave-3.0.2:7> BasisSet .* EVECT
error: product: nonconformant arguments (op1 is 1x21, op2 is 11x11)
error: evaluating binary operator `.*' near line 7, column 10


From here, I have no clue where to go. I am honestly not even sure if octave can do what I need it to do. Anyways, any help in any fashion is much appreciated.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]