How do the op counts get into the tens or hundreds of thousands?

When the expressions are that complicated I would have thought that it
was faster and more numerically accurate to perform whatever symbolic
operations are used to obtain those expressions using numerical
routines. For example if a matrix is inverted symbolically it would be
better to substitute your values and invert the matrix numerically
etc. A 3D rotation can be computed very cheaply in floating point with
quaternions.

--
Oscar

On Tue, 29 Jun 2021 at 12:00, Peter Stahlecker
<peter.stahlec...@gmail.com> wrote:
>
> Dear Jason,
>
> Thanks!
> I tested it right away, and I counted the operations of an entry of rhs = 
> KM.rhs()
>
> For ‚Body‘ I got the count 245,633
> With the auxiliary frames the count was 13,235
>
> Thanks again and stay healthy!
>
> I will keep on testing this.
>
> Peter
>
>
>
>
> On Tue 29. Jun 2021 at 12:32 Jason Moore <moorepa...@gmail.com> wrote:
>>
>> Peter,
>>
>> THey are equivalent other than one may provide a simpler set of direction 
>> cosine matrices and angular velocity definitions. The "Body" method should 
>> give simpler equations of motion in the end because we try to use 
>> pre-simplified forms of the equations. I don't know why you'd see faster 
>> with the intermediate frame method.
>>
>> You can use sympy's count_ops() function to see how many operations each 
>> symbolic form gives. The one with more operations should ultimately be 
>> slower when lambdified().
>>
>> Jason
>> moorepants.info
>> +01 530-601-9791
>>
>>
>> On Tue, Jun 29, 2021 at 5:09 AM Peter Stahlecker 
>> <peter.stahlec...@gmail.com> wrote:
>>>
>>> When I want to do this, it seems to me there are these possibilities:
>>>
>>> 1.
>>> A = N.orientnew(‚A‘, ‚Body‘, [q1, q2, q3], ‚123‘)
>>> This does it in one step
>>>
>>> 2.
>>> I use two intermediate frames and use the word ‚Axis‘ instead of ‚Body‘
>>>
>>> Geometrically, this should be the same, but it seems to me, that with the 
>>> intermediate frames establishing Kane‘s equations, lambdifying them and 
>>> doing the numerical integration is MUCH faster.
>>>
>>> Are methods 1 and 2 not equivalent, as I assumed, or am I doing something 
>>> wrong?
>>>
>>> Thanks for any explanation!
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "sympy" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to sympy+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/sympy/d1597154-f8a8-42fa-b29b-6e8f57062441n%40googlegroups.com.
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "sympy" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sympy+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sympy/CAP7f1AhvTHkfn8_Wc7L9i7em3QvDHn6MPBHoWwqvK9qOUw3QfA%40mail.gmail.com.
>
> --
> Best regards,
>
> Peter Stahlecker
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/CABKqA0bdrLLiCY7w3yG_3sPTmx7O4Z00tn-mLSssj0rvT4m9QA%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxSchAaF6rRig0zL9VF4w3MLyiVra2dZ4vp9vuYDdKyY0w%40mail.gmail.com.

Reply via email to