Thread: [Mathlib-develop] Re: Symbolic calculations
Status: Beta
Brought to you by:
st_mueller
From: Stefan M. <st...@he...> - 2003-02-12 18:49:28
|
>>Hi Mark and Stefan! >> >>1) Why don't we put it on a new class on Functions/Calculus package? I have >>free access to some "numerical methods" books at the university, so if you >>need it I'll pass you some hints. > > > What I meant was how to handle cases like derivative( sin(x), x) => cos(x) > or even derivative( UserFunction(x), x) => OtherFunction(x) > > My idea was that the implementation of sin and UserFunction would contain a > method called derivative which would return the correct value. I aggree to add the two methods to the individual functions. But what about complex integration/derivative rules, like the chain rule? e.g.: d/dx of sin(cos(x)) >>2) Do you mean find the factors of a number (15= 3*5) >>If true, this page can help you http://www.alpertron.com.ar/ECM.HTM >>I have tried it with 128 digits on 16 segons!!! > > > Actually I meant finding factors of polynomials > i.e. x^2 + 2*x + 1 => (x+1)^2 > > Though I'll check the link out since the the current implementation of > numerical factorization is pretty slow. Sorry, I've no clue at all. I've never done anything with symbolic stuff. Kind regards, Stefan. -- ------------------------------------ Dr.-Ing. Stefan Mueller email: St...@he... ------------------------------------ |
From: Alejandro T. <ate...@ho...> - 2003-02-15 21:01:03
|
Hi Mark and Stefan!! > > Actually I meant finding factors of polynomials > > i.e. x^2 + 2*x + 1 => (x+1)^2 > > > > Though I'll check the link out since the the current implementation of > > numerical factorization is pretty slow. > Sorry, I've no clue at all. I've never done anything with symbolic > stuff. Me too, but I think we can give us hints to a proper sollution, as we have done before ;-) Finding the roots of polynomials, I have read something about the Tartaglia's triangle, Pascal's or Newton's one, but I don't remeber now. You can see a plenty tutorial about it at http://www.krysstal.com/binomial.html But this works only for binomial power of expressions like (x + y)^z where x,y are integers and z is a natural number. If we want general root finding, including complex roots, we should search a bit more. Regards, Alejandro. |
From: mark <msp...@ya...> - 2003-02-17 08:50:21
|
On Saturday 15 Feb 2003 10:04 pm, Alejandro Torras wrote: > Hi Mark and Stefan!! > > > > Actually I meant finding factors of polynomials > > > i.e. x^2 + 2*x + 1 =3D> (x+1)^2 > > > > > > Though I'll check the link out since the the current implementation= of > > > numerical factorization is pretty slow. > > > > Sorry, I've no clue at all. I've never done anything with symbolic > > stuff. > > Me too, but I think we can give us hints to a proper sollution, as we h= ave > done before ;-) > > Finding the roots of polynomials, I have read something about the > Tartaglia's triangle, Pascal's or Newton's one, but I don't remeber now= =2E > > You can see a plenty tutorial about it at > http://www.krysstal.com/binomial.html > > But this works only for binomial power of expressions like (x + y)^z wh= ere > x,y are integers and z is a natural number. > > If we want general root finding, including complex roots, we should sea= rch > a bit more. > > Regards, > Alejandro. > Well I'm not sure that we need to worry about complex roots to begin with= but=20 it does need to be more general than just binomial expansions. Things lik= e x^3 + 6x^2 + 11x + 6 =3D (x+1)(x+2)(x+3) I wasn't able to find anything on google but there is a section on it in=20 volume 2 of The Art Of Computer Programming. I'll read through that toda= y. Best Regards Mark |
From: mark <msp...@ya...> - 2003-03-05 22:29:49
|
Hi This is an overview of the state of the Symolic section. When an expression containting a symbolic token is evaluated it returns a= =20 symbolic expression. there are three types of SymbolicExpression dependin= g on=20 the type of the operator SymbolicExpression =09ArithmaticSymbolicExpression =09GeometricSymbolicExpression =09ExponentialSymbolicExpression When a function that contains either a SymbolicToken or a SymbolicExpress= ion=20 is evaluated it returns itself. ArithmaticSymbolicExpression stores an ArrayList of the operands and a nu= meric=20 multiplier. So X + Y + Z is stored as a single ArithmaticSymbolicExpressi= on. GeometricSymbolicExpression stores an ArrayList of the numerator and=20 denominator as well as a numeric multiplier. So it can store expressions = like=20 (U*V*W)/(X*Y) ExponentialSymbolicExpression stores the mantissa and exponent. At the moment the following functions work to varying degrees Simplify(exp) Expand(exp) Derivative(exp, deriveBy) Integral(exp, integrateBy) Subst(exp, old, new) The following doesn't work Derivative for expressions of the form U^V Derivatives only work for a small number of functions The output from Derivative can be messy Integrals for expressions of the form U*V, U/V, U^V and fn(U) Factorization still doesn't work at all Despite this I'd suggest removing the code for the meditor library since = it's=20 not being used any more. if there are any queries, comments or suggestions then let me know =20 Best Regards Mark __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com |
From: mark <msp...@ya...> - 2003-02-13 20:45:07
|
On Wednesday 12 Feb 2003 6:55 pm, Stefan Mueller wrote: > >>Hi Mark and Stefan! > >> > >>1) Why don't we put it on a new class on Functions/Calculus package? = I > >> have free access to some "numerical methods" books at the university= , so > >> if you need it I'll pass you some hints. > > > > What I meant was how to handle cases like derivative( sin(x), x) =3D> > > cos(x) or even derivative( UserFunction(x), x) =3D> OtherFunction(x) > > > > My idea was that the implementation of sin and UserFunction would con= tain > > a method called derivative which would return the correct value. > > I aggree to add the two methods to the individual functions. > But what about complex integration/derivative rules, like the chain > rule? > e.g.: d/dx of sin(cos(x)) > IIRC d/dx f(u) =3D d/dx u * d/du f(u)=20 so d/dx sin(cos(x)) =3D -sin(x) * cos(cos(x)) So differentiating chained functions shouldn't be too hard. Though we should probably limit derivatives to functions that take 1=20 parameter. Best Regards Mark |