I want to use:
demand = {1.92,
2.07,
2.37,
2.72,
2.87}*10^6;
NSolve[SetV == demand[[1]]/(Cpf (1 - χ)), χ]
I want to make a vector of solutions for chi (χ) given each of the demand vector components.
I want to use:
demand = {1.92,
2.07,
2.37,
2.72,
2.87}*10^6;
NSolve[SetV == demand[[1]]/(Cpf (1 - χ)), χ]
I want to make a vector of solutions for chi (χ) given each of the demand vector components.
Simple replace should do the trick
χ /. {{χ -> (-1.92`*^6 + Cpf SetV)/(Cpf SetV)}}
Yields
{(-1.92*10^6 + Cpf SetV)/(Cpf SetV)}
χ /. First[NSolve[SetV == #/(Cpf (1 - χ)), χ]] & /@ demand
or equivalently
χ /. First@Solve[SetV == dem/(Cpf (1 -χ)), χ]
(-dem + Cpf SetV)/(Cpf SetV)
and now
(-# + Cpf SetV)/(Cpf SetV)& /@ demand
{(-1.92*10^6 + Cpf SetV)/(Cpf SetV), (-2.07*10^6 + Cpf SetV)/( Cpf SetV), (-2.37*10^6 + Cpf SetV)/( Cpf SetV), (-2.72*10^6 + Cpf SetV)/( Cpf SetV), (-2.87*10^6 + Cpf SetV)/(Cpf SetV)}
x = #, because then you cannot usexto represent an indeterminate variable in your equation. Save the resulting rule in a variable likexsoland use it as shown in the linked answer. When you get used to it, it can be convenient. – Michael E2 Nov 26 '14 at 19:21