how to solve $x''=f(x)$ numerically?
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I know how to solve when $f(x)$ is linear, but how to solve the equation $x''=f(x)$ with $f$ a unknown nonlinear function using numerical methods?
Any references would be helpful. Thanks!
Update: Sorry that I am not clear about it, what I mean is the exact form of $f$ is unknown, but you can think it as a black box and you can get values at any points from $f$.
numerical-methods
add a comment |Â
up vote
2
down vote
favorite
I know how to solve when $f(x)$ is linear, but how to solve the equation $x''=f(x)$ with $f$ a unknown nonlinear function using numerical methods?
Any references would be helpful. Thanks!
Update: Sorry that I am not clear about it, what I mean is the exact form of $f$ is unknown, but you can think it as a black box and you can get values at any points from $f$.
numerical-methods
1
If $f$ is truly unknown, you're somewhat dead in the water with respect to numerical methods. You can do $(x')^2/2=int f(x),x',dt=int f(x),dx,$ for a single formal integration, but that's about as far as you can get.
â Adrian Keister
Aug 27 at 18:36
1
Perhaps instead of saying an "unknown" function, one may ask about a "black box" function $f$, i.e. the internal details are unknown but we can evaluate it at any point.
â hardmath
Aug 27 at 18:55
1
I think you need to clarify what you mean by "unknown". As written, this is like asking "How can you solve an equation when you don't know what is on the right-hand side?" The obvious answer is you can't.
â mweiss
Aug 27 at 19:07
I think that, with high probability, Sherry really means "a general nonlinear function" rather than "a unknown nonlinear function." Indeed Sherry is contrasting to the "linear function" case, for which "general nonlinear function" seems to be the most appropriate opposite case. So, the answer that was (unfortunately) deleted was likely the answer being sought by the asker.
â Michael
Aug 27 at 19:46
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I know how to solve when $f(x)$ is linear, but how to solve the equation $x''=f(x)$ with $f$ a unknown nonlinear function using numerical methods?
Any references would be helpful. Thanks!
Update: Sorry that I am not clear about it, what I mean is the exact form of $f$ is unknown, but you can think it as a black box and you can get values at any points from $f$.
numerical-methods
I know how to solve when $f(x)$ is linear, but how to solve the equation $x''=f(x)$ with $f$ a unknown nonlinear function using numerical methods?
Any references would be helpful. Thanks!
Update: Sorry that I am not clear about it, what I mean is the exact form of $f$ is unknown, but you can think it as a black box and you can get values at any points from $f$.
numerical-methods
edited Aug 28 at 0:51
asked Aug 27 at 18:15
Sherry
2,112523
2,112523
1
If $f$ is truly unknown, you're somewhat dead in the water with respect to numerical methods. You can do $(x')^2/2=int f(x),x',dt=int f(x),dx,$ for a single formal integration, but that's about as far as you can get.
â Adrian Keister
Aug 27 at 18:36
1
Perhaps instead of saying an "unknown" function, one may ask about a "black box" function $f$, i.e. the internal details are unknown but we can evaluate it at any point.
â hardmath
Aug 27 at 18:55
1
I think you need to clarify what you mean by "unknown". As written, this is like asking "How can you solve an equation when you don't know what is on the right-hand side?" The obvious answer is you can't.
â mweiss
Aug 27 at 19:07
I think that, with high probability, Sherry really means "a general nonlinear function" rather than "a unknown nonlinear function." Indeed Sherry is contrasting to the "linear function" case, for which "general nonlinear function" seems to be the most appropriate opposite case. So, the answer that was (unfortunately) deleted was likely the answer being sought by the asker.
â Michael
Aug 27 at 19:46
add a comment |Â
1
If $f$ is truly unknown, you're somewhat dead in the water with respect to numerical methods. You can do $(x')^2/2=int f(x),x',dt=int f(x),dx,$ for a single formal integration, but that's about as far as you can get.
â Adrian Keister
Aug 27 at 18:36
1
Perhaps instead of saying an "unknown" function, one may ask about a "black box" function $f$, i.e. the internal details are unknown but we can evaluate it at any point.
â hardmath
Aug 27 at 18:55
1
I think you need to clarify what you mean by "unknown". As written, this is like asking "How can you solve an equation when you don't know what is on the right-hand side?" The obvious answer is you can't.
â mweiss
Aug 27 at 19:07
I think that, with high probability, Sherry really means "a general nonlinear function" rather than "a unknown nonlinear function." Indeed Sherry is contrasting to the "linear function" case, for which "general nonlinear function" seems to be the most appropriate opposite case. So, the answer that was (unfortunately) deleted was likely the answer being sought by the asker.
â Michael
Aug 27 at 19:46
1
1
If $f$ is truly unknown, you're somewhat dead in the water with respect to numerical methods. You can do $(x')^2/2=int f(x),x',dt=int f(x),dx,$ for a single formal integration, but that's about as far as you can get.
â Adrian Keister
Aug 27 at 18:36
If $f$ is truly unknown, you're somewhat dead in the water with respect to numerical methods. You can do $(x')^2/2=int f(x),x',dt=int f(x),dx,$ for a single formal integration, but that's about as far as you can get.
â Adrian Keister
Aug 27 at 18:36
1
1
Perhaps instead of saying an "unknown" function, one may ask about a "black box" function $f$, i.e. the internal details are unknown but we can evaluate it at any point.
â hardmath
Aug 27 at 18:55
Perhaps instead of saying an "unknown" function, one may ask about a "black box" function $f$, i.e. the internal details are unknown but we can evaluate it at any point.
â hardmath
Aug 27 at 18:55
1
1
I think you need to clarify what you mean by "unknown". As written, this is like asking "How can you solve an equation when you don't know what is on the right-hand side?" The obvious answer is you can't.
â mweiss
Aug 27 at 19:07
I think you need to clarify what you mean by "unknown". As written, this is like asking "How can you solve an equation when you don't know what is on the right-hand side?" The obvious answer is you can't.
â mweiss
Aug 27 at 19:07
I think that, with high probability, Sherry really means "a general nonlinear function" rather than "a unknown nonlinear function." Indeed Sherry is contrasting to the "linear function" case, for which "general nonlinear function" seems to be the most appropriate opposite case. So, the answer that was (unfortunately) deleted was likely the answer being sought by the asker.
â Michael
Aug 27 at 19:46
I think that, with high probability, Sherry really means "a general nonlinear function" rather than "a unknown nonlinear function." Indeed Sherry is contrasting to the "linear function" case, for which "general nonlinear function" seems to be the most appropriate opposite case. So, the answer that was (unfortunately) deleted was likely the answer being sought by the asker.
â Michael
Aug 27 at 19:46
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
Generally you convert the second order ODE in the first order:
$$
beginpmatrix
v'\
x'
endpmatrix =
beginpmatrix
f(x)\
v
endpmatrix
$$
Here I used a notation common in mathematical physics where generally the new variable $v$ is the velocity, i.e. the first derivate.
Now you use a double step:
- first you solve $v' = f(x)$
- after you solve $x' = v$
Until this point there is no difference between the linear and the non linear case.
The difference is the choice of the numerical method. For the non linear case an
implicit method involve to solve non linear equation, this can be a delicate passage
where you must determine how and which solution to consider. For example think the case that come from a dynamic problem where $f$ is quadratic with the velocity and try to use the most simple implicit method as Eulero implicit.
So in general you use IMEX methods where you use an explicit discretization for the non linear terms and implicit for the linear terms. In your problem you do not know the form of $f$ and you can not split the operator, so you can use an explicit numerical scheme for the first equation and an implicit scheme for the second.
As explicit scheme you can choice, for example, a scheme as Adam-Bashord
For some equation is possible to solve it without the reduction to the first order, see Numerov's method
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Generally you convert the second order ODE in the first order:
$$
beginpmatrix
v'\
x'
endpmatrix =
beginpmatrix
f(x)\
v
endpmatrix
$$
Here I used a notation common in mathematical physics where generally the new variable $v$ is the velocity, i.e. the first derivate.
Now you use a double step:
- first you solve $v' = f(x)$
- after you solve $x' = v$
Until this point there is no difference between the linear and the non linear case.
The difference is the choice of the numerical method. For the non linear case an
implicit method involve to solve non linear equation, this can be a delicate passage
where you must determine how and which solution to consider. For example think the case that come from a dynamic problem where $f$ is quadratic with the velocity and try to use the most simple implicit method as Eulero implicit.
So in general you use IMEX methods where you use an explicit discretization for the non linear terms and implicit for the linear terms. In your problem you do not know the form of $f$ and you can not split the operator, so you can use an explicit numerical scheme for the first equation and an implicit scheme for the second.
As explicit scheme you can choice, for example, a scheme as Adam-Bashord
For some equation is possible to solve it without the reduction to the first order, see Numerov's method
add a comment |Â
up vote
1
down vote
Generally you convert the second order ODE in the first order:
$$
beginpmatrix
v'\
x'
endpmatrix =
beginpmatrix
f(x)\
v
endpmatrix
$$
Here I used a notation common in mathematical physics where generally the new variable $v$ is the velocity, i.e. the first derivate.
Now you use a double step:
- first you solve $v' = f(x)$
- after you solve $x' = v$
Until this point there is no difference between the linear and the non linear case.
The difference is the choice of the numerical method. For the non linear case an
implicit method involve to solve non linear equation, this can be a delicate passage
where you must determine how and which solution to consider. For example think the case that come from a dynamic problem where $f$ is quadratic with the velocity and try to use the most simple implicit method as Eulero implicit.
So in general you use IMEX methods where you use an explicit discretization for the non linear terms and implicit for the linear terms. In your problem you do not know the form of $f$ and you can not split the operator, so you can use an explicit numerical scheme for the first equation and an implicit scheme for the second.
As explicit scheme you can choice, for example, a scheme as Adam-Bashord
For some equation is possible to solve it without the reduction to the first order, see Numerov's method
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Generally you convert the second order ODE in the first order:
$$
beginpmatrix
v'\
x'
endpmatrix =
beginpmatrix
f(x)\
v
endpmatrix
$$
Here I used a notation common in mathematical physics where generally the new variable $v$ is the velocity, i.e. the first derivate.
Now you use a double step:
- first you solve $v' = f(x)$
- after you solve $x' = v$
Until this point there is no difference between the linear and the non linear case.
The difference is the choice of the numerical method. For the non linear case an
implicit method involve to solve non linear equation, this can be a delicate passage
where you must determine how and which solution to consider. For example think the case that come from a dynamic problem where $f$ is quadratic with the velocity and try to use the most simple implicit method as Eulero implicit.
So in general you use IMEX methods where you use an explicit discretization for the non linear terms and implicit for the linear terms. In your problem you do not know the form of $f$ and you can not split the operator, so you can use an explicit numerical scheme for the first equation and an implicit scheme for the second.
As explicit scheme you can choice, for example, a scheme as Adam-Bashord
For some equation is possible to solve it without the reduction to the first order, see Numerov's method
Generally you convert the second order ODE in the first order:
$$
beginpmatrix
v'\
x'
endpmatrix =
beginpmatrix
f(x)\
v
endpmatrix
$$
Here I used a notation common in mathematical physics where generally the new variable $v$ is the velocity, i.e. the first derivate.
Now you use a double step:
- first you solve $v' = f(x)$
- after you solve $x' = v$
Until this point there is no difference between the linear and the non linear case.
The difference is the choice of the numerical method. For the non linear case an
implicit method involve to solve non linear equation, this can be a delicate passage
where you must determine how and which solution to consider. For example think the case that come from a dynamic problem where $f$ is quadratic with the velocity and try to use the most simple implicit method as Eulero implicit.
So in general you use IMEX methods where you use an explicit discretization for the non linear terms and implicit for the linear terms. In your problem you do not know the form of $f$ and you can not split the operator, so you can use an explicit numerical scheme for the first equation and an implicit scheme for the second.
As explicit scheme you can choice, for example, a scheme as Adam-Bashord
For some equation is possible to solve it without the reduction to the first order, see Numerov's method
answered Aug 28 at 14:24
Mauro Vanzetto
36116
36116
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2896492%2fhow-to-solve-x-fx-numerically%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
If $f$ is truly unknown, you're somewhat dead in the water with respect to numerical methods. You can do $(x')^2/2=int f(x),x',dt=int f(x),dx,$ for a single formal integration, but that's about as far as you can get.
â Adrian Keister
Aug 27 at 18:36
1
Perhaps instead of saying an "unknown" function, one may ask about a "black box" function $f$, i.e. the internal details are unknown but we can evaluate it at any point.
â hardmath
Aug 27 at 18:55
1
I think you need to clarify what you mean by "unknown". As written, this is like asking "How can you solve an equation when you don't know what is on the right-hand side?" The obvious answer is you can't.
â mweiss
Aug 27 at 19:07
I think that, with high probability, Sherry really means "a general nonlinear function" rather than "a unknown nonlinear function." Indeed Sherry is contrasting to the "linear function" case, for which "general nonlinear function" seems to be the most appropriate opposite case. So, the answer that was (unfortunately) deleted was likely the answer being sought by the asker.
â Michael
Aug 27 at 19:46