Group Abstract Group Abstract

Message Boards Message Boards

How to use solution of FindRoot as the guess for the next usage of FindRoot

Posted 4 years ago
POSTED BY: Amir Sadeghi
2 Replies
Posted 4 years ago

Hi Hans,

Thanks for your response. It works!

Amir

POSTED BY: Amir Sadeghi

Unfortunately, my stone-age version of FindRoot (version Mathematica 7) does not find solutions to your system of equations (singular jacobian). hmm. But, perhaps the following helps a bit

Function to find its roots

ff[x_, p_, q_] := (x - p)^2 - q

start parameters: p is the shift on the x-axis, q a free parameter, xinit the 1st startparameter for FindRoot

xinit = 9; p = 5; q = 10;

now here is a fuction to find a root of the problem and update the start parameter for FindRoot

gg := Function[{x, p, q}, {q, sol = FindRoot[ff[xx, p, q], {xx, xinit}]; xinit = xx /. sol[[1]]; sol}
  ]

giving this result

Table[{xinit, gg[5, p, q]}, {q, 12, 15}]

Note how the start-parameter for FindRoot changes with increasing q.

I think you could this fit to your problem....

POSTED BY: Hans Dolhaine
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard