# Solving equation with NSolve

I try to solve a quite messy equation. Normally NSolve finds the result very easily.

I use the following code :

paramFinal = {σ -> 0.5, ρ -> 0.05, a -> 0.05, δ -> 0.00001, γ -> 0.001, ψ -> 1, h -> 100, θ -> 1, y -> 0.1, cmin -> 100, β -> 1};


The equation I try to solve is the following :

root2 = NSolve[{(1 - s) s - ((γ a)^2 (σ (1 - Exp[-(β - ρ) h]))/(β - ρ))/((a - \δ) (a - δ) - (ρ + (y - θ s))) ((-θ/(\ρ + (y - θ s)) ((((a - δ) (1 - s) s)/(γ a))^(1 - σ)/(((σ (1 - Exp[-(β - ρ) h]))/(β - ρ))^(1 - σ) (1 - σ)) - cmin ((1 - Exp[-(β - ρ) h])/(β - ρ)) - (y \- θ s) ψ ) - ψ θ)/((1 - 2 s) - (ρ + (y - θ s)))) == 0 /. paramFinal}, s]


When I give a value for $\beta$, NSolve is working but the problem starts in the second step. Normally, afterwards I try to solve the following equation

NSolve[2 s - β == 0, β]


Hovewer, my aim is to solve the second equation. Then, I remove the numerical value for $\beta$ in paramFinal. Without a numerical value for $\beta$ in code, Mathematica don't give any output for root2. (remains always in "Running..." mode. ) Since, I don't have any value for $s$, I can not find a result for $\beta$ in second equation. Is there anything that I can do to find a result for this problem ?

PS. I don't want to replace the second equation in first one. Normally, my second equation is more complex than this one but in order to ease to presentation of the question, I deleted some stages to be more concise.

• I don't get how the two equations are connected... Do you want s in the second equation to have the value root2? – Marius Ladegård Meyer May 15 '17 at 16:36
• @MariusLadegårdMeyer I try to find an expression (or a numerical value )for "s" from root2 and afterwards find a numerical value for $\beta$ from the second equation. – optimal control May 15 '17 at 16:38
• Ok, if I understand correctly, the part that never finishes is the computation of root2, right? Have you tried FindRoot instead of NSolve? – Marius Ladegård Meyer May 15 '17 at 16:42
• Does bbgodfrey's answer solve your problem? – Michael E2 May 15 '17 at 23:10
• @MichaelE2 Since I was trying NSolve on more complex equations, NSolve did not work but I tried to solve these two equations simultaneously with FindRoot and it worked ! Thanks ! – optimal control May 16 '17 at 9:05

The goal appears to be to determine s and β simultaneously. This can be accomplished rapidly by
paramFinal = {σ -> 1/2, ρ -> 1/20,  -> 1/2, δ -> 10^-5, γ -> 10^-3, ψ -> 1,