ndCurveMaster

Calculating Constants of Differential Equations

Sometimes it is necessary to determine the constants of the general solution of a differential equation on the basis of measurements, especially when the boundary conditions are unknown or unclear.

This example shows how, knowing the general form of the solution and having measurement data, the constants of the equation can be determined using ndCurveMaster. Of course, such constants can also be calculated with other tools, but in ndCurveMaster this can be done in a simple and convenient way.

Let us assume that the deflection of an elastic beam was measured and the results were saved in the file Beam.txt, which you can download here: Beam.txt.

The equation describing this deflection is known:

EI d4y / dx4 + ky = 0 (1)

as well as its general solution:

y(x) = C1 cos x + C2 sin x + C3 cosh x + C4 sinh x (2)

The goal is to determine the constants C1–C4 of this solution.

1. Loading the data and initial settings

After loading the file Beam.txt, enter the following settings:

Initial settings for calculating constants of the differential equation

It is important to select Custom search with user-defined functions in the Search options field and enter the following functions:

cos(q)
sin(q)
cosh(q)
sinh(q)

Details about this option are described here:

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

After loading the data, a window with the basic linear model will appear:

Basic linear model before adding solution terms

This model must be replaced with the model resulting from the general solution of the equation. This means that four predictors need to be added: cos(x), sin(x), cosh(x), and sinh(x).

2. Adding the appropriate predictors

To do this, click the Manually Expand button and add the indicated predictors one by one, confirming each selection by clicking OK.

Step 1

Adding the first predictor to the differential equation model

Step 2

Adding the second predictor to the differential equation model

Step 3

Adding the third predictor to the differential equation model

Step 4

Adding the fourth predictor to the differential equation model

After adding these predictors, the model will look as follows:

Model after adding cosine, sine, hyperbolic cosine, and hyperbolic sine predictors

3. Reducing the model

Now it is enough to remove the constant term a0 and the predictor x1 from the model. To do this, click the Manually Reduce button and deselect these two elements, as shown in the figure:

Model reduction before estimating constants C1 to C4

Then click OK.

As a result, you will obtain the following model id: 6:

Final model with estimated constants of the differential equation

The equation of this model is:

y = 1.73205080573825 · cos(x) + 0.693147182595567 · sin(x) + 4.55580621799891 · cosh(x) + (-1.72737909437274) · sinh(x)

The regression coefficients of this model are, of course, the constants C1–C4 from the general solution of the equation, namely:

C1 = 1.73205080573825
C2 = 0.693147182595567
C3 = 4.55580621799891
C4 = -1.72737909437274

ndCurveMaster project file

You can download the ndCurveMaster project file for this example here: Beam.ndc