[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scalars and Matrices:
From: |
A. Scottedward Hodel |
Subject: |
Re: Scalars and Matrices: |
Date: |
Tue, 12 Oct 1999 14:49:53 -0500 |
----------
>From: "John W. Eaton" <address@hidden>
>To: "A. Scottedward Hodel" <address@hidden>
>Cc: "help-octave" <address@hidden>
>Subject: FW: Scalars and Matrices:
>Date: Tue, Oct 12, 1999, 2:09 PM
>
[munch]
> Would anyone really like to have the option of not performing the type
> conversions and having an expression like the above result in an error?
>
> Would anyone really prefer to have dot products result in matrix
> objects instead of scalar objects?
>
> jwe
Not I! Part of the pleasure in using Octave is the (nearly complete) lack
of type declaration supported by a good suite of automated type conversion
codes. (Further, I wouldn't want to rewrite the Octave code I'm supporting,
which makes regular use of the 1x1 matrix = scalar feature.)
On the other hand, one of the first times I taught a graduate course on
state space control, I asked the class to find a stabilizing state feedback
u = - K*x
for the system
A = [0, 1; 1, 2];
B = [0 ; 1];
(d/dt) x = A x + B u
and give me the closed-loop matrix A - B*K. One student, having heard of
the lqr function, computed an "optimal" gain matrix K, and then computed the
closed loop A matrix as A_closed = A - K*B. Since K*B is a scalar here,
he generated an A_closed that was clearly wrong by inspection (computed
without a warning message!), and gave me a topic for discussion in
subsequent offerings of the course.
Of course, I must emphasize that the problem in this case was the user, not
the package (Octave). Since the two must operate in partnership, I thought
it appropriate to add some discussion on the topic.
"And that's about all I've got to say about that."
--- Forest Gump
--
A S Hodel Assoc. Prof. Dept Elect Eng, Auburn Univ,AL 36849-5201
On leave at NASA Marshall Space Flight Center (256) 544-1426
Address until 31 July 2000:Mail Code TD-55, MSFC, Alabama, 35812
http://www.eng.auburn.edu/~scotte
---------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL. To ensure
that development continues, see www.che.wisc.edu/octave/giftform.html
Instructions for unsubscribing: www.che.wisc.edu/octave/archive.html
---------------------------------------------------------------------