Group Abstract Group Abstract

Message Boards Message Boards

0
|
7.8K Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Create a table containing the numerical results of FindRoot?

POSTED BY: Imre Pazsit
4 Replies
POSTED BY: Mariusz Iwaniuk

Efficient and elegant, thanks a lot!

POSTED BY: Imre Pazsit
Posted 6 years ago
pvec = {0.03, 0.06, 0.09, 0.12, 0.15};
Xpvec = Table[0, 5]; n = 1;
While[n < 6, 
  fr = FindRoot[
    1 - 3/(8 Xp^3) (2 Xp^2 - 1 + (1 + 2 Xp) Exp[-2 Xp]) == 
     pvec[[n]], {Xp, 0.01, 0.5}];
  xtemp = Xp /. fr; Xpvec[[n]] = xtemp; n++];
Xpvec

gives

{0.0408762, 0.0836014, 0.128334, 0.175253, 0.22456}
POSTED BY: Oliver Seipel

Thank you for this solution, it indeed works.

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