Discussion:
[Maxima-discuss] dual numbers
Andreas Brusinsky
2015-04-23 17:15:53 UTC
Permalink
So after a while .. two more questions:
 
Yes "dual numbers" are hypercomplex numbers so are there already
some 'hypercomplex' rules in the package's or contrib's?
 
And how could/would I possibly attach 'dual number'-'definitions' to current "realpart(...)" to give the real part of a 'dual number'?
 
And also attach possibly something like "dualpart(expression)" besides "imagpart()"?
 
  Thanks for your many responses.
 
  Andreas
Richard Fateman
2015-04-23 18:39:44 UTC
Permalink
Post by Andreas Brusinsky
Yes "dual numbers" are hypercomplex numbers so are there already
some 'hypercomplex' rules in the package's or contrib's?
And how could/would I possibly attach 'dual number'-'definitions' to current "realpart(...)" to give the real part of a 'dual number'?
You can define a function realpart_of_dual() if you wish.
Or you can redefine realpart. I suggest you start by doing this:

:lisp (setf (symbol-function '$orig_realpart) (symbol-function '$realpart))

You now have access to the original realpart program and can redefine the
function attached to the name realpart.

I don't know how you are planning to represent duals.

For example, realpart_of_dual(d):= realpart(coeff(d,eps,0) );

if a dual number looks like a+eps*b.

It would be much preferable computationally for dual numbers to look
like dual(a,b), in which case

dualp(r):= is( not(atom(r)) and equal(inpart(r,0),dual));

and then your program could say..

realpart(K) := if dualp(K) then args(K)[1] else K

or maybe

realpart(K) := if dualp(K) then orig_realpart(args(K)[1]) else
orig_realpart( K)

dualpart(K):= if dualp(K) then args(K)[2] else 0


It is not necessary to alter the built-in realpart() that is used
by other people.

RJF
Post by Andreas Brusinsky
And also attach possibly something like "dualpart(expression)" besides "imagpart()"?
Thanks for your many responses.
Andreas
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Maxima-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/maxima-discuss
Stavros Macrakis (Σταῦρος Μακράκης)
2015-04-23 20:26:39 UTC
Permalink
It all depends how you're representing them.

If you are using the truncated taylor series approach, the "real part" of a
dual number x+y*%eps+... is simply taylor(ex,%eps,0,0).
Post by Andreas Brusinsky
Yes "dual numbers" are hypercomplex numbers so are there already
some 'hypercomplex' rules in the package's or contrib's?
And how could/would I possibly attach 'dual number'-'definitions' to
current "realpart(...)" to give the real part of a 'dual number'?
And also attach possibly something like "dualpart(expression)" besides "imagpart()"?
Thanks for your many responses.
Andreas
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live
exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual-
event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Maxima-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/maxima-discuss
Andreas Brusinsky
2015-04-23 20:29:50 UTC
Permalink
Thank you for the quick response.
It is not necessary to alter the built-in realpart()  that is used
by other people.
I dont like to messup things nor to annoy many people
but I would like to place the 'new', 'dual' definitions as close to the mechanisms
of complex numbers in maxima as possible due to the the fact that a 'dual number'
is mentioned as beeing very similar to a complex number and has a real part
but no imaginary but a dual part.

Such that maximia simplifications and solving mechanisms possibly
cope with it as best as they can.

I am not a at all a maxima expert.
This is mostly learning for me.

But it seems to me that here are quite
a lot maxima and maxima-lisp experts
that possibly know and inform about proper/adequte

extension.

Greets and Thanks

Loading...