Message Boards Message Boards

0
|
5435 Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Solve or For loop

Posted 9 years ago

Hi,

How to solve this in Mathematica? What are the ways to do this in an efficient way, For loop might not be the solution, right?

A=6 
B=3 
C=2 
D=1 
E=3.2
pr=1

For i=1 , i++
{

f (pr )=2A pr 6 +Bpr^3 +Cpr^2 +Dpr +E pr^3 

f ’ (pr ) 

prnew=pr-f (pr )/ f ’ (pr )

if (prnew - pr)   <10-3

Break []
else
pr =prnew

}

If no convergence pr=1

Thank you for the help and examples.

Hugh

POSTED BY: hugh trifol
5 Replies
Posted 9 years ago
POSTED BY: hugh trifol
POSTED BY: Patrik Ekenberg
Posted 9 years ago
POSTED BY: hugh trifol
POSTED BY: Patrik Ekenberg
Attachments:
POSTED BY: Patrik Ekenberg
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract