Hello Wolfram Community,
I want solve the following equations simultaneously with FindRoot:
equOne=0. + 0.0335103 p + 0.000263189 p^2 - 0.0335103 q - 0.000263189 q^2 +
69.5339 p (0.000435374/r + (9.11845*10^-6 p)/r) + (
1.8068 (1 + 0.0167552 p + 0.00017546 p^2))/r + Log[1. p] - Log[q];
equTwo=0. + 0.0335103 p + 0.000263189 p^2 - 0.0335103 q - 0.000263189 q^2 +
27.646 p (0.000435374/r + (9.11845*10^-6 p)/r) + (
0.718367 (1 + 0.0167552 p + 0.00017546 p^2))/r + Log[1. p] - Log[q];
For this, I incrementally increase q and use it as the initial guess for p, howeve I use a fixed value of r as the initial guess for r, i.e. rInitialGuess:
rInitialGuess=4;
solQPR=Table[Flatten@{q, {p, r} /.
FindRoot[{equOne == 0,
equTwo== 0}, {{p, q}, {r,
rInitialguess}}]}, {q, 0.1,100,0.1}] (*FindRoot used 1000 times*)
The general trend is this: As q increases, p also increase but r decreases. If I use the rInitialGuess for all the values of q, FindRoot cannot solve the system for large values of q since the difference between the rInitialGuess and the potential root is large. To solve this issue, i want to use the answers, i.e. solQPR[[k-1,{2,3}]] of the step k-1 as the guess for the step k; that is, use q=0.1 and r=rInitialGuess only in the first trial. How can I do that?