I guess its hard to get from my description, so i uploaded a drawing to visualize the physical problem: http://pasteboard.co/1Bvt53hY.png
Thanks for your interest! On Saturday, June 11, 2016 at 3:13:52 PM UTC+2, janosc...@gmail.com wrote: > > > Physically, the rows of A are three points fixed on a movable board. > > These points run freely in three linear bearings which are placed on a > fixed base. > > The linear bearings are described in hesse normal form in the rows of > matrix C. > > The robust motion matrix B is the transformation which transforms points > on the board to points in the base. > > So together my constraint D = (A * B) * C means > - Transform the points in A from the board to the base: A * B > - Compute the distance from the linear bearings: * C > - Claim that the distances are zero and solve for the motion > > I am aware that there are some other approaches to tackle this problem, > but i was not able to get a grip on them such that i could formulate them > in code. > > > > On Saturday, June 11, 2016 at 1:50:25 PM UTC+2, brombo wrote: >> >> Physically what are all the matrices. Do A and C also describe >> rotations. Please give the actual physics problem as well as the resulting >> math. >> >> On Sat, Jun 11, 2016 at 6:37 AM, <janosc...@gmail.com> wrote: >> >>> My description was a little compressed, so i had to clean up the code to >>> match my description again ... >>> The code is available here: http://pastebin.com/MMW3B88h >>> I hope its readable for you. >>> >>> >>> >>> Am Donnerstag, 9. Juni 2016 20:24:35 UTC+2 schrieb Jason Moore: >>>> >>>> Can you please share the code so we can see what you are doing? >>>> >>>> >>>> Jason >>>> moorepants.info >>>> +01 530-601-9791 >>>> >>>> On Wed, Jun 8, 2016 at 11:58 PM, <janosc...@gmail.com> wrote: >>>> >>>>> I am trying to solve a system of equations with sympy that arises from >>>>> a constraint of the form: >>>>> >>>>> (A x B) x C = D >>>>> >>>>> where >>>>> >>>>> * A, B, C and D are 3x3 matrices >>>>> * the diagonal of D should be zero >>>>> * B is a "rigid motion 2D" transformation, with elements cos(phi), >>>>> +-sin(phi), x and y >>>>> * A and C are fully filled with (supposedly known) values >>>>> * I want to solve for phi, x and y >>>>> >>>>> This gives me four equations: >>>>> >>>>> * one for each diagonal element in D >>>>> * one additional (quadratic) equation sin^2(phi) + cos^2(phi) = 1 >>>>> >>>>> When feeding those to equations directly to sympy, this takes some >>>>> hours and then breaks with an out of memory message. >>>>> >>>>> My next approach was to help sympy by guiding the solution step by >>>>> step (*). >>>>> >>>>> * First i took two of the linear equations and let sympy solve for x >>>>> and y (works great) >>>>> * Instead of having cos(phi) and sin(phi) in the B matrix, i >>>>> introduced new symbols cosphi and sinphi >>>>> * Then i took the resulting expressions for x and y, and solve with >>>>> the third linear equation for the cosphi element (works too) >>>>> * Finally i tried to solve the quadratic equation for sinphi by >>>>> inserting the just gathered cosphi expression >>>>> * The last step was not feasible without transforming the expression >>>>> to a polynom in sinphi and by replacing all coefficient expressions by >>>>> new >>>>> symbols, then it worked >>>>> >>>>> The resulting expressions for x, y and phi (written as python >>>>> expressions) are about 3 MB (!) of text. >>>>> >>>>> This does not seem to be adequate to the problem, and when converting >>>>> to a theano function i get "maximum recursion depth exceeded". >>>>> When i look at the expressions they are very repetitive, so i tried >>>>> CSE, which brings it down to about 30 KB, but they are still very >>>>> repetitive and full of patterns. >>>>> >>>>> I suspect that the resulting expressions actually just perform some >>>>> matrix operations, so probably there would be an efficient way to compute >>>>> the solution if only one could get back to matrix expressions. >>>>> I tried to guess what the appropriate matrix operations are, but >>>>> without success (**). And this feels of course very wrong and backwards. >>>>> >>>>> Is there some obvious approach to such problems that i missed? Is the >>>>> problem actually that hard? >>>>> >>>>> I am aiming for a mostly automated solution process without steps like >>>>> (*) and (**), because i have a hand full of very similar problems ahead >>>>> ... >>>>> Any hint appreciated! >>>>> >>>>> -- >>>>> Best regards >>>>> Janosch >>>>> >>>>> -- >>>>> 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+un...@googlegroups.com. >>>>> To post to this group, send email to sy...@googlegroups.com. >>>>> Visit this group at https://groups.google.com/group/sympy. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/sympy/8555837f-d87d-484c-b882-2d8f7085d3b2%40googlegroups.com >>>>> >>>>> <https://groups.google.com/d/msgid/sympy/8555837f-d87d-484c-b882-2d8f7085d3b2%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> -- >>> 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+un...@googlegroups.com. >>> To post to this group, send email to sy...@googlegroups.com. >>> Visit this group at https://groups.google.com/group/sympy. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/sympy/ccde273d-ee0e-46bc-a822-7d1b9ff88f7e%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/sympy/ccde273d-ee0e-46bc-a822-7d1b9ff88f7e%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- 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 post to this group, send email to sympy@googlegroups.com. Visit this group at https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/f68853ca-2a1f-4ef1-a371-340602cbd63d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.