I would like to calculate the following: w(k)−w(k−1), where w(k) are the parameters in iteration k. How can I make such a calculation?

Additionally, I would like to calculate the following: f(w(k)) + g(w(k)) where f and g are two separate functions of the parameters. Again, how can I make this calculation?

Thank you for your help.