Dear Kostas,
Thank you for your response. As my intuition is not as sharp as yours, I might need a few explanations: - md.add_nonlinear_term(mim, "(u-rot(phi)*(X-[xc;yc])).mult", HoleZone) --> This order zero term seems pretty straightforward and much more readable than in my code - md.add_linear_term(mim, "Fy/area*Test_yc", HoleZone) --> No multiplier is involved in your formulation. Is this because we need to combine this term with the previous order 0 term -((rot(phi)*([0;1])).mult)*Test_yc (and check the sign) ? - md.add_linear_term(mim, "([Fx/area,0]*rot_der(phi))*(X-[xc;yc])*Test_phi", HoleZone) --> Could you explain how do you come up with this term ? - A more general question: Is it possible to formulate the whole condition as an order 0 term ? Thanks in advance, Best regards Raphaël Le mer. 6 avr. 2022 à 23:14, Konstantinos Poulios <logar...@googlemail.com> a écrit : > Dear Raphaël, > > Interesting question. Prescribing Fx is a bit strange condition. I haven't > checked it, but I think something like this should work: > > md.add_initialized_data("Fx", 10.) > md.add_initialized_data("Fy", 100.) > > md.add_initialized_data("xc", 0.) > md.add_variable("yc", 1) > md.set_variable("yc", yc) > md.add_variable("phi",1) > md.set_variable("phi", 0.) > md.add_fem_variable("u", mfu) > md.add_filtered_fem_variable("mult", mfu, HoleZone) > > md.add_macro("rot(x)", "[cos(x)-1,sin(x);-sin(x),cos(x)-1]") > md.add_macro("rot_der(x)", "[-sin(x),cos(x);-cos(x),-sin(x)]") > > md.add_initialized_data("area", gf.asm_generic(mim, 0, "1", HoleZone)) # > Calculate the area of the region > md.add_nonlinear_term(mim, "(u-rot(phi)*(X-[xc;yc])).mult", HoleZone) > md.add_linear_term(mim, "Fy/area*Test_yc", HoleZone) > # check if a minus sign is needed > md.add_linear_term(mim, "([Fx/area,0]*rot_der(phi))*(X-[xc;yc])*Test_phi", > HoleZone) # check if a minus sign is needed > > for time in [0,0.1,0.3,0.6,0.9]: > md.set_variable("xc", speed*time) > md.solve("noisy") > > A bit based on intuition but you can certainly learn something from > analyzing this suggestion. Let us discuss it further if you cannot get it > to work and have more questions. Try to avoid expressions like "speed*time" > and "alpha*time" in your expressions, they seem too specific to constant > velocities, they make the code more difficult to read, and they will not > help you to generalize the code later. Just solve for positions/angles > directly if that's what you want. > > FYI, the expression > (u-rot(phi)*(X-[xc;yc])).mult > will expand internally to something like > (u-rot(phi)*(X-[xc;yc])).Test_mult > +Test_u.mult > -((rot_der(phi)*(X-[xc;yc])).mult)*Test_phi > -((rot(phi)*([0;1])).mult)*Test_yc > > BR > Kostas > > > On Wed, Apr 6, 2022 at 4:54 PM Raphaël Meunier <raphael.meuni...@gmail.com> > wrote: > >> Dear Getfem-Users, >> >> I am trying to impose a rolling condition on a "tire". My work is >> directly inspired from the "Example of wheel in contact" tutorial >> <https://getfem.org/tutorial/wheel.html>. In this tutorial, one wants to >> prescribe the rim rigidity and the vertical force. From this, I just have >> to add a rolling condition. Specifically I want to find the rotation speed >> "alpha_rot" that enables me to impose some force Fx: >> >> gwfl_rot='-lambda_D.Test_u + >> ([cos(alpha_rot*time),sin(alpha_rot*time);-sin(alpha_rot*time),cos(alpha_rot*time)]*(X-[0;y_c])-(X-[0;y_c])\ >> + [speed*time;alpha_y] - u).Test_lambda_D +(lambda_D.[1;0] + >> Fx)*Test_alpha_rot + 1E-6*alpha_rot*Test_alpha_rot' >> gwfl_y='(lambda_D.[0;1] + Fy)*Test_alpha_y + 1E-6*alpha_y*Test_alpha_y' >> roll_gwfl=gwfl_y+gwfl_rot >> >> idBrick = model.add_nonlinear_term(mim, roll_gwfl, HoleZone) >> >> >> Where alpha_rot and alpha_y are the "parameters" I am trying to find. >> This works for up to ten timesteps but then it diverges... I tried to use >> two multipliers instead of one which leads to worse results. >> Am I on the right track ? Is there a better way to achieve this ? >> >> Thanks in advance, >> >> Best regards, >> >> Raphaël >> >