Post Reply 
Solver (17BII, 27S, etc) equation with multiple outputs
02-21-2023, 04:30 PM
Post: #5
RE: Solver (17BII, 27S, etc) equation with multiple outputs
(02-21-2023 03:34 PM)robjordan Wrote:  Dave,

Thanks very helpful! I forgot that you can retrieve intermediate values using RCL.

I like your second approach best though, using the S() expression. The equation as you wrote it didn't validate at first, but then I figured, from reading the Don Shepherd additional material in Martin Hepperle's version of the Solver documentation, that the expressions in the two branches of the S() should be treated as having an implicit =0. So instead of writing "DBGAIN=20*LOG(VOUT/VIN)", you have to write "20*LOG(VOUT/VIN)-DBGAIN". In full:

GAIN:IF(S(DBGAIN):20×LOG(VOUT/VIN)-DBGAIN:(VOUT/VIN)-VGAIN)

Thanks again
Rob

Oops, my mistake. Forgot you couldn't put = inside the IF() function like that. Smile But yes, any equation without = in it is treated as solving for zero, so you can just subtract one side from the other like you've demonstrated.

I've also taken advantage of that behavior to make unit conversion formulas where you can input any one variable and solve for any other, e.g.:

.0254*(IF(S(IN):-1:1)*IN+IF(S(FT):-1:1)*FT*12+IF(S(YD):-1:1)*YD*36+IF(S(MI):-1:1)*MI*63360)+IF(S(MM):-1:1)*MM/1000+IF(S(CM):-1:1)*CM/100+IF(S(M):-1:1)*M+IF(S(KM):-1:1)*KM*1000

Essentially, use S() to multiply the variable you're solving for by -1 to isolate it from all the other variables. Make sure you do CLEAR DATA to zero out all the unused variables first, or it will convert the sum of all the entered variables to the one you're solving for. (Though maybe that's what you want at times!)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Solver (17BII, 27S, etc) equation with multiple outputs - Dave Britten - 02-21-2023 04:30 PM



User(s) browsing this thread: 1 Guest(s)