Since x is a matrix and you are using it with other variables, you have to use vectorize. You can either write it as a function or click to its button on toolbar > matrices.
I can not have a right calculation results though I tried to resolve this several times.
You can make each demand algo style 1rst demand exemplified. The algo style will support in-situ infinite command line. ... in-situ infinite command line wrt [u,v,x] A damned elegant Pro. style project !