dilevin / CSC417-a1-mass-spring-1d

Assignment 1 on one-dimensional mass spring systems for CSC2549, at the University of Toronto
14 stars 15 forks source link

[Clarification] Input for force and stiffness in the four integrations #8

Open honglin-c opened 4 years ago

honglin-c commented 4 years ago

Sorry that the function handle force and stiffness should take 3 variables as input instead:

force(f, q, qdot) - a function that computes the force acting on the mass as a function. This takes q and qdot as input parameters. f is the output force.
stiffness(k, q, qdot) - a function that computes the stiffness (negative second derivative of the potential energy). This takes q and qdot as input parameters. k is the output stiffness.
lalitlal commented 4 years ago

@chl9797 Can you clarify if this stiffness function should also be included in the forward euler, RK4, and symplectic euler or not? I only see it in the backward euler function.

honglin-c commented 4 years ago

@lalitlal stiffness function is only needed for the backward Euler function.

lvlingxiao1 commented 4 years ago

Why are we not allowed to use stiffness... just to torture us?

s99090 commented 4 years ago

@chl9797 do we really need to use stiffness in the backward Euler function? I got the same output without using the stiffness function.

honglin-c commented 4 years ago

@s99090 Yes, I think you'll need stiffness in backward Euler.

iyht commented 4 years ago

Can't we just obtain the stiffness from force?

lvlingxiao1 commented 4 years ago

@Haotian-Yang Exactly. That's probably the easiest way to do Runge Kutta, but probably not the way the prof wants us to do XD Feels like cheat

iyht commented 4 years ago

@lvlingxiao1 Well, I think it is valid to do. Since we are given a function that computes the force, which basically tells the stiffness(the stiffness already been placed in the lambda expression as a parameter). Otherwise, they shouldn't provide the force function, if they don't want us to use the stiffness. I'm just curious on the what is the purpose of the stiffness function in backward Euler, as we are given the force function already.

lvlingxiao1 commented 4 years ago

@Haotian-Yang let's see what the TAs say. Those two functions provide basically the same information. I have submitted my assignment anyway, so I don't really care now lol

honglin-c commented 4 years ago

@Haotian-Yang Yes, you can obtain the stiffness from the force, but we just want you to implement the stiffness function to check your understanding of the stiffness (and use it in the backward Euler if you like, or if possible). :)