Few more numerical methods question...?

i have few more doubts about these two numerical methods type questions ...

An equation containing the derivatives of one or more dependent variables, with respect to one or more independent variables, is said to be a differential equation

a question usually starts like this ...

find the function that gives , this instantaneous rate of change ...

take ##f(x)= x^2-3## . Add initial condition f(0) = 0 so it yields a unique solution.

##x = 0 \rightarrow f(0) = 0##

##x = 0.1 \rightarrow f(0.1) = 0 + (0.01 - 3)* 0.1 = -0.299 \ ## exact solution ##f(0.1) = 0.001 - 3 = -0.299 \ ##

etc. etc.

we get:

So the exact solution is a function ##f(x) = x^3/3-3x## and the numerical approach is a table of aproximated function values.

(I took steps of 0.1 so the difference between exact and numerical becomes visible).

this differential equation does have a condition: ##f(0) = 1##. You solve numerically by approaching f(0) as a linear function for a small step:$$f(0+\Delta x) \approx f(0) + \Delta x {dy\over dx}$$ when all you really know is $$\lim_{h\downarrow 0} {f(0+h) - f(0) \over h } = {dy\over dx} \ .$$
When you take a few steps you get a sequence of approximated function values, but not a function (in the sense of an exact prescription what to do with x to get y).

So for ##\ f(x)= y\ \ \& \ \ f(0) = 1 \ ## you have found four function values, not four functions.

So the exact solution is a function ##f(x) = x^3/3-3x## and the numerical approach is a table of approximated function values.
When you take a few steps you get a sequence of approximated function values, but not a function (in the sense of an exact prescription what to do with x to get y).
Yes. Note that replacing ##\ dy\over dx\ ## by ##\ \Delta y\over \Delta x\ ## is an approximation....

is this what we use the numerical methods for ?? to simply get approximated function values??

Related Differential Equations News on Phys.org
Chestermiller
Mentor
You are using the so-called Forward Euler finite difference approximation to carry out the numerical integration. This formula is only first order accurate in ##\Delta x##. There are higher order formulas that give much better accuracy. An example is the trapazoidal rule formula.

a question usually starts like this ...

find the function that gives , this instantaneous rate of change ...

If the precise form of the function is not known it is better to construct an approximation using the methods like ,
Forward Euler finite difference
Trapazoidal rule formula.

so we only use numerical methods If the precise form of the function is not known ...
and with numerical methods ... we get function values ... right ??

Chestermiller
Mentor
If the precise form of the function is not known it is better to construct an approximation using the methods like ,
Forward Euler finite difference
Trapazoidal rule formula.

so we only use numerical methods If the precise form of the function is not known ...
and with numerical methods ... we get function values ... right ??
I don't quite understand your question. Can you give some examples for each option.

OK let me re arrange it one more time ...
a question usually starts like this ...

find the function that gives , this instantaneous rate of change ...

i don't understand the answer part properly ...

aren't we trying to find the precise form of the function , that gave us that instantaneous rate of change ...

when do we use numerical methods ??

do we use it when the precise form of the function is not known ...

If the precise form of the function is not known it is better to construct an approximation using the methods like ,
Forward Euler finite difference
Trapezoidal rule formula.

and with numerical methods ... we get function values ... right ??

Chestermiller
Mentor
Is your question, "Under what circumstances is numerical integration used to integrate a function or to solve a first order ordinary differential equation?"

yes , exactly ...

"Under what circumstances is numerical integration used to integrate a function or to solve a first order ordinary differential equation?"

Yes. Note that replacing ##\ dy\over dx\ ## by ##\ \Delta y\over \Delta x\ ## is an approximation....

Seems to me you still have trouble understanding what you did for ##y'=y## so let's step back and treat ##y'= x^2-3## the same way. Add initial condition y(0) = 0 so it yields a unique solution.

##x = 0 \rightarrow y(0) = 0##

##x = 0.1 \rightarrow y(0.1) = 0 + (0.01 - 3)* 0.1 = -0.299 \ ## exact solution ##y(0.1) = 0.001 - 3 = -0.299 \ ##

etc. etc.

we get:

If the precise form of the function is not known it is better to construct an approximation using the methods like ,
Forward Euler finite difference
Trapazoidal rule formula.

so we only use numerical methods If the precise form of the function is not known ...
and with numerical methods ... we get function values ... right ??

Last edited:
i found some good notes online ...

http://calculuslab.deltacollege.edu/ODE/ODE-h.html

At this point in your differential equations course you should have gotten used to a few of the analytic techniques used to solve first order differential equations. The technique varies somewhat according to the form of the original equation, and you may already have seen forms classified as separable, exact, homogeneous, or linear. The method of solution of each of these forms inevitably involves some type of integration in order to eliminate the unwanted derivative.
For the most part the techniques can become rote exercises, whereby you, the student, classifies the form of the equation, then follows the appropriate recipe to solve it. This kind of repetition sounds like an ideal task for relegating to a computer.
Recall that when solving a differential equation alone we are typically led to a family of solutions, determined by the presence of one or more constants.

In order to narrow this infinity of solutions to a unique solution it is necessary to impose one or more initial conditions, depending on the order of the differential equation. When this is done we say that we are now working with a an initial value problem
We have learned theorems that guarantee to us that under the right conditions an initial value problem has a solution that both exists, and is unique on some interval containing the x-value in the initial condition(s). However, we have also seen that despite this guarantee, it is frequently impossible to actually find this solution by standard techniques.
We have learned theorems that guarantee to us that under the right conditions an initial value problem has a solution that both exists, and is unique on some interval containing the x-value in the initial condition(s). However, we have also seen that despite this guarantee, it is frequently impossible to actually find this solution by standard techniques.

What this usually means is that the solution we seek cannot be written in a form that uses a combination of the standard "elementary" mathematical functions that we are used to. This may come as a shock at first, but absolutely the same problem exists for the majority of functions you might sketch by randomly drawing a functional graph on a piece of paper. In fact we might state this fact even more strongly: The vast majority of functions from the univeral set of all possible functions cannot be described with a formula. It is not surprising then that so many differential equations have solutions that fit into this category.

So what then? Should we just banish these "impossible" differential equations from our consideration and pretend that they don't exist? That would be fine, but all too many of them are the very equations which describe "real life" physical phenomena. These are the differential equations we have to solve to model the heat flowing through a steel rod, or put a space shuttle into orbit. We can't just not solve them.

The somewhat unsatisfying truth is that we must find approximate numerical solutions to most actual applied differential equations. Now remember, these solutions will not be given by the kind of formulas we are used to. Rather, numerical solutions will be lists of points which lie, hopefully, close to the actual solution's curve.

Some numerical methods play "join the dots" with these points to mimic, as best they can, the behavior of the actual solution. One note about this kind of solution: it can't contain any arbitrary constants. We get one solution, not a family of solutions. This means that the problems we solve must be initial value problems
yes , exactly ...

"Under what circumstances is numerical integration used to integrate a function or to solve a first order ordinary differential equation?"

If the precise form of the function is not known it is better to construct an approximation using the methods like ,
Forward Euler finite difference
Trapazoidal rule formula.

so we only use numerical methods If the precise form of the function is not known ...
and with numerical methods ... we get function values ... right ??

If the precise form of the function is not known it is better to construct an approximation using the numerical methods

how do i construct these approximations ...??

Last edited: