[sympy] Re: sympy physics mechanics

2022-01-11 Thread Peter Stahlecker
Forget my question above: I DID make a stupid mistake! All works fine! Peter Stahlecker schrieb am Dienstag, 11. Januar 2022 um 16:11:04 UTC+1: > I calculated a very simple pendulum system, using one non - holonomic > constraint. All worked as per expectation. Then I tried to calculate the > re

[sympy] print("hello sympy!")

2022-01-11 Thread Mi Lia
Hi, all ! I've started playing recently with sympy after long years using Mathematica and I like it a lot, to say the least. I have a background in computational maths (MSc) and physics (BSc), currently working as a data/soft.

Re: [sympy] Re: Why is matrix inversion so slow?

2022-01-11 Thread Oscar Benjamin
On Tue, 11 Jan 2022 at 20:48, Gerardo Suarez wrote: > > Sorry, you're right I made a mistake while deriving that equation in python the actual matrix that I computed using mathematica is > > e = Matrix([[-gamma_c*(n_c + 1) - gamma_h*(n_h + 1), 0, 0, 0, 0, gamma_c*n_c, 0, 0, 0, 0, gamma_h*n_h, 0, 0

Re: [sympy] Re: Why is matrix inversion so slow?

2022-01-11 Thread Gerardo Suarez
Sorry, you're right I made a mistake while deriving that equation in python the actual matrix that I computed using mathematica is e = Matrix([[-gamma_c*(n_c + 1) - gamma_h*(n_h + 1), 0, 0, 0, 0, gamma_c*n_c, 0, 0, 0, 0, gamma_h*n_h, 0, 0, 0, 0], [0, -I*epsilon_c - gamma_c*n_c/2 - gamma_c*(n_c

Re: [sympy] Re: Why is matrix inversion so slow?

2022-01-11 Thread Peter Stahlecker
Would Mathematic return a Penrose inverse, if det(M) =0? I do not know Mathematica at all. On Tue 11. Jan 2022 at 20:08, Oscar Benjamin wrote: > On Tue, 11 Jan 2022 at 12:30, Gerardo Suarez > wrote: > > > > Sure, sorry about the image, I was unaware of how easy is to generate > python code wit

Re: [sympy] Re: Why is matrix inversion so slow?

2022-01-11 Thread Oscar Benjamin
On Tue, 11 Jan 2022 at 12:30, Gerardo Suarez wrote: > > Sure, sorry about the image, I was unaware of how easy is to generate python > code with the print methods > > from sympy import Symbol, Matrix,I > gamma_c = Symbol('gamma_c') > n_c = Symbol('n_c') > gamma_h = Symbol('gamma_h') > n_h = Symb

[sympy] Re: Why is matrix inversion so slow?

2022-01-11 Thread Hanspeter Schmid
Hmm, the last column of your martrix is zero, so it cannot be inverted because its determiant (e.det()) is zero. So how would Mathematica be able to calculate an inverse? gerardo...@gmail.com schrieb am Dienstag, 11. Januar 2022 um 13:30:02 UTC+1: > Sure, sorry about the image, I was unaware

Re: [sympy] Re: Why is matrix inversion so slow?

2022-01-11 Thread Oscar Benjamin
On Tue, 11 Jan 2022 at 12:30, Gerardo Suarez wrote: > > Sure, sorry about the image, I was unaware of how easy is to generate python > code with the print methods Thanks for that. I just wanted to test it to see if I could see what was slow or whether there is already a faster way to do this in

[sympy] sympy physics mechanics

2022-01-11 Thread Peter Stahlecker
I calculated a very simple pendulum system, using one non - holonomic constraint. All worked as per expectation. Then I tried to calculate the reactive forces at the point of attachment, using KM.auxiliary_eqs. (KM being the Kanes object). I replaced the accelerations of the generalised coordina

[sympy] Re: Why is matrix inversion so slow?

2022-01-11 Thread Gerardo Suarez
Sure, sorry about the image, I was unaware of how easy is to generate python code with the print methods from sympy import Symbol, Matrix,I gamma_c = Symbol('gamma_c') n_c = Symbol('n_c') gamma_h = Symbol('gamma_h') n_h = Symbol('n_h') epsilon_c = Symbol('epsilon_c') g = Symbol('g') epsilon_h =