Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Animation Rick Parent Computer Animation Algorithms and Techniques Optimization & Constraints Add mention of global techiques Add mention of calculus.

Similar presentations


Presentation on theme: "Computer Animation Rick Parent Computer Animation Algorithms and Techniques Optimization & Constraints Add mention of global techiques Add mention of calculus."— Presentation transcript:

1 Computer Animation Rick Parent Computer Animation Algorithms and Techniques Optimization & Constraints Add mention of global techiques Add mention of calculus of variations

2 Computer Animation Rick Parent Enforcing Soft and Hard Constraints Soft constraints - Minimizing energy terms Hard constraints – constrained optimization Example: Space-time constraints

3 Computer Animation Rick Parent Constrained optimization Use whenever the best, shortest, least error, is needed: Fit surface with least curvature to set of points Reach for object with minumu torque Find motion in database whose start pose is closest to end of current motion

4 Computer Animation Rick Parent Minimum (or maximum) of a function f(x) f’(x) = 0 Ballistic motion Analytic derivative & solution

5 Computer Animation Rick Parent Minimum (or maximum) of a function Multivariate case Gradient / Jacobian

6 Computer Animation Rick Parent Energy function Search parameter space modify parameters to reduce energy Parametric position function P(u,v) Surface normal function, N(u,v) Implicit function I(x) – distance to surface Useful geometric features– easy to compute Define energy terms in terms of geometric features =0 for desirable configuration increases for less desirable configurations

7 Computer Animation Rick Parent Useful Constraints

8 Computer Animation Rick Parent Pipe assembly

9 Computer Animation Rick Parent Finding the minimum Analytic derivative/gradient Numeric solution by iterative search Newton’s method Steepest Descent Conjugate Gradient Method Analytic solution minimize Numeric approximation to derivative/gradient

10 Computer Animation Rick Parent Newton’s method

11 Computer Animation Rick Parent Steepest descent – step in direction of negative of gradient

12 Computer Animation Rick Parent Conjugate gradient method

13 Computer Animation Rick Parent Constrained Optimization Equality constraints minimize Inequality constraints

14 Computer Animation Rick Parent Lagrange multipliers.

15 Computer Animation Rick Parent Spacetime constraints Constrained optimization problem in time and space Constraints – e.g. locating certain points in time and space Non penetration constraints Objective function – e.g. Minimize the amount of force used over time interval Minimize maximum torque. http://www.cs.cmu.edu/~aw/pdf/spacetime.pdf

16 Computer Animation Rick Parent Spacetime constraint example Particle position is function of time, x(t) Time-varying force function, f(t) Equation of motion Given f(t), x(t 0 ),- integrate to get x(t).

17 Computer Animation Rick Parent Spacetime constraint example Need to determine f(t) x(t 0 ) = a x(t 1 ) = b Objective: to minimize total force Objective function: Subject to constraints

18 Computer Animation Rick Parent Spacetime constraint example R – minimize discrete version subject to constraints. Use discrete x(t), f(t), R, constraints Time derivatives approximated by finite differences Constraints:

19 Computer Animation Rick Parent Spacetime constraint canonical form Numerical Solution – canonical form S j – collection of scalar independent variables R(S j ) – objective function to be minimized C i (S j ) – collection of scalar constraint functions => 0. x, y, z components of the x i ’s and f i ’s sum of forces squared used at each time step components of p i ’s, c a, and c b.

20 Computer Animation Rick Parent Spacetime constraint - canonical Numerical problem statement Find S j that minimizes R(S j ) subject to C i (S j ) = 0 Numerical solution method: - Request values of R and C i for given S j - Access to derivatives of R and C i with respect to S j - Iteratively provides updated values for solution vector S j.

21 Computer Animation Rick Parent Spacetime constraint Sequential Quadratic Programming (SQP) Computes second-order Newton-Raphson step in R Projects the first onto the null space of the second to the hyperplane for which all the C i ’s are constant to the first order. Computes first-order Newton-Raphson step in the C i ’s

22 Computer Animation Rick Parent Spacetime constraint using SQP Sequential Quadratic Programming (SQP) Computes first-order Newton-Raphson step in the C i ’s Jacobian: Computes second-order Newton-Raphson step in R Hessian Plus the first derivative vector:

23 Computer Animation Rick Parent Spacetime constraint example Matrices i=j i=j-1, j+1 otherwise i=j Otherwise.

24 Computer Animation Rick Parent Spacetime constraint example Matrices i=j Otherwise.

25 Computer Animation Rick Parent Spacetime constraint example SQP step Solve 2 linear systems in sequence Yields a step that minimizes a 2 nd order approx. to R Yields a step that drives linear approx. to C i ’s to zero And projects optimization step S j to null space of constraint Jacobian. 1 2

26 Computer Animation Rick Parent Spacetime constraint example Final update: Reaches fixed point: - When C i ’s = 0 - Any further decrease in R violates constraints.

27 Computer Animation Rick Parent Constrained optimization

28 Computer Animation Rick Parent Spacetime constraint example Note about Linear system solving Large matrices often with spacetime problems Inverting is O(n 3 ) Spacetime problems almost always sparse Over and under constrainted systems easily arise Under constrained: pseudo-inverse Pseudo-inverse for sparse matrix sparse conjugate gradient algorithm: O(n 2 ).


Download ppt "Computer Animation Rick Parent Computer Animation Algorithms and Techniques Optimization & Constraints Add mention of global techiques Add mention of calculus."

Similar presentations


Ads by Google