While loops in Mathematica

by AxiomOfChoice
Tags: loops, mathematica
AxiomOfChoice is offline
Nov26-11, 02:40 PM
P: 517
I am trying to do some Newton's method-type stuff in Mathematica.

I want to build a While loop that does the following:

- Take input r.
- Compute some quantity f(r).
- Update the value of r to f(r).

- Repeat until |g(r)| < C for some fixed constant C.

The third (boldfaced) step is the one I'm having trouble with. I don't know how to do this. Can someone help?
Phys.Org News Partner Science news on Phys.org
Lemurs match scent of a friend to sound of her voice
Repeated self-healing now possible in composite materials
'Heartbleed' fix may slow Web performance
Bill Simpson
Bill Simpson is offline
Nov26-11, 08:10 PM
P: 971
Something like this?

r=Input["What's r?"];(*Enter something between -1 and 1 *)

If that doesn't give you enough then we need to see what you have already done

Register to reply

Related Discussions
Mathematica Beginner question: Nested loops Math & Science Software 6
circuit with 2 loops, find the current in one of the loops Introductory Physics Homework 2
Loops '08 will be in the UK! Beyond the Standard Model 13
Should Loops '06 be QG '06? Beyond the Standard Model 23
loops Introductory Physics Homework 3