I have this code:
\[Alpha]=0.86;
\[Beta]=0.6;
g=0.0005;
p[x_,y_,t_,ta_,f_,fa_,u_]:=(((\[Alpha]^\[Alpha])((1-\[Alpha])^(1-\[Alpha])) (y-(t+ta)*x-(f+fa)))/u)^(1/(1-\[Alpha]));
r[x_,y_,t_,ta_,f_,fa_,u_]:=(p[x,y,t,ta,f,fa,u](g))((1/(p[x,y,t,ta,f,fa,u](\[Beta])(g)))^(\[Beta]/(\[Beta]-1)))-1((1/(p[x,y,t,ta,f,fa,u](\[Beta])(g)))^(1/(\[Beta]-1)));
Table[
y = 70000;
t = 600;
f = 0;
ta = 0;
fa = 0;
ra = 45000;
Lu[u_] := (solution =
FindRoot[{r[x, y, t, ta, f, fa, u] - ra == 0}, {xbar, 10},
AccuracyGoal -> 1]; xbar /. solution);]
There is more code after this inside the table function, but the FindRoot part gives me this error:
"ReplaceAll::reps: {FindRoot[{r[x,y,t,ta,f,fa,3000]-ra==0},{xbar,10},AccuracyGoal->1]} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing."
Any help on solving this would be greatly appreciated.
Lu[u_]...
try justFindRoot[{r[x,y,t,ta,f,fa,u]-ra==0},{xbar,10},AccuracyGoal->1]
with a value foru
that makes this fail substituted in there. Exactly what does the result of that look like? Is that something in exactly the correct form that will make sense when you try to use that with /. ? The more usual form isLu[u_]:=xbar/.FindRoot[...]
Is there a good reason you are not doing that? $\endgroup$