Second order non-linear difference equation solver.
$begingroup$
Is there an algorithm which I can use to find an approximate solution of the following second-order difference equation in order to run simulations of the solution :
$nu(1 - beta) f(u_{n+1})-g(u_{n+1}-u_{n}) + beta g (u_{n+2} - u_{n+1}) = 0 $
with $nu > 0$ and $0 < beta < 1$ and $u_0 = 0$ and $u_N = C > 0$ and $N in mathbb{N}^{*}$ and $f$ and $g$ two real, positive and increasing functions.
Thank you.
algorithms recurrence-relations
$endgroup$
add a comment |
$begingroup$
Is there an algorithm which I can use to find an approximate solution of the following second-order difference equation in order to run simulations of the solution :
$nu(1 - beta) f(u_{n+1})-g(u_{n+1}-u_{n}) + beta g (u_{n+2} - u_{n+1}) = 0 $
with $nu > 0$ and $0 < beta < 1$ and $u_0 = 0$ and $u_N = C > 0$ and $N in mathbb{N}^{*}$ and $f$ and $g$ two real, positive and increasing functions.
Thank you.
algorithms recurrence-relations
$endgroup$
add a comment |
$begingroup$
Is there an algorithm which I can use to find an approximate solution of the following second-order difference equation in order to run simulations of the solution :
$nu(1 - beta) f(u_{n+1})-g(u_{n+1}-u_{n}) + beta g (u_{n+2} - u_{n+1}) = 0 $
with $nu > 0$ and $0 < beta < 1$ and $u_0 = 0$ and $u_N = C > 0$ and $N in mathbb{N}^{*}$ and $f$ and $g$ two real, positive and increasing functions.
Thank you.
algorithms recurrence-relations
$endgroup$
Is there an algorithm which I can use to find an approximate solution of the following second-order difference equation in order to run simulations of the solution :
$nu(1 - beta) f(u_{n+1})-g(u_{n+1}-u_{n}) + beta g (u_{n+2} - u_{n+1}) = 0 $
with $nu > 0$ and $0 < beta < 1$ and $u_0 = 0$ and $u_N = C > 0$ and $N in mathbb{N}^{*}$ and $f$ and $g$ two real, positive and increasing functions.
Thank you.
algorithms recurrence-relations
algorithms recurrence-relations
asked Dec 13 '18 at 15:30
AlexC75AlexC75
216
216
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
Rewrite as
$$
u_n = u_{n+1} - g^{-1}bigl[(1-beta)nu f(u_{n+1})+beta g(u_{n+2}-u_{n+1})bigr].
$$
If you fix $u_N=C$ (as given in the problem) and also $u_{N-1}$, then you can use the previous recurrence formula to solve backward for $x_{N-2},x_{N-3},dots,x_1,x_0$. Then the problem becomes to find an appropriate value for $x_{N-1}$ so that you end up with $x_0=0$.
This is what is called shooting method for the boundary value problem $x_0=0$, $x_N=C$.
In precise terms, through the above backward solution, you get a map $phi:mathbb Rtomathbb R$ which gives you $x_0=phi(x_{N-1})$. Your goal is now to solve $phi(x)=0$. This can be done in several ways, noting in particular that if $f,g,g^{-1}$ are differentiable, then $phi$ is also differentiable, so you may be able to use Newton's method, beside the
bisection method.
$endgroup$
$begingroup$
Thank you very much, seems to work perfectly. Great method.
$endgroup$
– AlexC75
Dec 13 '18 at 17:42
$begingroup$
@AlexC75 Of course the feasibility of this approach depends on how good the functions $f$ and $g$ are. I'm glad it works fine for you.
$endgroup$
– Federico
Dec 13 '18 at 17:48
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3038156%2fsecond-order-non-linear-difference-equation-solver%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Rewrite as
$$
u_n = u_{n+1} - g^{-1}bigl[(1-beta)nu f(u_{n+1})+beta g(u_{n+2}-u_{n+1})bigr].
$$
If you fix $u_N=C$ (as given in the problem) and also $u_{N-1}$, then you can use the previous recurrence formula to solve backward for $x_{N-2},x_{N-3},dots,x_1,x_0$. Then the problem becomes to find an appropriate value for $x_{N-1}$ so that you end up with $x_0=0$.
This is what is called shooting method for the boundary value problem $x_0=0$, $x_N=C$.
In precise terms, through the above backward solution, you get a map $phi:mathbb Rtomathbb R$ which gives you $x_0=phi(x_{N-1})$. Your goal is now to solve $phi(x)=0$. This can be done in several ways, noting in particular that if $f,g,g^{-1}$ are differentiable, then $phi$ is also differentiable, so you may be able to use Newton's method, beside the
bisection method.
$endgroup$
$begingroup$
Thank you very much, seems to work perfectly. Great method.
$endgroup$
– AlexC75
Dec 13 '18 at 17:42
$begingroup$
@AlexC75 Of course the feasibility of this approach depends on how good the functions $f$ and $g$ are. I'm glad it works fine for you.
$endgroup$
– Federico
Dec 13 '18 at 17:48
add a comment |
$begingroup$
Rewrite as
$$
u_n = u_{n+1} - g^{-1}bigl[(1-beta)nu f(u_{n+1})+beta g(u_{n+2}-u_{n+1})bigr].
$$
If you fix $u_N=C$ (as given in the problem) and also $u_{N-1}$, then you can use the previous recurrence formula to solve backward for $x_{N-2},x_{N-3},dots,x_1,x_0$. Then the problem becomes to find an appropriate value for $x_{N-1}$ so that you end up with $x_0=0$.
This is what is called shooting method for the boundary value problem $x_0=0$, $x_N=C$.
In precise terms, through the above backward solution, you get a map $phi:mathbb Rtomathbb R$ which gives you $x_0=phi(x_{N-1})$. Your goal is now to solve $phi(x)=0$. This can be done in several ways, noting in particular that if $f,g,g^{-1}$ are differentiable, then $phi$ is also differentiable, so you may be able to use Newton's method, beside the
bisection method.
$endgroup$
$begingroup$
Thank you very much, seems to work perfectly. Great method.
$endgroup$
– AlexC75
Dec 13 '18 at 17:42
$begingroup$
@AlexC75 Of course the feasibility of this approach depends on how good the functions $f$ and $g$ are. I'm glad it works fine for you.
$endgroup$
– Federico
Dec 13 '18 at 17:48
add a comment |
$begingroup$
Rewrite as
$$
u_n = u_{n+1} - g^{-1}bigl[(1-beta)nu f(u_{n+1})+beta g(u_{n+2}-u_{n+1})bigr].
$$
If you fix $u_N=C$ (as given in the problem) and also $u_{N-1}$, then you can use the previous recurrence formula to solve backward for $x_{N-2},x_{N-3},dots,x_1,x_0$. Then the problem becomes to find an appropriate value for $x_{N-1}$ so that you end up with $x_0=0$.
This is what is called shooting method for the boundary value problem $x_0=0$, $x_N=C$.
In precise terms, through the above backward solution, you get a map $phi:mathbb Rtomathbb R$ which gives you $x_0=phi(x_{N-1})$. Your goal is now to solve $phi(x)=0$. This can be done in several ways, noting in particular that if $f,g,g^{-1}$ are differentiable, then $phi$ is also differentiable, so you may be able to use Newton's method, beside the
bisection method.
$endgroup$
Rewrite as
$$
u_n = u_{n+1} - g^{-1}bigl[(1-beta)nu f(u_{n+1})+beta g(u_{n+2}-u_{n+1})bigr].
$$
If you fix $u_N=C$ (as given in the problem) and also $u_{N-1}$, then you can use the previous recurrence formula to solve backward for $x_{N-2},x_{N-3},dots,x_1,x_0$. Then the problem becomes to find an appropriate value for $x_{N-1}$ so that you end up with $x_0=0$.
This is what is called shooting method for the boundary value problem $x_0=0$, $x_N=C$.
In precise terms, through the above backward solution, you get a map $phi:mathbb Rtomathbb R$ which gives you $x_0=phi(x_{N-1})$. Your goal is now to solve $phi(x)=0$. This can be done in several ways, noting in particular that if $f,g,g^{-1}$ are differentiable, then $phi$ is also differentiable, so you may be able to use Newton's method, beside the
bisection method.
edited Dec 13 '18 at 15:52
answered Dec 13 '18 at 15:47
FedericoFederico
5,124514
5,124514
$begingroup$
Thank you very much, seems to work perfectly. Great method.
$endgroup$
– AlexC75
Dec 13 '18 at 17:42
$begingroup$
@AlexC75 Of course the feasibility of this approach depends on how good the functions $f$ and $g$ are. I'm glad it works fine for you.
$endgroup$
– Federico
Dec 13 '18 at 17:48
add a comment |
$begingroup$
Thank you very much, seems to work perfectly. Great method.
$endgroup$
– AlexC75
Dec 13 '18 at 17:42
$begingroup$
@AlexC75 Of course the feasibility of this approach depends on how good the functions $f$ and $g$ are. I'm glad it works fine for you.
$endgroup$
– Federico
Dec 13 '18 at 17:48
$begingroup$
Thank you very much, seems to work perfectly. Great method.
$endgroup$
– AlexC75
Dec 13 '18 at 17:42
$begingroup$
Thank you very much, seems to work perfectly. Great method.
$endgroup$
– AlexC75
Dec 13 '18 at 17:42
$begingroup$
@AlexC75 Of course the feasibility of this approach depends on how good the functions $f$ and $g$ are. I'm glad it works fine for you.
$endgroup$
– Federico
Dec 13 '18 at 17:48
$begingroup$
@AlexC75 Of course the feasibility of this approach depends on how good the functions $f$ and $g$ are. I'm glad it works fine for you.
$endgroup$
– Federico
Dec 13 '18 at 17:48
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3038156%2fsecond-order-non-linear-difference-equation-solver%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown