Class PowerLawExample

All Implemented Interfaces:
PlotChangeListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class PowerLawExample extends AExample
Example demonstrating the power-law fit (y(x) = A·x^n + C) on log-log axes.

Synthetic data is generated from a known power law, log-normal multiplicative scatter is added, and the built-in CurveDrawingMethod.POWER_LAW fitting method is applied. Displaying on log-log axes makes the power law appear as a straight line, while the nonlinear fitter works in linear space and handles the constant offset correctly.

The true parameters used are:

  • A = 2.0 (amplitude)
  • n = 1.7 (exponent; the slope on a log-log plot)
  • C = 0.0 (baseline offset — zero keeps the log-log line perfectly straight, which makes the fit easy to judge visually)

Power laws arise in scaling relationships across science and engineering: stellar luminosity vs mass, turbulence energy spectra, fractal dimensions, and Kepler's third law, among others.

See Also:
  • Constructor Details

    • PowerLawExample

      public PowerLawExample(boolean headless)
      Creates the example, optionally without showing a window.
      Parameters:
      headless - if true the window is not displayed
  • Method Details