0
$\begingroup$

I have a complicated equation system that I try to solve.

paramFinal = {σ -> 2.5, ρ -> 1.5, a -> 2.5, δ -> 0.00001, γ -> 0.001, ψ -> 1, h -> 90, θ -> 0.15, y -> 1, cmin -> 0.01};

I try to solve the two equation system by NSolve

adap[β_, root22_] := (1 - root22) root22 - ((γ a)^(1 - 1/σ) (σ (1 - Exp[-(β - ρ) h]))/(β - ρ))/(a - δ) ((-θ/(ρ + (y - θ root22)) ((((a - δ) (1 -root22) root22)/(γ a))^(1 - σ)/(((σ (1 -Exp[-(β - ρ) h]))/(β - ρ))^-σ (1 - σ)) - cmin ((1 - Exp[-(β - (ρ)) h])/(β - (ρ))) - (y - θ root22) ψ ) - ψ θ)/((1 - 2 root22) - (ρ + (y - θ root22)))/((a - δ) - (ρ + (y - θ root22))))^(-(1/σ))

Normally, I can solve this system by FindRoot (when I attribute a value for $\beta$, I can find $root22$) but the problem is that I would like to make a list for different values of $\beta$ and $root22$ in the following way ;

solK[i_] := NSolve[adap[β, i] == 0, {β}, Reals];

Table[solK[i], {i, 0.41, 0.47, 0.5}]

Unfortunately, Mathematica does not give any result and stuck in Running... mode. Any hints or suggestions in order to make this list ?

$\endgroup$
  • $\begingroup$ It looks like the difference between this question and its answer is the use of NSolve versus FindRoot. It might be nice for someone to post a "canonical" Q&A about the difference between these two functions. $\endgroup$ – Michael Seifert Jun 5 '17 at 16:15
1
$\begingroup$

This gives very fastly the answer to the problem ;

Table[{FindRoot[(1 - root22) root22 - ((γ a)^(1 - 1/σ) (σ (1 - Exp[-(β - ρ) h]))/(β - ρ))/(a - \δ) ((-θ/(ρ + (y - θ root22)) ((((a - \δ) (1 - root22) root22)/(γ a))^(1 - σ)/(((σ (1 - Exp[-(β - ρ) h]))/(β - ρ))^-\σ (1 - σ)) - cmin ((1 - Exp[-(β - (ρ)) h])/(β - (ρ))) - \(y - θ root22) ψ ) - ψ θ)/((1 - 2 root22) - (ρ + (y - θ root22)))/((a - \δ) - (ρ + (y - θ root22))))^(-(1/σ)) == 0 /. paramFinal, {β, 1.6}]}, {root22, 0.001, 0.99, 0.01}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.