On Sun, Jun 21, 2009 at 7:07 PM, Bryan Bishop<[email protected]> wrote:
>
> On Sun, Jun 21, 2009 at 7:20 PM, Ondrej Certik<[email protected]> wrote:
>> On Sun, Jun 21, 2009 at 5:43 PM, Bryan Bishop<[email protected]> wrote:
>>> On Sun, Jun 21, 2009 at 6:13 PM, Ondrej Certik<[email protected]> wrote:
>>>> On Sun, Jun 21, 2009 at 4:27 PM, Bryan Bishop<[email protected]> wrote:
>>>>> I'd like to be able to differentiate with respect to a unit (like from
>>>>> physics.units.Unit). But the problem is that physics.units.Unit isn't
>>>>> inheriting from Symbol. I wonder why this is. Was this a design
>>>>> decision? I think I might be able to convert it into a derived class
>>>>> of Symbol, but I was wondering if anyone wanted to yell at me first or
>>>>> offer suggestions or something. :-)
>>>>
>>>> I don't know any reason right now -- just try if it works and if so,
>>>> please send us a patch fixing it and a test.
>>>
>>> Maybe I'll write some unit tests of what the expected functionality
>>> should be, and get back with you.
>>
>> That'd be awesome. I forgot to ask why you need it. :)
>
> I am working on a symbolic equation extraction algorithm in python
> (it's under the name "skdb"). Somewhat related to nodal analysis in
> electric circuit theory, or "linear graph theory", or bond graphs,
> which is used to come up with state equations in mechatronics or other
> multi-domain systems (thus lots of different unit combination
> possibilities). In some cases, components in the system graph provide
> differential equations which need to be manipulated symbolically. So,
> being able to differentiate with respect to a unit would be useful.
> Also retaining all of the functionality of the usual Symbol objects.

I don't understand it much, but why don't you treat everything
symbolically and use units only at the very end of the calculation? It
seems to me, that differentiating with respect to "meters" makes only
sense to recover the "number", e..g

diff(5*meter, meter)  == 5

But that can be easily fixed but enhancing our units module.

Ondrej

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to