Ed, Cool. Something like that would be a nice contribution to the mechanics module. You could write a similar class in sympy mechanics but it could use the mechanics api for the underlying computations.
Jason Jason moorepants.info +01 530-601-9791 On Mon, Apr 1, 2013 at 8:14 AM, Eduardo Cavazos <wayo.cava...@gmail.com>wrote: > Hi Jason, > > Yes, I picked a trivial example to mainly illustrate the API I'm working > with. The "Symbolism/Physics" module I use there can solve more complex > problems (more examples are on the github project page). > > With a library like this, instead of selecting which equations to use, you > describe the object at a certain state: > > var objA = new Obj(); > > objA.position.y = yA; > objA.velocity.y = Point.FromAngle(thA, vA).y; > objA.acceleration.y = -g; > objA.time = 0; > > Then describe the object at a later state: > > var objB = new Obj(); > > objB.position.y = yB; > > And finally use a method to calculate the time elapsed: > > Calc.Time(objA, objB, 1).Disp(); > > The 'Calc.Time' method figures out which equations to apply based on what > values are known. In my library, I indicate unknowns with the C# value > 'null'. > > Ed > > On Saturday, March 23, 2013 7:12:53 PM UTC-5, Jason Moore wrote: > > > >> The example you show is somewhat trivial. Can't you just write a few >> lines of plain ole SymPy to solve most college physics problems? Having >> such a verbose class in the C++ example seems to defeat the purpose for >> learning college physics. You could formulate a problem like that with >> mechanics, but the equations of motion simplify a lot. Once you have the >> equations of motion you could find the the solution with SymPy's >> integration functions. But the overhead of using the mechanics package >> isn't that advantageous in such simple problems as these. I'd just use >> SymPy to "write" the problem out like you do by hand. >> >> Particle >> >> Jason >> moorepants.info >> +01 530-601-9791 >> >> >> On Wed, Mar 13, 2013 at 8:53 PM, Eduardo Cavazos <wayo.c...@gmail.com>wrote: >> >>> On Monday, March 11, 2013 2:26:52 AM UTC-5, Gilbert Gede wrote: >>> >>> A good example of the functionality in the physics.mechanics submodule >>>> is here: >>>> http://www.moorepants.**in**fo/blog/npendulum.html<http://www.moorepants.info/blog/npendulum.html> >>>> . >>>> >>> >>> That's a great example. Thanks Gilbert! >>> >>> -- >>> 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 >>> http://groups.google.com/**group/sympy?hl=en<http://groups.google.com/group/sympy?hl=en> >>> . >>> For more options, visit >>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> >>> . >>> >>> >>> >> >> -- > 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 http://groups.google.com/group/sympy?hl=en-US. > > For more options, visit https://groups.google.com/groups/opt_out. > > > -- 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 http://groups.google.com/group/sympy?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.