Mathematica Mathematica - sorting NSolve solutions

AI Thread Summary
The discussion focuses on a Mathematica code that processes multiple files containing coordinates representing points of circles, using NSolve to generate outputs for each point. The user encounters issues with the outputs not being sorted, which complicates the subsequent analysis for calculating surface areas of the shapes formed. Suggestions include using a custom sorting function or clustering to group the outputs into distinct arrays for each shape. The conversation highlights the need for clarity in the desired output format and the importance of understanding the structure of the data being processed. Ultimately, the user seeks effective methods to organize and visualize the results from their computations.
  • #51
OK, this is just unsettling. The code worked fine yesterday. I run it again today and I get this:

ListPlot::lpn: {P,{{-10.045,<<20>>},{<<1>>},<<8>>,<<190>>},<<1>>,{{0.0474999,-0.000911766},<<9>>,<<190>>}} is not a list of numbers or pairs of numbers. >>

Not a list of numbers? Of course it is, I checked. Could Mathematica make mistakes because the code didn't change from yesterday to today.
 
Physics news on Phys.org
  • #52
Sometimes when you are testing and changing code you can set some variables and then delete the line where you set them. For instance, here P is is obviously not a number, but perhaps yesterday you had evaluated some statement like:
P=5
So that yesterday P did evaluate to a number, but today it does not.

It is good to quit the evaluation kernel and test your code "fresh" every once in a while.
 
  • #53
I found the problem. A typo.

I made a successful animation with additional images appearing and vanishing, just like they should.

All that remains is to use the surf method and see how the surface of those images varies with time.

Thank you for all the help. I could not do it without your assistance.
 

Similar threads

Replies
2
Views
1K
Replies
6
Views
4K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
5
Views
2K
Replies
4
Views
1K
Back
Top