Hello Zhengqi,
Nice to hear from you.
So, in general, .param and .global_param can be used as sensitivity parameters. So, although the un-named PWL parameters are not supported directly for sensitivity analysis, it is theoretically possible to set the PWL values using a .params, and then refer to those .params on the .SENS line.
However, there is another problem, which is related to the independent Vsrc source. The Vsrc has a very limited analytical sensitivity support at the moment, so it produces the wrong answer. (It unconditionally assumes a DC source). Also, it isn't properly set up to do numerical sensitivities either. So, it just doesn't work for your problem at the moment, even using .params to set the PWL values. There are at least two bugs that were revealed by this exercise that need fixing.
Fortunately, there is a partial work around, using the TABLE feature of the B-source, which is functionally equivalent to the VPWL source. The code for the Bsrc is completely separate from the Vsrc, so it doesn't have as many limitations. But it isn't perfect either. In short, direct sensitivities work using the Bsrc, but adjoints don't.
I was able to put together a simple circuit for which .param-specified PWL values in a Bsrc works with sensitivity analysis . However, like I said, it currently only works for direct sensitivities, not adjoints. I haven't had time to debug why it is broken for adjoints yet.
Here is my simple B-PWL direct sensitivity example. I just ran this in my local copy of Xyce and it worked, producing nonzero answer. I have NOT yet checked if these nonzero answers are correct.
-------
Behavioral source - piece wise linear signal, transient direct sensitivity example.
* adjoint sensitivities currently don't work for this example.
.param v1=0, v2=3, v3=2, v4=2, v5=5, v6=5, v7=-2, v8=1, v9=-1, v10=4, v11=3
bpwl1 1 0 v = {table(time,0,{v1},2,{v2},3,{v3},4,{v4},4.01,{v5},4.5,{v6},4.51,{v7},7,{v8},9,{v9},9.01,{v10},10,{v11})}
r1 1 2 500
r2 2 0 250
.sens objfunc={v(2)} param=v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11
.options sensitivity direct=1 adjoint=0
*.print tranadjoint
.print sens
.tran 0.01s 30s
.print tran v(1)
.end
-------
I'll have to do some debugging to figure out why the above example doesn't work for adjoints (currently for adjoints it returns all zeros). It is *probably* an easy fix.
Also, some of the issues uncovered for the VPWL source need to be fixed as well. At the very least, it should be fixed to work with numerical sensitivities.
thanks,
Eric