I'd like to jump in, since I often struggles with those issues. I still suggest to estimate the engineering audience in this list to coordinate a little and maybe just start with a little wiki to cooperate. >From my little experience, I can tell you that SAGE is a wonderful investment for its interfacing capabilities to maxima (as a wonderful CAS, which I always need) and other symbolic manipulation tools like sympy. Moreover, I think that most of the engineering problems can be addressed by taking advantage of numpy/scipy, which provide a huge library of scientific tools. Lately, the integration of numpy arrays into SAGE is also much improved (thanks for this). I still find plotting capabilities limited (and not very interactive), but this is not SAGE's fault. From my investigation, it may seem that Chaco is more well suited to interactivity than matplotlib, but it doesn't seem so easy to integrate into the wonderful notebook. I can also tell that the notebook is VERY handful in a production environment where you can devote a powerful server to put sage, and access it from anywhere into the local network.
> > > 1. ENGINEERING MODE > > Since SAGE is oriented to mathematics, all numbers are considered > > Integer unless otherwise specified (an integer is converted using > > Integer() to SAGE's inner type). This isn't practical for engineers, > > who normally use real numbers. > > Solution: There should be a variable that caused all numbers to be > > converted to RealNumber by default instead of Integer, even if an > > integer was entered. > > You can make this happen as follows: > > sage: RealNumber=float; Integer=float > sage: 2 + 3 > 5.0 > sage: 4/7 > 0.5714285714285714 > > Note that this will screw many things up big-time, e.g., list indexing > is broken: > > sage: v = [1,2,3] > sage: v[2] > --------------------------------------------------------------------------- > TypeError Traceback (most recent call last) > > /Users/was/build/sage-4.5.1/<ipython console> in <module>() > > TypeError: list indices must be integers, not float > I don't think that should anyway be a big deal... I usually use RR() to get the SAGE numerical representation which looks faster to compute with. > > 2. UNITS > > It would be nice to make SAGE capable of handling units and do unit > > conversion. > > Solution: There are already some Python modules that allow the "1 m" > > syntax for a value with units. For some more complex units, I'd use a > > syntax like "9.8 'kg*m/s^2' " (a literal number followed by a string), > > or "9.8 [kg*m/s^2]" (a literal number followed by the units between > > brackets). > > Sage already has extensive support for units. > > sage: kg = units.mass.kilogram; m = units.length.meter; s = units.time.second > sage: a = (9.8 * kg * m / s^2); a > 9.8000000000000007*kilogram*meter/second^2.0 > sage: a.convert(units.mass.gram * m / s^2) > 9800.0*gram*meter/second^2.0 Yeah, thanks for this :) > > > 3. BODE DIAGRAMS > > I didn't find it easy to plot a Bode diagram of a function. The plot() > > function doesn't appear to have a "logarithmic" option, and it doesn't > > look easy to put 2 parallel plots on the same image, one on the upper > > half and another on the lower half. > > Solution: have a bode() function that does all the work (along with > > nyquist() and maybe root_locus()). Extending the options on the plot() > > function would also be nice (at least, add logarithmic_x and > > logarithmic_y options). > > Parallel plots? Do you mean like this: > > sage: graphics_array([plot(sin(x), 0, 3), plot(cos(x),0,3)],2,1) What he refers to is a particular class of plot related to control systems and automation http://en.wikipedia.org/wiki/Bode_plot I have my own implementation which is a very slight modification of this: (many thanks to this guy! :) http://people.ee.ethz.ch/~samuelg/worksheets/Bode_plot.html I also think that not having an interactive plot to work with is very painful to inspect Bode plots, so that may be solved only once HTML5 canvas capabilities are finally integrated within matplotlib (seems to be closer now). > > > 4. MATRIX INPUT > > SAGE lacks an easy way to enter matrices. The easiest one is to do > > something like "matrix([[1,2],[3,4]])", but that's uncomfortable, > > specially for people who are used to Matlab's (or Octave's) "[1 2; 3 > > 4]". > > Solution: My proposed syntax is "[[1,2],[3,4]]m", this is, a literal > > list followed by an "m", as an alias to "matrix([[1,2],[3,4]])". Same > > for "v" (vectors), "c" (complex numbers), maybe "q" (quaternions), > > "p" (polynomials)... > > I think this is pretty easy: > > sage: matrix(2, [1,2, 3,4]) > [1 2] > [3 4] > > I don't like your suggestion to introduce something that isn't valid > Python to enter matrices. Could you please clarify the policy to introduce unacceptable Python syntax in the preparser? I'm very curious. I would like to find a way to conveniently manage other data types (cousteau, I propose numpy arrays) in a shorter form. After all, isn't this: sage: R.<t> = QQ[] invalid Python syntax either? (DISCLAIMER: there is no sarcasm nor criticism at all in this :) ) > > > 5. MATRIX INDEXES > > I had written a long paragraph about how easy is to get slices of > > matrices on Matlab/Octave and how good it would be to implement > > something similar on SAGE with some examples, just to realize that it > > was already implemented. :( > > (some examples: mat[3], mat[1,2], mat[0:3], mat[[3,2,1,0]], mat[:, > > 0]...) > > Moreover, if you use numpy arrays you get extremely powerful and > efficient slicing into n-dimensional arrays. This is very useful, > e.g., when dealing with 3d scientific data. > I strongly agree that numpy arrays are the way to go: they support slicing, and they also support vector manipulation: i.e. 2*(numpy array) gives as a result a numpy array whose elements are doubled, which is much closer to the engineers beloved Matlab-like behavior. > > > 6. TRANSPOSE/CONJUGATE > > If I want to get the transposed of a matrix, I have to write > > "mat.transpose()", while on Matlab it's as easy as "mat' ". Same for > > conjugating complex numbers or transposing+conjugating complex > > matrices. > > Solution: The solutions are to have a .T (or .H, .C...) attribute, or > > to have a custom operator that conjugates and transposes, such as > > "*mat" or "+mat" (the latter might be easier to implement since > > there's already an unary "+" operator in Python that doesn't do > > anything useful). > > Why don't you do this: > > sage: T = lambda x: x.transpose() > sage: A = matrix(3, [1,2, 3,4, 5,6]); A > [1 2] > [3 4] > [5 6] > sage: T(A) > [1 3 5] > [2 4 6] > > Simple, clean and powerful :) I would add to thi On 2 Ago, 22:47, William Stein <wst...@gmail.com> wrote: > On Mon, Aug 2, 2010 at 1:38 PM, cousteau <cousteaulecommand...@gmail.com> > wrote: > > I'm studying engineering, and I'm used to some programs such as > > Matlab, Maple, etc. When I knew about SAGE I found it very powerful, > > simple and well structured, but I quickly found out that it wouldn't > > be very useful in engineering, which is more oriented to numerical > > analysis and simple math operations than to abstract algebra. Although > > I could just use Octave for this, I'd like to be able to use SAGE for > > some engineering-oriented tasks. Here are some proposed features: > > > 1. ENGINEERING MODE > > Since SAGE is oriented to mathematics, all numbers are considered > > Integer unless otherwise specified (an integer is converted using > > Integer() to SAGE's inner type). This isn't practical for engineers, > > who normally use real numbers. > > Solution: There should be a variable that caused all numbers to be > > converted to RealNumber by default instead of Integer, even if an > > integer was entered. > > You can make this happen as follows: > > sage: RealNumber=float; Integer=float > sage: 2 + 3 > 5.0 > sage: 4/7 > 0.5714285714285714 > > Note that this will screw many things up big-time, e.g., list indexing > is broken: > > sage: v = [1,2,3] > sage: v[2] > --------------------------------------------------------------------------- > TypeError Traceback (most recent call last) > > /Users/was/build/sage-4.5.1/<ipython console> in <module>() > > TypeError: list indices must be integers, not float > > > 2. UNITS > > It would be nice to make SAGE capable of handling units and do unit > > conversion. > > Solution: There are already some Python modules that allow the "1 m" > > syntax for a value with units. For some more complex units, I'd use a > > syntax like "9.8 'kg*m/s^2' " (a literal number followed by a string), > > or "9.8 [kg*m/s^2]" (a literal number followed by the units between > > brackets). > > Sage already has extensive support for units. > > sage: kg = units.mass.kilogram; m = units.length.meter; s = units.time.second > sage: a = (9.8 * kg * m / s^2); a > 9.8000000000000007*kilogram*meter/second^2.0 > sage: a.convert(units.mass.gram * m / s^2) > 9800.0*gram*meter/second^2.0 > > > 3. BODE DIAGRAMS > > I didn't find it easy to plot a Bode diagram of a function. The plot() > > function doesn't appear to have a "logarithmic" option, and it doesn't > > look easy to put 2 parallel plots on the same image, one on the upper > > half and another on the lower half. > > Solution: have a bode() function that does all the work (along with > > nyquist() and maybe root_locus()). Extending the options on the plot() > > function would also be nice (at least, add logarithmic_x and > > logarithmic_y options). > > Parallel plots? Do you mean like this: > > sage: graphics_array([plot(sin(x), 0, 3), plot(cos(x),0,3)],2,1) > > > 4. MATRIX INPUT > > SAGE lacks an easy way to enter matrices. The easiest one is to do > > something like "matrix([[1,2],[3,4]])", but that's uncomfortable, > > specially for people who are used to Matlab's (or Octave's) "[1 2; 3 > > 4]". > > Solution: My proposed syntax is "[[1,2],[3,4]]m", this is, a literal > > list followed by an "m", as an alias to "matrix([[1,2],[3,4]])". Same > > for "v" (vectors), "c" (complex numbers), maybe "q" (quaternions), > > "p" (polynomials)... > > I think this is pretty easy: > > sage: matrix(2, [1,2, 3,4]) > [1 2] > [3 4] > > I don't like your suggestion to introduce something that isn't valid > Python to enter matrices. > > > 5. MATRIX INDEXES > > I had written a long paragraph about how easy is to get slices of > > matrices on Matlab/Octave and how good it would be to implement > > something similar on SAGE with some examples, just to realize that it > > was already implemented. :( > > (some examples: mat[3], mat[1,2], mat[0:3], mat[[3,2,1,0]], mat[:, > > 0]...) > > Moreover, if you use numpy arrays you get extremely powerful and > efficient slicing into n-dimensional arrays. This is very useful, > e.g., when dealing with 3d scientific data. > > > > > 6. TRANSPOSE/CONJUGATE > > If I want to get the transposed of a matrix, I have to write > > "mat.transpose()", while on Matlab it's as easy as "mat' ". Same for > > conjugating complex numbers or transposing+conjugating complex > > matrices. > > Solution: The solutions are to have a .T (or .H, .C...) attribute, or > > to have a custom operator that conjugates and transposes, such as > > "*mat" or "+mat" (the latter might be easier to implement since > > there's already an unary "+" operator in Python that doesn't do > > anything useful). > > Why don't you do this: > > sage: T = lambda x: x.transpose() > sage: A = matrix(3, [1,2, 3,4, 5,6]); A > [1 2] > [3 4] > [5 6] > sage: T(A) > [1 3 5] > [2 4 6] > > > > > -- > > To post to this group, send an email to sage-devel@googlegroups.com > > To unsubscribe from this group, send an email to > > sage-devel+unsubscr...@googlegroups.com > > For more options, visit this group > > athttp://groups.google.com/group/sage-devel > > URL:http://www.sagemath.org > > -- > William Stein > Professor of Mathematics > University of Washingtonhttp://wstein.orgs list a different notebook > interface, something like a single file editor, plus an online console... > something like Matlab's IDE :) I'm actually investigating how difficult it > would be using codemirror plugin (already in SAGE); I don't know how to hook > in a new window (from the browser) a SAGE console session which is attached > to the session of the notebook. Can anyone help with this? Maurizio -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org