From: Beaver on
My problem is following:

I have velocity u and depth z data matrix (1x100). And have to find answer to the du/dz.

I know the answer when I have u like a equation - u=2*z+21. But how i manage this problem when I have numerical input data.

Thanks
From: Beaver on
in Matlab
From: us on
Beaver <marden.nomm(a)gmail.com> wrote in message <1892926589.71940.1273005012321.JavaMail.root(a)gallium.mathforum.org>...
> in Matlab

that's exactly right...

us
From: Walter Roberson on
Beaver wrote:
> My problem is following:
>
> I have velocity u and depth z data matrix (1x100). And have to find answer to the du/dz.
>
> I know the answer when I have u like a equation - u=2*z+21. But how i manage this problem when I have numerical input data.

It is impossible to do when you have a finite amount of sampled input data; it
would even be impossible to do if you had an continuous (infinite) amount of
data that had been truncated to a finite precision. You cannot even always do
it if you have a continuous infinite amount of infinitely precise data.

In order to arrive at du/dz (which is a quantity defined for The Calculus Of
The Infinitesimals, and thus inherently requires infinite representation), you
need a symbolic function which is continuous -- though of course if the
symbolic function was finitely piecewise continuous, you could come up with a
finitely piecewise differential that was valid except at the transition points.

If you have a finite sampling of data, there are _always_ an infinite number
of different functions that might be the "real" function, with all of those
infinite number of functions exactly matching the known data at the known
locations.

In such a situation, if you have a model of what form the function takes, and
the function has a number of parameters with unknown values with the number of
parameters not exceeding the number of data samples you have, then you _might_
be able to calculate the unknown parameters -- but not usually, not unless you
have at most 2 data points and the parameters happen to be exact multiples of
powers of 2... You might be able to _approximate_ the parameters -- that is
somewhat more likely... if the model happens to take a fairly restricted form
such as being a pure polynomial...

Of course, your success is going to depend upon having chosen the correct
model to start with -- and most people don't. For example, there is a tendency
for people who have K data points to model their data as a polynomial of
degree K. They get out numeric solutions that might match the data as closely
as one might reasonably hope for... and yet which will very likely be the
wrong polynomial. For example, if I give you 100 points that sample what is
really a cubic polynomial, then constructing a degree-100 polynomial is almost
certainly _not_ going to result in the coefficients for degrees 4 to 100 to be
found to be precisely zero... they might be found to be quite small, but as
far as the program is concerned, there is no reason to know that the
calculated values are "noise" or genuine coefficients.


Science is a cruel task-master. It is not uncommon in science to develop a
"working model" of what is happening, and to dig into it for *years* and come
up with theories... and then a decade or a century down the road, for someone
to find new evidence or a new way of thinking about the science that shows
that a notably different mathematical form is better.

For example, the data that you have for river depth -- do you also have
readings for the solar flux that was pushing on the surface of the water, and
thus altering the depth? Sure, the solar flux might only have an effect of
(say) one part in 60,000 -- but when you are calculating a 100 degree
polynomial, a measurement error of 1 part in 60000 is enough to cause the
second coefficient (for degree 99) to change by a factor of 600, and the last
coefficient (the constant term) to change by a factor of 1 in 6E477 . Even if
you manage to avoid numeric overflow in the calculations, that would be about
like changing the constant term from 6E+235 to 1E-235 . Is your data really
measured that accurately? If not, then clearly any answers you got out from
fitting with a 100 degree polynomial would be physical nonsense.
From: TideMan on
On May 5, 8:29 am, Beaver <marden.n...(a)gmail.com> wrote:
> My problem is following:
>
> I have velocity u and depth z data matrix (1x100). And have to find answer to the du/dz.
>
> I know the answer when I have u like a equation - u=2*z+21. But how i manage this problem when I have numerical input data.
>
> Thanks

This is the absolute core of calculus.
Do you remember in High School when you learned about derivatives?
What is a derivative exactly?
Clue: it is a limit.

In numerical analysis, we cannot take limits, so we must approximate.
That's enough clues.
Come back to us with a Matlab question.

BTW, a variable that is (1x100) is not a matrix. It is a row vector.