0

I plotting my data points in mathematica below enter image description here enter image description here

in my opinion, I can determine point A use circle equation r^2=x^2+y^2 because the datum (0,0) of "small circle" is fix coordinate. But for "big circle" I don't know how to make programming in Mathematica. Because the datum of "big circle" has distance as long as 123 from datum of "small circle" (0,0). Theoretically, I can apply R^2=(x+123)^+(y)^. but I don't know how make it in programming mathematica. Please help and advice me.

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
SelfA
  • 235
  • 1
  • 8
  • 3
    Can you clarify what you're trying to do? What exactly is your input and desired output? – jjc385 Jun 10 '17 at 18:11
  • 1
    how is the plotted data generated? – glS Jun 10 '17 at 18:48
  • @gIS I plotted from my data points, but I feel difficulties to attach it. Could you please give me advice how to do that? because it's usually shows warning "different format" and failed to upload. – SelfA Jun 11 '17 at 01:03
  • @JJC385 I would like to show you a graphic from input data points. Those graphic has fix coordinate with datum 0,0. Please look at point A. If it's continue to upward (counterclockwise), it looks like a "small circle" with datum 0,0. and also for point B If it's continue to downward (counterclockwise), it looks like a "big circle" with datum (0+x1,0). My desire output: how to know the position of point A, B, and C? Thank you. – SelfA Jun 11 '17 at 01:17

1 Answers1

1

Let your data be of the form data = {{x1,y1},{x2,y2},...}. I generated sample data with

dataGen = Function[x,
  With[{rSmall = 36, rLarge = 53, x0Large = 123},
   Piecewise[{{-Sqrt[rSmall^2 - x^2], x < rSmall}, {0, 
      rSmall < x < x0Large - rLarge}, {-Sqrt[
       rLarge^2 - (x - x0Large)^2], x0Large - rLarge < x < x0Large}}, 
    0]
   ]];
data = Table[ {x, dataGen@x}, {x, 0, 123, 0.01} ];

Let us fit an equation of a circle to a portion of your data:

fit = NonlinearModelFit[
 Select[data, 75 < First@# < 120 &], (* restrict to data with 75 < x < 120 *)
 y0 - Sqrt[r^2 - (x - x0)^2],
 {{r, 100}, {x0, 100}, {y0, 10}},    (* Approximate parameter estimates *)
 x]

You can obtain the best fit parameters with

fit["BestFitParameters"]
{r -> 53., x0 -> 123., y0 -> -3.30754*10^-14}

or the best fit equation

fit["BestFit"]
-3.30754*10^-14 - Sqrt[2809. - (-123. + x)^2]

Of course you need not include x0 and/or y0 if you know either of them to be zero.

I'm far from an expert on fitting. You may want to look at other fitting questions to get a better sense of best practices. This answer provides a nice method for estimating starting parameter values using Manipulate. Note that the fit seems to be rather sensitive to starting parameters.


The rest of your questions is a bit unclear to me. If the circles in question are exact quarter-circles, you can easily calculate the points to be {x0,y0} + r0*unitDisp, where unitDisp is {±1,0} or {0,±1}.

If the circles in question are not quarter-circles, but rather an arbitrary circular arc, the problem is much more complicated. I won't comment on it unless OP confirms this to be the case in question.

jjc385
  • 3,473
  • 1
  • 17
  • 29