ndCurveMaster

Discovering Physical Equations

This example shows how ndCurveMaster can be used to discover physical equations from data.

This tutorial includes three examples:

  1. the relationship between acceleration, distance, and time,
  2. the equivalent resistance equation,
  3. Coulomb's law.

In all examples, the proper selection of base functions is crucial. The goal is to limit the function set to forms that may lead to the discovery of a real physical relationship.

1. Discovering the acceleration equation

We load the file Acceleration.txt, which you can download here: Acceleration.txt. The file contains values of distance, time, and acceleration calculated on the basis of distance and time.

As the dependent variable Y, we choose a, while as the independent variables X, we choose s and t.

We select the Add combination of X variables option so that the program also includes combinations of the X variables.

Settings for discovering the acceleration equation from data

A key step is preparing a custom set of functions that contains only the basic functions needed to discover physical relationships. To do this, in the Search options field we choose Custom search with user-defined functions and enter the following functions:

q^2
q^3
q^-1
q^-2
q^-3
q^0.5
q^-0.5

The symbol q represents a variable.

Details about custom functions are described here:

https://www.ndcurvemaster.com/help-882/custom_collection.html

We do not select the Multicollinearity detection option or any options related to overfitting detection.

At the beginning, a window appears with a linear model that also includes combinations of variables:

Initial linear model for acceleration data

In the Settings window, we clear all search-criteria filters:

Search criteria filter settings

In the Search Strategy section, we extend the duration of the first search phase to 1 minute and 30 seconds, and we enable the detailed iterative algorithm for the second phase.

After closing the Settings window, we click the Advanced Search button.

A search window should appear:

First phase of equation discovery for acceleration

Then a list of discovered equations appears:

List of discovered acceleration equations

The predictors of the most accurate equation have the following statistics:

Predictor statistics for acceleration model

It can be seen that the last predictor, s^-0.5*t^-1, has the highest SA% value, whereas the SA% values for the other predictors are much lower. This means that this predictor may represent the correct physical relationship.

Now the model should be simplified by keeping only this significant predictor. We also remove the constant term a0, because we are looking for a physical equation without a constant.

To do this, we click the Manually Reduce button, and in the new window we select the predictor of interest and clear the others:

Manual reduction of the acceleration model

After confirmation, the following model appears:

Reduced acceleration model

Next, we click the Random Search button.

After some time, the following solution should appear:

Discovered acceleration equation from data

As can be seen, the program found the correct relationship between acceleration a, distance s, and time t:

a = 2 · s · t^-2

2. Discovering the equivalent resistance equation

Now, using the same method, we will discover the resistance equation. To do this, we load the file Resistance.txt, which you can download here: Resistance.txt, and choose the following settings:

Settings for discovering the equivalent resistance equation

As Search options, we choose the same function set as in the previous example.

Next, we click OK, and then the Advanced Search button.

After the specified time has elapsed, a window appears showing the model results for resistance.

It can be seen that in equation id: 92, the most important predictors are R1^-1, R2^-1, and R3^-0.5. For these predictors, the SA% indicator is significantly higher than for the others:

Most important predictors in the resistance model

Therefore, we keep only these three predictors and remove the others by clicking the Manually Reduce button:

Reduction of the equivalent resistance model

Next, we click the Random Search button.

After finding the optimal equation id: 94, the program stops the calculations. The result is shown below:

Final equivalent resistance model

It can be seen that ndCurveMaster found the correct resistance equation:

1/R = 1 · R1^-1 + 1 · R2^-1 + 1 · R3^-1

3. Discovering Coulomb's law from data

Now we will discover Coulomb's law from data. We load the file Coulomb's_law.txt, which you can download here: Coulomb's_law.txt, and use the same settings as in the previous examples:

Settings for discovering Coulomb's law from data

After loading the data, we click Advanced Search. After a moment, the following solution appears:

Search result for Coulomb's law equation discovery

It is clearly visible that in model id: 75, the last predictor is the most significant.

We click the Manually Reduce button and select only this predictor:

Reduction of the Coulomb's law model

There is no need to continue the search using Random Search, because the discovered model already represents Coulomb's law:

Final Coulomb's law model

The obtained equation has the following form:

F = 1 · Q1 · Q2 · r^-2

ndCurveMaster files to download

Here you can download the ndCurveMaster files containing these three analyses: