Table 1 American demographic data
Year17901800101820183018401850.
Population (×106) 3.95.37.29.612.917.123.2.
Year1860187018801890190010/920.
Population (×106) 31.4 38.6 50.2 62.9 76.0 92.0106.5
Year193019401950196019701980.
Population (×106)123.2131.7150.7179.3 204.0 226.5.
Modeling method:
It can be found that the curve of the changing law of the American population is approximately an exponential function curve, so we assume that the American population satisfies the functional relationship x=f(t), f(t)=ea+bt, and A and B are undetermined constants. According to the least square fitting principle, A and B are the minimum points of the function. Where xi is the population of the United States at the moment of ti. Use the curve fitting program "curve fitting" in MATLAB software, and the program is as follows:
Function m of exponential function file
The function f=fun 1(a, t)
f = exp(a( 1)* t+a(2));
A graphic drawing program for finding the undetermined constants in the above functions by least square fitting and testing the fitting effect.
t = 1790: 10: 1990;
x =[3.9 5.3 7.2 9.6 12.9 17. 1 23.2 3 1.4 38.6 50.2 62.9 76 ...
92 106.5 123.2 13 1.7 150.7 179.3 204 226.5 25 1.4];
plot(t,x,' * ',t,x);
a0=[0.00 1, 1];
a=curvefit('fun 1 ',a0,t,x)
ti = 1790:5:2020;
xi=fun 1(a,ti);
continue
Plot (ti, xi);
t 1 = 20 10;
x 1=fun 1(a,t 1)
delay