Estimating parameters p and q in y'' + p y' + q y = Tide(t)

• To: mathgroup at smc.vnet.net
• Subject: [mg46255] Estimating parameters p and q in y'' + p y' + q y = Tide(t)
• From: gilmar.rodriguez at nwfwmd.state.fl.us (Gilmar Rodr?guez Pierluissi)
• Date: Thu, 12 Feb 2004 22:46:15 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```Dear Math User friends:
I have two data sets; the first one corresponds to tide data, and the
second one corresponds to
water elevation data obtained from a groundwater monitoring well.  The
tide affects the water level
inside the well.  If we let the variable y(t) represent the height of
the water column inside the pipe,
and Tide(t) be a least square fit representation of our tide record,
with t representing time,
then we can form a Differential Equation:  y'' + p y' + q y = Tide(t),
where Tide(t) acts as a forcing
function.  Since I have a water elevation record; what I'm seeking is
to find a way to estimate
two values p and q, such that the solution y(t) to the above DE,
becomes a model that fits my
water elevation data; i.e. a model in the least square sense, showing
a correlation (of say) 0.95,
or above.  The following is an unevaluated Mathematica notebook to
elaborate this question
with the aid of a specific example. Please copy the following text and
Notepad and save it as DE.txt  Then change the name of this file to
DE.nb, (ignore the "are you
sure that you want to  change extention name" message) and open the
new notebook using
Mathematica (version 5.0, or version above 5.0) as usual.  Thank you

Start copying here:
(************** Content-type: application/mathematica **************
CreatedBy='Mathematica 5.0'

Mathematica-Compatible Notebook

This notebook can be used with any Mathematica-compatible
application, such as Mathematica, MathReader or Publicon. The data
for the notebook starts with the line containing stars above.

To get the notebook into a Mathematica-compatible application, do
one of the following:

* Save the data starting with the line of stars above into a file
with a name ending in .nb, then open the file inside the
application;

* Copy the data starting with the line of stars above to the
clipboard, then use the Paste menu command inside the application.

Data for notebooks contains only printable 7-bit ASCII and can be
sent directly in email or through ftp in text mode.  Newlines can be
CR, LF or CRLF (Unix, Macintosh or MS-DOS style).

NOTE: If you modify the data for this notebook not in a Mathematica-
compatible application, you must delete the line below containing
the word CacheID, otherwise Mathematica-compatible applications may
try to use invalid cache data.

applications, contact Wolfram Research:
web: http://www.wolfram.com
email: info at wolfram.com
phone: +1-217-398-0700 (U.S.)

Notebook reader applications are available free of charge from
Wolfram Research.
*******************************************************************)

(*CacheID: 232*)

(*NotebookFileLineBreakTest
NotebookFileLineBreakTest*)
(*NotebookOptionsPosition[     21225,        425]*)
(*NotebookOutlinePosition[     21931,        449]*)
(*  CellTagsIndexPosition[     21887,        445]*)
(*WindowFrame->Normal*)

Notebook[{
Cell[BoxData[
StyleBox[\( (*\(\(*\)\(\ \)\(I\)\(\ \)\(have\)\(\ \)\(two\)\(\
\)\(data\)\
\(\ \)\(sets\)\); \ the\ first\ one\ corresponds\ to\ tide\ data, \
and\ the\ second\ one\ corresponds\ to\n
water\ elevation\ data\ obtained\ from\ a\ groundwater\
monitoring\ \
well . \ \ The\ tide\ affects\ the\ water\ level\n
inside\ the\ well . \ \ If\ we\ let\ the\ variable\ y
\((t)\)\ \
represent\ the\ height\ of\ the\ water\ column\ inside\ the\ pipe, \n
and\ Tide \((t)\)\ be\ a\ least\ square\ fit\ representation\
of\ our\
\ tide\ record, \ with\ t\ reperesenting\ time, \n
then\ we\ can\ form\ a\ Differential\ \(Equation : \ \ y''\  +
\
p\ y'\  + \ q\ y\)\  = \ Tide \((t)\), \
where\ Tide \((t)\)\ acts\ as\ a\ forcing\n
function . \ \ Since\ I\ have\ a\ water\ elevation\ record;
\
what\ I' m\ seeking\ is\ to\ find\ a\ way\ to\ estimate\n
two\ values\ p\ and\ q, \
such\ that\ the\ solution\ y \((t)\)\ to\ the\ above\ DE, \
becomes\ a\ model\ that\ fits\ my\nwater\ elevation\ data; \
i . e . \ a\ model\ in\ the\ least\ square\ sense, \
showing\ a\ correlation\ \((of\ say)\)\ 0.95, \n
or\ above . \ \ The\ following\ example\ is\ an\ attempt\ to\
clarify\
\ my\ \(question : \n\(\(Here\ is\ the\ tide\ record\ \((the\ values\
are\ \
measured\ in\ decimal\ meters)\)\)\(:\)\)\)\ **) \),
FormatType->StandardForm,
FontFamily->"Arial"]], "Input",
FontFamily->"Arial"],

Cell[BoxData[
\(\(tide = {{1,
0}, {2, \(-0.015\)}, {3, \(-0.07\)}, {4, \(-0.102\)}, {5,
\
\(-0.152\)}, {6, \(-0.221\)}, {7, \(-0.259\)}, {8, \(-0.303\)}, {9, \
\(-0.361\)}, {10, \(-0.407\)}, {11, \(-0.456\)}, {12, \(-0.496\)},
{13, \
\(-0.547\)}, {14, \(-0.613\)}, {15, \(-0.65\)}, {16, \(-0.662\)}, {17,
\
\(-0.691\)}, {18, \(-0.733\)}, {19, \(-0.763\)}, {20, \(-0.807\)},
{21, \
\(-0.814\)}, {22, \(-0.822\)}, {23, \(-0.784\)}, {24, \(-0.762\)},
{25, \
\(-0.756\)}, {26, \(-0.755\)}, {27, \(-0.743\)}, {28, \(-0.714\)},
{29, \
\(-0.688\)}, {30, \(-0.672\)}, {31, \(-0.632\)}, {32, \(-0.609\)},
{33, \
\(-0.552\)}, {34, \(-0.475\)}, {35, \(-0.443\)}, {36, \(-0.373\)},
{37, \
\(-0.34\)}, {38, \(-0.293\)}, {39, \(-0.232\)}, {40, \(-0.214\)}, {41,
\
\(-0.152\)}, {42, \(-0.112\)}, {43, \(-0.082\)}, {44, \(-0.072\)},
{45, \
\(-0.075\)}, {46, \(-0.073\)}, {47, \(-0.071\)}, {48, \(-0.072\)},
{49, \
\(-0.078\)}, {50, \(-0.109\)}, {51, \(-0.113\)}, {52, \(-0.144\)},
{53, \
\(-0.165\)}, {54, \(-0.181\)}, {55, \(-0.202\)}, {56, \(-0.21\)}, {57,
\
\(-0.248\)}, {58, \(-0.284\)}, {59, \(-0.327\)}, {60, \(-0.363\)},
{61, \
\(-0.403\)}, {62, \(-0.432\)}, {63, \(-0.477\)}, {64, \(-0.522\)},
{65, \
\(-0.569\)}, {66, \(-0.584\)}, {67, \(-0.617\)}, {68, \(-0.631\)},
{69, \
\(-0.63\)}, {70, \(-0.626\)}, {71, \(-0.611\)}, {72, \(-0.622\)}, {73,
\
\(-0.593\)}, {74, \(-0.567\)}, {75, \(-0.549\)}, {76, \(-0.525\)},
{77, \
\(-0.503\)}, {78, \(-0.48\)}, {79, \(-0.445\)}, {80, \(-0.406\)}, {81,
\
\(-0.363\)}, {82, \(-0.326\)}, {83, \(-0.279\)}, {84, \(-0.246\)},
{85, \
\(-0.197\)}, {86, \(-0.145\)}, {87, \(-0.119\)}, {88, \(-0.061\)},
{89, \
\(-0.021\)}, {90, 0.026}, {91, 0.032}, {92, 0.059}, {93, 0.068}, {94,
0.059}, {95, 0.08}, {96, 0.084}, {97, 0.065}, {98,
0.044}, {99, \(-0.021\)}, {100, \(-0.014\)}, {101,
\(-0.053\)}, \
{102, \(-0.068\)}, {103, \(-0.101\)}, {104, \(-0.145\)}, {105,
\(-0.212\)}, \
{106, \(-0.26\)}, {107, \(-0.319\)}, {108, \(-0.346\)}, {109,
\(-0.378\)}, \
{110, \(-0.438\)}, {111, \(-0.496\)}, {112, \(-0.55\)}, {113,
\(-0.599\)}, \
{114, \(-0.64\)}, {115, \(-0.684\)}, {116, \(-0.708\)}, {117,
\(-0.735\)}, \
{118, \(-0.757\)}, {119, \(-0.785\)}, {120, \(-0.797\)}, {121,
\(-0.786\)}, \
{122, \(-0.781\)}, {123, \(-0.767\)}, {124, \(-0.746\)}, {125,
\(-0.72\)}, \
{126, \(-0.686\)}, {127, \(-0.672\)}, {128, \(-0.648\)}, {129,
\(-0.634\)}, \
{130, \(-0.593\)}, {131, \(-0.54\)}, {132, \(-0.512\)}, {133,
\(-0.466\)}, \
{134, \(-0.425\)}, {135, \(-0.371\)}, {136, \(-0.308\)}, {137,
\(-0.266\)}, \
{138, \(-0.219\)}, {139, \(-0.182\)}, {140, \(-0.149\)}, {141,
\(-0.114\)}, \
{142, \(-0.107\)}, {143, \(-0.102\)}, {144, \(-0.08\)}, {145,
\(-0.1\)}, \
{146, \(-0.127\)}, {147, \(-0.143\)}, {148, \(-0.179\)}, {149,
\(-0.175\)}, \
{150, \(-0.181\)}, {151, \(-0.215\)}, {152, \(-0.231\)}, {153,
\(-0.264\)}, \
{154, \(-0.323\)}, {155, \(-0.373\)}, {156, \(-0.431\)}, {157,
\(-0.481\)}, \
{158, \(-0.525\)}, {159, \(-0.58\)}, {160, \(-0.629\)}, {161,
\(-0.674\)}, \
{162, \(-0.726\)}, {163, \(-0.766\)}, {164, \(-0.825\)}, {165,
\(-0.845\)}, \
{166, \(-0.864\)}, {167, \(-0.891\)}, {168, \(-0.889\)}, {169,
\(-0.895\)}, \
{170, \(-0.883\)}, {171, \(-0.876\)}, {172, \(-0.821\)}, {173,
\(-0.818\)}, \
{174, \(-0.802\)}, {175, \(-0.76\)}, {176, \(-0.731\)}, {177,
\(-0.696\)}, \
{178, \(-0.672\)}, {179, \(-0.631\)}, {180, \(-0.592\)}, {181,
\(-0.548\)}, \
{182, \(-0.495\)}, {183, \(-0.441\)}, {184, \(-0.38\)}, {185,
\(-0.333\)}, \
{186, \(-0.265\)}, {187, \(-0.185\)}, {188, \(-0.155\)}, {189,
\(-0.116\)}, \
{190, \(-0.101\)}, {191, \(-0.074\)}, {192, \(-0.029\)}, {193,
\(-0.005\)}, \
{194, 0.001}, {195, 0.029}, {196,
0.001}, {197, \(-0.019\)}, {198, \(-0.053\)}, {199,
\(-0.081\)}, \
{200, \(-0.097\)}, {201, \(-0.152\)}, {202, \(-0.185\)}, {203,
\(-0.206\)}, \
{204, \(-0.219\)}, {205, \(-0.261\)}, {206, \(-0.282\)}, {207,
\(-0.331\)}, \
{208, \(-0.378\)}, {209, \(-0.455\)}, {210, \(-0.495\)}, {211,
\(-0.556\)}, \
{212, \(-0.599\)}, {213, \(-0.639\)}, {214, \(-0.637\)}, {215,
\(-0.667\)}, \
{216, \(-0.673\)}, {217, \(-0.695\)}, {218, \(-0.7\)}, {219,
\(-0.687\)}, \
{220, \(-0.687\)}, {221, \(-0.683\)}, {222, \(-0.656\)}, {223,
\(-0.631\)}, \
{224, \(-0.616\)}, {225, \(-0.578\)}, {226, \(-0.534\)}, {227,
\(-0.482\)}, \
{228, \(-0.428\)}, {229, \(-0.345\)}, {230, \(-0.313\)}, {231,
\(-0.282\)}, \
{232, \(-0.25\)}, {233, \(-0.218\)}, {234, \(-0.187\)}, {235,
\(-0.155\)}, \
{236, \(-0.139\)}, {237, \(-0.099\)}, {238, \(-0.083\)}, {239,
\(-0.076\)}, \
{240, \(-0.054\)}, {241, \(-0.047\)}, {242, \(-0.064\)}, {243,
\(-0.038\)}, \
{244, \(-0.043\)}, {245, \(-0.06\)}, {246, \(-0.056\)}, {247,
\(-0.077\)}, \
{248, \(-0.106\)}, {249, \(-0.134\)}, {250, \(-0.212\)}, {251,
\(-0.269\)}, \
{252, \(-0.327\)}, {253, \(-0.386\)}, {254, \(-0.443\)}, {255,
\(-0.476\)}, \
{256, \(-0.525\)}, {257, \(-0.608\)}, {258, \(-0.665\)}, {259,
\(-0.71\)}, \
{260, \(-0.723\)}, {261, \(-0.756\)}, {262, \(-0.784\)}, {263,
\(-0.807\)}, \
{264, \(-0.845\)}};\)\)], "Input",
FontFamily->"Arial"],

Cell[BoxData[
\(L = Length[tide]\)], "Input",
FontFamily->"Arial"],

Cell[BoxData[
\(plt1 =
ListPlot[tide, PlotJoined \[Rule] True,
PlotStyle \[Rule] RGBColor[1, 0, 0]]\)], "Input",
FontFamily->"Arial"],

Cell[BoxData[
\(\(initparams = {{a\_0, \(-0.31278\)}, {a\_1, \(-0.21078\)},
{a\_2, \
\(-0.12503\)}, {a\_3, \(-0.03388\)}, {a\_4, \(-0.34959\)}, {b\_1,
8.093077}, {b\_2, 10.51904}, {b\_3, 2.014087}, {b\_4,
7.077294}, {c\_1, \(-0.05472\)}, {c\_2, \(-0.05678\)},
{c\_3, \
\(-0.1125\)}, {c\_4, \(-0.06463\)}, {d\_1, \(-5.01326\)}, {d\_2, \
\(-6.27323\)}, {d\_3, \(-1.67511\)}, {d\_4, \(-10.6115\)}, {v\_1,
0.126851}, {v\_2, 0.135713}, {v\_3, 0.089487}, {v\_4,
0.130158}, {w\_1, 0.049697}, {w\_2,
0.049183}, {w\_3, \(-0.00844\)}, {w\_4, 0.046353}};\)\)],
"Input",\

FontFamily->"Arial"],

Cell[BoxData[
\(\(model\  = \
a\_0 + Sum[a\_i*Sin[v\_i*t - b\_i], {i, 1, 4}] +
Sum[c\_i*Sin[w\_i*t - d\_i], {i, 1, 4}];\)\)], "Input",
FontFamily->"Arial"],

Cell[BoxData[
\(<< Statistics`NonlinearFit`\)], "Input",
FontFamily->"Arial"],

Cell[BoxData[
RowBox[{\(TIDE[t_]\), "=",
RowBox[{"Chop", "[",
RowBox[{"NonlinearFit", "[",
RowBox[{"tide", ",", "model", ",", "t", ",", "initparams",
",",
FormBox[
FormBox[\(AccuracyGoal \[Rule] 2\),
FontFamily->"Arial"],

Cell[BoxData[
\(plt2 =
Plot[TIDE[t], {t, 1, 264}, PlotStyle -> RGBColor[0, 1, 0]]\)],
"Input",
FontFamily->"Arial"],

Cell[BoxData[
\(Show[{plt1, plt2}, ImageSize\  \[Rule] \ 540]\)], "Input",
FontFamily->"Arial"],

Cell[BoxData[
\( (*\(\(*\)\(\ \)\(Gravitational\)\(\ \)\(Constant\)\(\
\)\(G\)\)\  = \
9.8\ m/sec\^2\ **) \)], "Input",
FontFamily->"Arial"],

Cell[BoxData[
\( (*\(*\)\(\ \)\(Tide\)\(\ \)\(acting\)\(\ \)\(as\)\(\ \)\(a\)\(\
\
\)\(Forcing\)\(\ \)\(Function\)\(\ \)\(term\)\(\ \)\(in\)\(\
\)\(the\)\(\ \
\)\(following\)\(\ \)\(Differential\)\(\ \)\(\(Equation\)\(:\)\)\ **)
\)], \
"Input",
FontFamily->"Arial"],

Cell[BoxData[
RowBox[{"(*",
RowBox[{\(\(\(*\)\(\ \)\(Using\)\(\ \)\("\<trial and
error\>"\)\(\ \
\)\(we\)\(\ \)\(are\)\(\ \)\(using\)\(\ \)\(values : \ p\)\)\  = \
9.8\ \((buoyancy\ factor)\)\), ",", " ", \(q = 1\), ",",
" ", \(and\ two\ initial\ conditions; \ y[0] = 0\), ",", " ",
RowBox[{
RowBox[{"and", " ",
RowBox[{
SuperscriptBox["y", "\[Prime]",
MultilineFunction->None], "[", "0", "]"}]}], "=",
"1"}], ",",
" ", \(to\ set\ up\ our\ differential\
\(\(equation\)\(:\)\)\)}],
"**)"}]], "Input",
FontFamily->"Arial"],

Cell[BoxData[
RowBox[{
RowBox[{"solution", "=",
RowBox[{"NDSolve", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{
RowBox[{
RowBox[{
SuperscriptBox["y", "\[DoublePrime]",
MultilineFunction->None], "[", "t", "]"}],
"+",
RowBox[{\((9.8)\), "*",
RowBox[{
SuperscriptBox["y", "\[Prime]",
MultilineFunction->None], "[", "t", "]"}]}],
"+", \(y[t]\)}], "\[Equal]", \(TIDE[t]\)}],
",", \(y[0] \[Equal] 0\), ",",
RowBox[{
RowBox[{
SuperscriptBox["y", "\[Prime]",
MultilineFunction->None], "[", "0", "]"}],
"\[Equal]",
"1"}]}], "}"}], ",", "y", ",", \({t, 0, L}\)}],
"]"}]}],
";"}]], "Input",
FontFamily->"Arial"],

Cell[BoxData[
\(\(plt3 =
Plot[y[t] /. solution, {t, 0, L},
PlotStyle \[Rule] RGBColor[1, 0, 1]];\)\)], "Input",
FontFamily->"Arial"],

Cell[BoxData[
\( (*\(\(*\)\(\ \)\(Here\)\(\ \)\(is\)\(\ \)\(the\)\(\
\)\(elevation\)\(\ \
\)\(data\)\); \ \(\(i . e . \
the\ water\ elevation\ data\ obtained\ from\ a\
groundwater\ \
monitoring\ well\ \((the\ values\ are\ measured\ in\ decimal\ \
meters)\)\)\(:\)\)\ **) \)], "Input",
FontFamily->"Arial"],

Cell[BoxData[
StyleBox[\(Elev = {{1, 0. }, {2, 0.002}, {3, 0.006}, {4, 0.006},
{5,
0.008}, {6, 0.008}, {7, 0.008}, {8, 0.006}, {9, 0.007},
{10,
0.006}, {11, 0.009}, \n\ \ \ \ \ \ \ \ {12, 0.013}, {13,
0.009}, {14, 0.004}, {15, 0.004}, {16, 0.004}, {17,
0.003}, {18, 0.002}, {19, 0. }, {20, 0. }, {21,
0. }, {22, \(-0.002\)}, \n\ \ \ \ \ \ \ \ {23,
\(-0.004\)}, \
{24, \(-0.005\)}, {25, \(-0.005\)}, {26, \(-0.006\)}, {27,
\(-0.005\)}, {28, \
\(-0.004\)}, {29, \(-0.006\)}, {30, \(-0.009\)}, {31, \(-0.008\)}, \n\
\ \ \ \
\ \ \ \ {32, \(-0.009\)}, {33, \(-0.009\)}, {34, \(-0.01\)}, {35, \
\(-0.009\)}, {36, \(-0.009\)}, {37, \(-0.008\)}, {38, \(-0.01\)}, {39,
\
\(-0.007\)}, {40, \(-0.009\)}, \n\ \ \ \ \ \ \ \ {41, \(-0.008\)},
{42, \
\(-0.007\)}, {43, \(-0.007\)}, {44, \(-0.005\)}, {45, \(-0.005\)},
{46, \
\(-0.004\)}, {47, \(-0.004\)}, {48, \(-0.004\)}, {49, \(-0.003\)}, \n\
\ \ \ \
\ \ \ \ {50, \(-0.003\)}, {51, \(-0.001\)}, {52, 0. }, {53, 0. }, {54,
0.002}, {55, 0.002}, {56, 0.003}, {57, 0.003}, {58,
0.003}, {59, 0.004}, \n\ \ \ \ \ \ \ \ {60, 0.004}, {61,
0.004}, {62, 0.002}, {63, 0.002}, {64, 0.002}, {65,
0. }, {66, \(-0.001\)}, {67, \(-0.002\)}, {68,
\(-0.003\)}, \
{69, \(-0.004\)}, \n\ \ \ \ \ \ \ \ {70, \(-0.004\)}, {71,
\(-0.005\)}, {72, \
\(-0.006\)}, {73, \(-0.007\)}, {74, \(-0.007\)}, {75, \(-0.008\)},
{76, \
\(-0.009\)}, {77, \(-0.011\)}, {78, \(-0.011\)}, \n\ \ \ \ \ \ \ \
{79, \
\(-0.013\)}, {80, \(-0.013\)}, {81, \(-0.012\)}, {82, \(-0.013\)},
{83, \
\(-0.013\)}, {84, \(-0.013\)}, {85, \(-0.011\)}, {86, \(-0.01\)}, {87,
\
\(-0.011\)}, \n\ \ \ \ \ \ \ \ {88, \(-0.013\)}, {89, \(-0.005\)},
{90, \
\(-0.009\)}, {91, \(-0.005\)}, {92, \(-0.011\)}, {93, \(-0.007\)},
{94, \
\(-0.007\)}, {95, \(-0.006\)}, {96, \(-0.003\)}, \n\ \ \ \ \ \ \ \
{97, \
\(-0.002\)}, {98, 0. }, {99, \(-0.001\)}, {100, 0.001}, {101,
0.002}, {102, \(-0.004\)}, {103, 0.003}, {104, 0.003},
{105,
0.004}, \n\ \ \ \ \ \ \ \ {106, 0.004}, {107, 0.004},
{108,
0.004}, {109, 0.005}, {110, 0.005}, {111, 0.004}, {112,
0.003}, {113, 0.002}, {114,
0.001}, \n\ \ \ \ \ \ \ \ {115, \(-0.001\)}, {116,
\(-0.002\)}, \
{117, \(-0.003\)}, {118, \(-0.004\)}, {119, \(-0.004\)}, {120,
\(-0.004\)}, \
{121, \(-0.005\)}, {122, \(-0.007\)}, \n\ \ \ \ \ \ \ \ {123,
\(-0.008\)}, \
{124, \(-0.01\)}, {125, \(-0.011\)}, {126, \(-0.011\)}, {127,
\(-0.012\)}, \
{128, \(-0.013\)}, {129, \(-0.014\)}, {130, \(-0.014\)}, \n\ \ \ \ \ \
\ \ \
{131, \(-0.013\)}, {132, \(-0.014\)}, {133, \(-0.014\)}, {134,
\(-0.014\)}, \
{135, \(-0.015\)}, {136, \(-0.014\)}, {137, \(-0.014\)}, {138,
\(-0.015\)}, \n\
\ \ \ \ \ \ \ \ {139, \(-0.014\)}, {140, \(-0.014\)}, {141,
\(-0.012\)}, \
{142, \(-0.011\)}, {143, \(-0.011\)}, {144, \(-0.009\)}, {145,
\(-0.009\)}, \
{146, \(-0.007\)}, \n\ \ \ \ \ \ \ \ {147, \(-0.007\)}, {148,
\(-0.006\)}, \
{149, \(-0.004\)}, {150, \(-0.004\)}, {151, \(-0.004\)}, {152,
\(-0.004\)}, \
{153, \(-0.003\)}, {154, \(-0.003\)}, \n\ \ \ \ \ \ \ \ {155,
\(-0.003\)}, \
{156, \(-0.004\)}, {157, \(-0.004\)}, {158, \(-0.004\)}, {159,
\(-0.004\)}, \
{160, \(-0.004\)}, {161, \(-0.004\)}, {162, \(-0.005\)}, \n\ \ \ \ \ \
\ \ \
{163, \(-0.006\)}, {164, \(-0.007\)}, {165, \(-0.007\)}, {166,
\(-0.008\)}, \
{167, \(-0.01\)}, {168, \(-0.011\)}, {169, \(-0.011\)}, {170,
\(-0.013\)}, \n\
\ \ \ \ \ \ \ \ {171, \(-0.015\)}, {172, \(-0.017\)}, {173,
\(-0.017\)}, \
{174, \(-0.018\)}, {175, \(-0.018\)}, {176, \(-0.018\)}, {177,
\(-0.018\)}, \
{178, \(-0.019\)}, \n\ \ \ \ \ \ \ \ {179, \(-0.02\)}, {180,
\(-0.021\)}, \
{181, \(-0.021\)}, {182, \(-0.021\)}, {183, \(-0.021\)}, {184,
\(-0.022\)}, \
{185, \(-0.019\)}, {186, \(-0.021\)}, \n\ \ \ \ \ \ \ \ {187,
\(-0.02\)}, \
{188, \(-0.018\)}, {189, \(-0.017\)}, {190, \(-0.017\)}, {191,
\(-0.011\)}, \
{192, \(-0.014\)}, {193, \(-0.011\)}, {194, \(-0.011\)}, \n\ \ \ \ \ \
\ \ \
{195, \(-0.01\)}, {196, \(-0.01\)}, {197, \(-0.005\)}, {198,
\(-0.008\)}, \
{199, \(-0.008\)}, {200, \(-0.006\)}, {201, \(-0.004\)}, {202,
\(-0.004\)}, \n\
\ \ \ \ \ \ \ \ {203, \(-0.006\)}, {204, \(-0.005\)}, {205,
\(-0.003\)}, \
{206, \(-0.004\)}, {207, \(-0.003\)}, {208, \(-0.003\)}, {209,
\(-0.003\)}, \
{210, \(-0.004\)}, \n\ \ \ \ \ \ \ \ {211, \(-0.004\)}, {212,
\(-0.004\)}, \
{213, \(-0.005\)}, {214, \(-0.005\)}, {215, \(-0.006\)}, {216,
\(-0.008\)}, \
{217, \(-0.008\)}, {218, \(-0.01\)}, \n\ \ \ \ \ \ \ \ {219,
\(-0.011\)}, \
{220, \(-0.013\)}, {221, \(-0.013\)}, {222, \(-0.015\)}, {223,
\(-0.017\)}, \
{224, \(-0.018\)}, {225, \(-0.018\)}, {226, \(-0.018\)}, \n\ \ \ \ \ \
\ \ \
{227, \(-0.018\)}, {228, \(-0.018\)}, {229, \(-0.02\)}, {230,
\(-0.02\)}, \
{231, \(-0.019\)}, {232, \(-0.023\)}, {233, \(-0.02\)}, {234,
\(-0.021\)}, \n\
\ \ \ \ \ \ \ \ {235, \(-0.02\)}, {236, \(-0.019\)}, {237,
\(-0.018\)}, {238, \
\(-0.016\)}, {239, \(-0.016\)}, {240, \(-0.014\)}, {241, \(-0.013\)},
{242, \
\(-0.013\)}, \n\ \ \ \ \ \ \ \ {243, \(-0.012\)}, {244, \(-0.011\)},
{245, \
\(-0.01\)}, {246, \(-0.009\)}, {247, \(-0.009\)}, {248, \(-0.007\)},
{249, \
\(-0.005\)}, {250, \(-0.004\)}, \n\ \ \ \ \ \ \ \ {251, \(-0.004\)},
{252, \
\(-0.004\)}, {253, \(-0.003\)}, {254, \(-0.004\)}, {255, \(-0.005\)},
{256, \
\(-0.004\)}, {257, \(-0.005\)}, {258, \(-0.006\)}, \n\ \ \ \ \ \ \ \
{259, \
\(-0.007\)}, {260, \(-0.007\)}, {261, \(-0.008\)}, {262, \(-0.009\)},
{263, \
\(-0.01\)}, {264, \(-0.011\)}, {265, \(-0.011\)}, {266, \(-0.012\)},
\n\ \ \ \
\ \ \ \ \ {267, \(-0.013\)}, {268, \(-0.017\)}, {269, \(-0.017\)}};\),
FormatType->StandardForm,
FontFamily->"Arial",
FontSize->12]], "Input",
FontFamily->"Arial"],

Cell[BoxData[
\(Length[Elev]\)], "Input",
FontFamily->"Arial"],

Cell[BoxData[
\( (*\(\(*\)\(\ \)\(To\)\(\ \)\(compare\)\(\ \)\(our\)\(\ \
\)\(solution\)\(\ \)\(model\)\(\ \)\(to\)\(\ \)\(the\)\(\
\)\(elevation\)\(\ \
\)\(record\)\); \
it\ is\ necessary\ to\ magnify\ the\ elevation\ record\ by\ a\
factor\ \
of\ 50. \ \ There\ is\ also\ a\ time\ lag\ between\ the\ solution\
model\ and\
\ the\ elevation\ record\ of\ 6\ time\ \(\(units\)\(:\)\)\ **) \)],
"Input",
FontFamily->"Arial"],

Cell[BoxData[
\(\(M = 50;\)\)], "Input",
FontFamily->"Arial"],

Cell[BoxData[
\( (*\(*\)\(\ \)\(Lag\)\(\ \)\(\(Factor\)\(:\)\)\ **) \)],
"Input",
FontFamily->"Arial"],

Cell[BoxData[
\(\(Lag = 6;\)\)], "Input",
FontFamily->"Arial"],

Cell[BoxData[
\( (*\(*\)\(\ \)\(The\)\(\ \)\(abbreviation\)\(\
\)\("\<rsElev\>"\)\(\ \)\
\(stands\)\(\ \)\(for\)\(\ \)\("\<re-scaled Elevation\>"\)\ **) \)],
"Input"],

Cell[BoxData[
\(\(rsElev =
Table[{i - Lag, M*\(Elev[\([i]\)]\)[\([2]\)]}, {i, 1,
L}];\)\)], "Input",
FontFamily->"Arial"],

Cell[BoxData[
\(plt4 =
ListPlot[rsElev, PlotJoined \[Rule] True,
PlotStyle \[Rule] RGBColor[0, 0, 1]]\)], "Input",
FontFamily->"Arial"],

Cell[BoxData[
\( (*\(\(*\)\(\ \)\(Here\)\(\ \)\(we\)\(\ \)\(compare\)\(\
\)\(our\)\(\ \
\)\(solution\)\(\ \)\(model\)\(\ \)\(with\)\(\ \)\(our\)\(\
\)\(well\)\(\ \
\)\(elevation\)\(\ \)\(data . \ \ "\<Not close, and no cigar\>"\)\); \
because\ we\ are\ attempting\ two\ arbitrary\ values\ for\ p\
and\ \
\(\(q\)\(:\)\)\ \ **) \)], "Input"],

Cell[BoxData[
\(Show[{plt3, plt4}]\)], "Input",
FontFamily->"Arial"],

Cell[BoxData[
\( (*\(\(*\)\(\ \)\(Remark : \ \ One\ can\ see\ a\ downward\
trend\ in\ \
the\ elevation\ record . \ \ I\ don'
t\ know\ what\ physical\ factor\ "\<out there\>"\ causes\
this\ \
trend . \ \ If\ we\ could\ identify\ it\)\), \
and\ incorporate\ it\ into\ the\ Differential\ Equation;
perhaps\ our\ "\<Elevation DE Model\>"\ could\ be\ more\
accurate\ in\ \
accounting\ for\ "\<the behavior\>"\ of\ the\ elevation\
\(\(record\)\(.\)\)\ \
**) \)], "Input",
FontFamily->"Arial"],

Cell[BoxData[
StyleBox[\(\( (*\(\(*\)\(\ \)\(Again\)\); \
what\ I' m\ looking\ for\ is\ to\ find\ a\ way\ to\ estimate\n
the\ values\ p\ and\ q, \
such\ that\ the\ solution\ y \((t)\)\ to\ the\ above\ DE, \
\(becomes\
\ a\ model\ that\ fits\ my\)\n\(water\ elevation\ data; \
i . e . \ a\ model\ in\ the\ least\ square\ sense\), \
showing\ a\ correlation\ \((of\ say)\)\ 0.95, \nor\ above, \
without\ having\ to\ engage\ into\ trial\ and\
\(\(error\)\(.\)\)\ \ \
**) \)\(\ \)\),
FontFamily->"Arial"]], "Input"]
},
FrontEndVersion->"5.0 for Microsoft Windows",
ScreenRectangle->{{0, 1024}, {0, 680}},
WindowSize->{1016, 648},
WindowMargins->{{0, Automatic}, {Automatic, 0}},
PrintingCopies->1,
PrintingPageRange->{Automatic, Automatic}
]

(*******************************************************************
Cached data follows.  If you edit this Notebook file directly, not
using Mathematica, you must remove the line containing CacheID at
the top of  the file.  The cache data will then be recreated when
you save this file from within Mathematica.
*******************************************************************)

(*CellTagsOutline
CellTagsIndex->{}
*)

(*CellTagsIndex
CellTagsIndex->{}
*)

(*NotebookFileOutline
Notebook[{
Cell[1754, 51, 1536, 25, 200, "Input"],
Cell[3293, 78, 5062, 69, 542, "Input"],
Cell[8358, 149, 72, 2, 29, "Input"],
Cell[8433, 153, 155, 4, 29, "Input"],
Cell[8591, 159, 652, 11, 67, "Input"],
Cell[9246, 172, 181, 4, 29, "Input"],
Cell[9430, 178, 83, 2, 29, "Input"],
Cell[9516, 182, 378, 9, 29, "Input"],
Cell[9897, 193, 128, 3, 29, "Input"],
Cell[10028, 198, 101, 2, 29, "Input"],
Cell[10132, 202, 155, 3, 31, "Input"],
Cell[10290, 207, 271, 5, 29, "Input"],
Cell[10564, 214, 631, 13, 48, "Input"],
Cell[11198, 229, 994, 24, 29, "Input"],
Cell[12195, 255, 158, 4, 29, "Input"],
Cell[12356, 261, 324, 6, 29, "Input"],
Cell[12683, 269, 5762, 79, 618, "Input"],
Cell[18448, 350, 68, 2, 29, "Input"],
Cell[18519, 354, 433, 7, 67, "Input"],
Cell[18955, 363, 67, 2, 29, "Input"],
Cell[19025, 367, 108, 2, 29, "Input"],
Cell[19136, 371, 68, 2, 29, "Input"],
Cell[19207, 375, 170, 2, 30, "Input"],
Cell[19380, 379, 149, 4, 29, "Input"],
Cell[19532, 385, 157, 4, 29, "Input"],
Cell[19692, 391, 350, 5, 50, "Input"],
Cell[20045, 398, 74, 2, 29, "Input"],
Cell[20122, 402, 519, 9, 67, "Input"],
Cell[20644, 413, 577, 10, 86, "Input"]
}
]
*)

(*******************************************************************
End of Mathematica Notebook file.
*******************************************************************)

```

• Prev by Date: Re: Mathematica 2.2 and 'EllipticIntegrate' package problem
• Next by Date: Re: how to plot with logarithmic scale on X-axis ?
• Previous by thread: Re: how to explain this weird effect? Integrate
• Next by thread: Re: Estimating parameters p and q in y'' + p y' + q y = Tide(t)