I've asked this on the LTSpice group and am getting conflicting answers.
I have a tank circuit in a sim I'm working with, and I need to look at the effect of changing the L value across a range (using .step statement) and of course the companion capacitor value needs to be adjusted to match.
.param F 500000
.step param L 1uH 10uH 200nH
.param C (1/(2*Pi*F))**2/L
The capacitor value is set to {C} and the inductor set to {L}
I've been told that this "should work" and that it "will not work".
I suppose it comes down to when the capacitor value param statement is evaluated. When I run it, I'm told that it can't resolve the parameter C.
I'm not married to this approach, it simply seemed the most obvious way to proceed, but I do need to be able to adjust the C value to match the L in each run.
If this can't work, is there a way to get to what I need, having the C automatically adjusted to resonate with the L?
Spehro: I'm not sure exactly what you mean, and what I'm doing isn't working.
I have .param A = (2pi{F}) and .param B = {A}**2 and .param C = (1/{B})/{L} "Missing expression in **2" is the result.
The Photon:
This version: {(1/2piF))**2/L} gives me Error: undefined symbol in: "(1/2pi[f]))**2/l"
So I tried this version, setting the value in the component to:
{(1/2pi{F}))**2/{L}}} Error: undefined symbol in: "(1/2pi([f])))**2/(l)"
{(1/(2*Pi*F))**2/L}
. \$\endgroup\$f
elsewhere and you said yes, but it clearly isn't the case. You were also hinted at to upload your schematic, you didn't, someone even tried to help by uploading an example, did you see it? You're blaming others for not helping you but you don't make the slightest effort to show what exactly you have. Also extracting from context ("this will work", "this won't"). You're wasting people's time by not giving details but expecting answers. \$\endgroup\$f
" means nothing in this context. There is no context to speak of. All you're saying is that you have an LC tank and that assigning a value doesn't work. That's it. In which case, the answer below is good enough for your efforts. \$\endgroup\$