Given an expression like this, {x -> 3.07401}
, we can extract the 3.07401
in a few ways.
Part[{x -> 3.07401}, 1, -1]
(* also written as {x -> 3.07401}[[1, -1]] *)
Part[Values[{x -> 3.07401}], 1]
(* also written as Values[{x -> 3.07401}][[1]] *)
Lookup[{x -> 3.07401}, x]
ReplaceAll[x, {x -> 3.07401}]
(* also written as x /. {x -> 3.07401} *)
Now we need to decide where to do this extraction. You can apply it to the argument of S
or you can apply it to the output of f
. So, instead of S[T_] := s[f[T]]
, do
S[T_] := s[f[T][[1, -1]]]
Or instead of f[T_] := FindRoot[s[x] - T*x, {x, 20}]
do
f[T_] := FindRoot[s[x] - T*x, {x, 20}][[1, -1]]
Side note: get rid of all of the Activate
and Inactive
stuff