At the moment I can find the limit of my transfer function as follows:
(5 4001.6`)/(5 4001.6` + (4 + s) (200 + s)) /. s -> 0
This works as I would expect and provides a final value of 0.961553 In this example my value of gain, k, is 4001.6` so re-writing the expression for arbitrary k would give:
(5 k)/(5k + (4 + s) (200 + s)) /. s -> 0
I want to find a value of k that makes the result 0.95. To do this I was thinking about using a while loop.
I thought the while loop could start with k=1, compute the limit, test to see if less than 0.95, and if not increment k by one, and perform the test again, until the correct value of k is found:
This is what I have tried:
k = 1; While[(5 k)/(5 k + (4 + s) (200 + s)) /. s < 0.95, k++]
However I get the error: "ReplaceAll::reps: {s<=0.95} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing. >>"
Any help would be most appreciated.
(... /. s -> 0) < 0.95? The error message is telling you that you forgot a->. – Michael E2 Aug 14 '13 at 20:18FindRoot[0.95 == (5 k)/(5 k + (4 + s) (200 + s)) /. s -> 0, {k, 4000}]Out:{k -> 3040.}– Mr.Wizard Aug 14 '13 at 20:34