Compute gradient of discretized energy function Given the following discretized energy problem, I'd

Villaretq0

Villaretq0

Answered question

2022-06-24

Compute gradient of discretized energy function
Given the following discretized energy problem, I'd like to compute the gradient with respect to u[i]:
min u i = 1 N 1 | u [ i + 1 ] u [ i ] | + λ 2 i = 1 N ( u [ i ] f [ i ] ) 2
I have the following solution but I can't come up with it myself.
E [ i ] = sign ( u [ i ] u [ i 1 ] ) sign ( u [ i + 1 ] u [ i ] ) + λ ( u [ i ] f [ i ] ) 1 < i N 1
I understand that the derivative of the |x| function is sign(x) but I don't see why there are two sign terms. Basically, my calculation is:
d d u [ i ] | u [ i + 1 ] u [ i ] | = sign ( u [ i + 1 ] u [ i ] ) d d u [ i ] ( u [ i + 1 ] u [ i ] ) = sign ( u [ i ] u [ i 1 ] ) d d u [ i 1 ] ( u [ i ] u [ i 1 ] ) = sign ( u [ i ] u [ i 1 ] ) ( d d u [ i 1 ] u [ i ] 1 )
This is where I get stuck and can't come up with the provided solution.

Answer & Explanation

Punktatsp

Punktatsp

Beginner2022-06-25Added 22 answers

Step 1
Not sure I understand the meaning of "min u" there. But if I can lay that aside, look at some u in particular, u[3], say. It shows up not once in the calculation, but twice, in two terms | u [ 3 ] u [ 2 ] | .
Step 2
You have to account for both of them. If you understand where the "sign"s come from, you can take it from there.

Do you have a similar question?

Recalculate according to your conditions!

New Questions in Discrete math

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?