Dear Prof Hwang,

[b]Ease of changing your own code:[/b]
reference:
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1435.msg8223#msg8223
This model is very similar to my own collision model,  i wish to study your implementation of contact forces inside your model.

[b]
My intent:[/b]
i am trying to change my own collision model http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=831.0 to include accurately the forces during impact.
[b]
Problem:[/b]
my implementation is flawed with this in-correct physics and i wish to get your help on this matter.
notice in the attachment pictures
t = 0 to t =  t_collision  = 0.295, momentum1 = m1*u1 = 8, Momentum2 = m2*u2, contact force = 0
t = t_collision+ dt = 0.30,  [color=red][b]momentum1 = m1*v1 = -4 [/b][/color], Momentum2 =not shown, contact force = maximum = -800
t = t_collision+ 2*dt to t_end of simulation,  momentum1 = m1*v1 = -4 , Momentum2 = m2*v2 = not shown, contact force = 0
notice the physics [color=red][b](RED)[/b][/color] is wrong, can you help make your model show contact forces correctly? I can study your model to learn :)



[b]My Plan A:[/b]
my plan is to split the event handler into 2 parts,
t = 0 to t =  t_collision, momentum1 = m1*u1 = , Momentum2 = m2*u2, contact force = 0
t = t_collision+ dt,  momentum1 = (some midpoint to be calculated )  , Momentum2 = (some midpoint to be calculated), contact force = maximum
t = t_collision+ 2*dt to t_end of simulation,  momentum1 = m1*v1, Momentum2 = m2*v2, contact force = 0
but i don't' know how to start the solution :)


[b]Possible Plan B:[/b]
could be squeezing at peak force to show at  t = t_collision+ dt/2
but i don't' know how to start the solution :) Is there a way to create a dt/2 inside the event?



[b]
My request:[/b]
can you demonstrate what you would do in your own model here http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1435.msg8223#msg8223
You can implement the inclusion of contact forces whichever way you feel is correct physics, i will try to understand it!