1) OK, see the attached worksheet. The results from fsolve are given. Why should I have to input rp and rhol on another line so I can use them in the later integration? Why should not the results not be available to the rest of the program. That is what I mean by global.
2) Notice the program runs OK as it is. Now copy rp=0.0061538446156 from the fsolve result, and overwrite the rp=0.0061538446156 on the next line. Also insert a ":" to make it an assignment. Then run the program again, and notice that it errors. That is because the subscript that was there before was an atomic subscript, and the one replaced by the subscript from fsolve is a index subscript. That makes the following integral evaluation fail because the rp in the integral limit is a atomic variable, which is nowhere defined right now. Now make rp on line (3) a atomic variable by typing in r followed by a control-shift-underscore. That should make the program run OK. So, fsolve took in rp as a atomic variable and changed it to a index variable. What came out was different than what went in. Ratch
View 6782_fsolve example.mw on MapleNet or Download 6782_fsolve example.mw
View file details