help-octave
[Top][All Lists]
Advanced

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

Re: Symbolic Toolbox


From: Thomas Walter
Subject: Re: Symbolic Toolbox
Date: Thu, 29 Jun 2000 16:44:11 +0200

>>>>> "Ben" == Ben Sapp <address@hidden> writes:

[snip]

    Ben> Well, I would like to do it the "best" way, whatever that may be. :) 
    Ben> Here is what I am currently thinking is best.  However, I am open to
    Ben> suggestions.  I think that if I implement it correctly as .oct files
    Ben> then it should not be very hard to add it into Octave as regular data
    Ben> types and interenal functions.   I would like to do this because if we
    Ben> do not I do not see how I could acomplish the following example with
    Ben> trigonometric functions: (this example is made up and currently you can
    Ben> not do this with my package.)

    Ben> ******************************************
    Ben> octave:5> x = sym("x");
    Ben> octave:6> a = x+sin(x^2);
    Ben> octave:7> differentiate(a,x)
    Ben> ans = 

    Ben> 1+2*x*cos(x^2)
    Ben> octave:8>  
    Ben> ******************************************

    Ben> But,  I do not see how I could do this with out modifying the current
    Ben> Octave implementation of the internal sin function ... does any one
    Ben> else?   Maybe I could change the name slightly like Sin and Cos instead
    Ben> of sin and cos?  Is this a good idea?   

    Ben> I am also a bit unsure of how to implement matrices of symbolic
    Ben> variables.  I could use the matrix class provided in the GiNaC library,
    Ben> but I am a bit concerened that then we would have two types of matrix
    Ben> implementations in Octave.  This seems sub optimal.  Is it possible to
    Ben> use the templates in Octave on your own data types?   I suspect that 
the
    Ben> answer is yes, but it is not clear to me how to do this.   

Hello,
I also tried your interface -- really interesting feature!!!!

I compiled the archive with 'no-rtti' from your site and it works
fine.  The other fails.

An idea to your problem above:
Reading the docs of 'GiNaC' there is a chapter about parsing an
expression from strings.  Maybe you can add a function which accepts a
string and symbols and it creates an expression.  Example:
       x = sym("x");
       a = make_ex("x+sin(x^2)", x);

What do you think?

Bye
Thomas



-- 
Was gibt sieben mal sieben?  Ganz feinen Sand. 8-)

----------------------------------------------
Dipl. Phys. Thomas Walter
Inst. f. Physiklische Chemie II
Egerlandstr. 3                          Tel.: ++9131-85 27326 / 27330
91058 Erlangen, Germany                 email: address@hidden



-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.che.wisc.edu/octave/octave.html
How to fund new projects:  http://www.che.wisc.edu/octave/funding.html
Subscription information:  http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------



reply via email to

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