Explicity vs implicit first order euler to approximate $e^{alpha x}, alpha > 0$
$begingroup$
Hello for the function
$$
y(x) = e^{alpha x} Leftrightarrow y' = alpha y, y(0)=1
$$
I wanted to evaluate the error of the two following iterations
$$
left{
begin{array}{l}
y_k = y_{k-1} + alpha y_{k-1} delta t \
y_0 = 1
end{array}
right. Rightarrow y_k = (1+alpha delta t)^k
$$
and
$$
left{
begin{array}{l}
y_k = y_{k-1} + alpha y_{k}delta t \
y_0 = 1
end{array}
right. Rightarrow (1 - alpha delta t)y_k = y_{k-1} Rightarrow y_k = (1 - alpha delta t)^{-1} y_{k-1} Rightarrow y_k = (1-alpha delta t)^{-k}
$$
Now I'd like to evaluate the the errors using
$$
y(kdelta t) = e^{alpha k delta t} = 1 + alpha k delta t + alpha^2 frac{k^2}{2} delta t^2 + ...
$$
I can figure the taylor expansion of the first iteration (assuming $delta t rightarrow 0$), indeed I would get
$$
y_k = sum_{l=0}^{k} binom{k}{l} (alpha delta t)^l
$$
In such a case
$$
y(kdelta t) - y_k = O(alpha delta t)
$$
In the second iteration though I was expecting less error (asymptotically at least, i.e. something like $O(alpha^2 delta t^2)$), Taylor expansion I managed to get, not sure if this is correct
$$
y_k = sum_{l=0}^{+infty} frac{Gamma(1-k)}{Gamma(1-k-l)Gamma(l+1)} (-1)^l(alpha delta t)^l = 1 + alpha k delta t + frac{k (k+1)}{2}alpha^2delta t^2 + ...
$$
however the entailed error in this case is the same, is there something I'm missing? or is what I've done correct?
real-analysis ordinary-differential-equations numerical-methods taylor-expansion
$endgroup$
add a comment |
$begingroup$
Hello for the function
$$
y(x) = e^{alpha x} Leftrightarrow y' = alpha y, y(0)=1
$$
I wanted to evaluate the error of the two following iterations
$$
left{
begin{array}{l}
y_k = y_{k-1} + alpha y_{k-1} delta t \
y_0 = 1
end{array}
right. Rightarrow y_k = (1+alpha delta t)^k
$$
and
$$
left{
begin{array}{l}
y_k = y_{k-1} + alpha y_{k}delta t \
y_0 = 1
end{array}
right. Rightarrow (1 - alpha delta t)y_k = y_{k-1} Rightarrow y_k = (1 - alpha delta t)^{-1} y_{k-1} Rightarrow y_k = (1-alpha delta t)^{-k}
$$
Now I'd like to evaluate the the errors using
$$
y(kdelta t) = e^{alpha k delta t} = 1 + alpha k delta t + alpha^2 frac{k^2}{2} delta t^2 + ...
$$
I can figure the taylor expansion of the first iteration (assuming $delta t rightarrow 0$), indeed I would get
$$
y_k = sum_{l=0}^{k} binom{k}{l} (alpha delta t)^l
$$
In such a case
$$
y(kdelta t) - y_k = O(alpha delta t)
$$
In the second iteration though I was expecting less error (asymptotically at least, i.e. something like $O(alpha^2 delta t^2)$), Taylor expansion I managed to get, not sure if this is correct
$$
y_k = sum_{l=0}^{+infty} frac{Gamma(1-k)}{Gamma(1-k-l)Gamma(l+1)} (-1)^l(alpha delta t)^l = 1 + alpha k delta t + frac{k (k+1)}{2}alpha^2delta t^2 + ...
$$
however the entailed error in this case is the same, is there something I'm missing? or is what I've done correct?
real-analysis ordinary-differential-equations numerical-methods taylor-expansion
$endgroup$
add a comment |
$begingroup$
Hello for the function
$$
y(x) = e^{alpha x} Leftrightarrow y' = alpha y, y(0)=1
$$
I wanted to evaluate the error of the two following iterations
$$
left{
begin{array}{l}
y_k = y_{k-1} + alpha y_{k-1} delta t \
y_0 = 1
end{array}
right. Rightarrow y_k = (1+alpha delta t)^k
$$
and
$$
left{
begin{array}{l}
y_k = y_{k-1} + alpha y_{k}delta t \
y_0 = 1
end{array}
right. Rightarrow (1 - alpha delta t)y_k = y_{k-1} Rightarrow y_k = (1 - alpha delta t)^{-1} y_{k-1} Rightarrow y_k = (1-alpha delta t)^{-k}
$$
Now I'd like to evaluate the the errors using
$$
y(kdelta t) = e^{alpha k delta t} = 1 + alpha k delta t + alpha^2 frac{k^2}{2} delta t^2 + ...
$$
I can figure the taylor expansion of the first iteration (assuming $delta t rightarrow 0$), indeed I would get
$$
y_k = sum_{l=0}^{k} binom{k}{l} (alpha delta t)^l
$$
In such a case
$$
y(kdelta t) - y_k = O(alpha delta t)
$$
In the second iteration though I was expecting less error (asymptotically at least, i.e. something like $O(alpha^2 delta t^2)$), Taylor expansion I managed to get, not sure if this is correct
$$
y_k = sum_{l=0}^{+infty} frac{Gamma(1-k)}{Gamma(1-k-l)Gamma(l+1)} (-1)^l(alpha delta t)^l = 1 + alpha k delta t + frac{k (k+1)}{2}alpha^2delta t^2 + ...
$$
however the entailed error in this case is the same, is there something I'm missing? or is what I've done correct?
real-analysis ordinary-differential-equations numerical-methods taylor-expansion
$endgroup$
Hello for the function
$$
y(x) = e^{alpha x} Leftrightarrow y' = alpha y, y(0)=1
$$
I wanted to evaluate the error of the two following iterations
$$
left{
begin{array}{l}
y_k = y_{k-1} + alpha y_{k-1} delta t \
y_0 = 1
end{array}
right. Rightarrow y_k = (1+alpha delta t)^k
$$
and
$$
left{
begin{array}{l}
y_k = y_{k-1} + alpha y_{k}delta t \
y_0 = 1
end{array}
right. Rightarrow (1 - alpha delta t)y_k = y_{k-1} Rightarrow y_k = (1 - alpha delta t)^{-1} y_{k-1} Rightarrow y_k = (1-alpha delta t)^{-k}
$$
Now I'd like to evaluate the the errors using
$$
y(kdelta t) = e^{alpha k delta t} = 1 + alpha k delta t + alpha^2 frac{k^2}{2} delta t^2 + ...
$$
I can figure the taylor expansion of the first iteration (assuming $delta t rightarrow 0$), indeed I would get
$$
y_k = sum_{l=0}^{k} binom{k}{l} (alpha delta t)^l
$$
In such a case
$$
y(kdelta t) - y_k = O(alpha delta t)
$$
In the second iteration though I was expecting less error (asymptotically at least, i.e. something like $O(alpha^2 delta t^2)$), Taylor expansion I managed to get, not sure if this is correct
$$
y_k = sum_{l=0}^{+infty} frac{Gamma(1-k)}{Gamma(1-k-l)Gamma(l+1)} (-1)^l(alpha delta t)^l = 1 + alpha k delta t + frac{k (k+1)}{2}alpha^2delta t^2 + ...
$$
however the entailed error in this case is the same, is there something I'm missing? or is what I've done correct?
real-analysis ordinary-differential-equations numerical-methods taylor-expansion
real-analysis ordinary-differential-equations numerical-methods taylor-expansion
asked Jan 18 at 14:04
user8469759user8469759
1,5731618
1,5731618
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
You get easier results by comparing the powers in question in the exponents, that is as arguments of an exponential function after applying the appropriate logarithms.
begin{align}
(1+αδt)^k=expleft(kln(1+αδt)right)
&=expleft(αkδtleft(1-frac{αδt}2+frac{(αδt)^2}3-frac{(αδt)^3}4+...right)right)
\&=expleft(αt_k-frac{α^2}2t_kδt+...right),
\
(1-αδt)^{-k}=expleft(-kln(1-αδt)right)
&=expleft(αkδtleft(1+frac{αδt}2+frac{(αδt)^2}3+frac{(αδt)^3}4+...right)right)
\&=expleft(αt_k+frac{α^2}2t_kδt+...right).
end{align}
So you see, in both cases you get nearly the same first-order error, only with opposite signs.
$endgroup$
$begingroup$
Ah, I was expecting something better for the second, since it is an implicit method, I was wrong.
$endgroup$
– user8469759
Jan 18 at 14:52
$begingroup$
No, they are both first order and time-reverse to each other. Alternating explicit and implicit steps you get the midpoint method which is of second order.
$endgroup$
– LutzL
Jan 18 at 14:54
$begingroup$
So one method might be more convenient than the other only for stability reasons I suppose
$endgroup$
– user8469759
Jan 18 at 14:55
1
$begingroup$
Yes, but except for educational purposes you would almost always use higher order implicit methods, one- or multi-step.
$endgroup$
– LutzL
Jan 18 at 15:18
add a comment |
Your Answer
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%2f3078291%2fexplicity-vs-implicit-first-order-euler-to-approximate-e-alpha-x-alpha-0%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$
You get easier results by comparing the powers in question in the exponents, that is as arguments of an exponential function after applying the appropriate logarithms.
begin{align}
(1+αδt)^k=expleft(kln(1+αδt)right)
&=expleft(αkδtleft(1-frac{αδt}2+frac{(αδt)^2}3-frac{(αδt)^3}4+...right)right)
\&=expleft(αt_k-frac{α^2}2t_kδt+...right),
\
(1-αδt)^{-k}=expleft(-kln(1-αδt)right)
&=expleft(αkδtleft(1+frac{αδt}2+frac{(αδt)^2}3+frac{(αδt)^3}4+...right)right)
\&=expleft(αt_k+frac{α^2}2t_kδt+...right).
end{align}
So you see, in both cases you get nearly the same first-order error, only with opposite signs.
$endgroup$
$begingroup$
Ah, I was expecting something better for the second, since it is an implicit method, I was wrong.
$endgroup$
– user8469759
Jan 18 at 14:52
$begingroup$
No, they are both first order and time-reverse to each other. Alternating explicit and implicit steps you get the midpoint method which is of second order.
$endgroup$
– LutzL
Jan 18 at 14:54
$begingroup$
So one method might be more convenient than the other only for stability reasons I suppose
$endgroup$
– user8469759
Jan 18 at 14:55
1
$begingroup$
Yes, but except for educational purposes you would almost always use higher order implicit methods, one- or multi-step.
$endgroup$
– LutzL
Jan 18 at 15:18
add a comment |
$begingroup$
You get easier results by comparing the powers in question in the exponents, that is as arguments of an exponential function after applying the appropriate logarithms.
begin{align}
(1+αδt)^k=expleft(kln(1+αδt)right)
&=expleft(αkδtleft(1-frac{αδt}2+frac{(αδt)^2}3-frac{(αδt)^3}4+...right)right)
\&=expleft(αt_k-frac{α^2}2t_kδt+...right),
\
(1-αδt)^{-k}=expleft(-kln(1-αδt)right)
&=expleft(αkδtleft(1+frac{αδt}2+frac{(αδt)^2}3+frac{(αδt)^3}4+...right)right)
\&=expleft(αt_k+frac{α^2}2t_kδt+...right).
end{align}
So you see, in both cases you get nearly the same first-order error, only with opposite signs.
$endgroup$
$begingroup$
Ah, I was expecting something better for the second, since it is an implicit method, I was wrong.
$endgroup$
– user8469759
Jan 18 at 14:52
$begingroup$
No, they are both first order and time-reverse to each other. Alternating explicit and implicit steps you get the midpoint method which is of second order.
$endgroup$
– LutzL
Jan 18 at 14:54
$begingroup$
So one method might be more convenient than the other only for stability reasons I suppose
$endgroup$
– user8469759
Jan 18 at 14:55
1
$begingroup$
Yes, but except for educational purposes you would almost always use higher order implicit methods, one- or multi-step.
$endgroup$
– LutzL
Jan 18 at 15:18
add a comment |
$begingroup$
You get easier results by comparing the powers in question in the exponents, that is as arguments of an exponential function after applying the appropriate logarithms.
begin{align}
(1+αδt)^k=expleft(kln(1+αδt)right)
&=expleft(αkδtleft(1-frac{αδt}2+frac{(αδt)^2}3-frac{(αδt)^3}4+...right)right)
\&=expleft(αt_k-frac{α^2}2t_kδt+...right),
\
(1-αδt)^{-k}=expleft(-kln(1-αδt)right)
&=expleft(αkδtleft(1+frac{αδt}2+frac{(αδt)^2}3+frac{(αδt)^3}4+...right)right)
\&=expleft(αt_k+frac{α^2}2t_kδt+...right).
end{align}
So you see, in both cases you get nearly the same first-order error, only with opposite signs.
$endgroup$
You get easier results by comparing the powers in question in the exponents, that is as arguments of an exponential function after applying the appropriate logarithms.
begin{align}
(1+αδt)^k=expleft(kln(1+αδt)right)
&=expleft(αkδtleft(1-frac{αδt}2+frac{(αδt)^2}3-frac{(αδt)^3}4+...right)right)
\&=expleft(αt_k-frac{α^2}2t_kδt+...right),
\
(1-αδt)^{-k}=expleft(-kln(1-αδt)right)
&=expleft(αkδtleft(1+frac{αδt}2+frac{(αδt)^2}3+frac{(αδt)^3}4+...right)right)
\&=expleft(αt_k+frac{α^2}2t_kδt+...right).
end{align}
So you see, in both cases you get nearly the same first-order error, only with opposite signs.
edited Jan 18 at 14:53
answered Jan 18 at 14:51
LutzLLutzL
60.8k42057
60.8k42057
$begingroup$
Ah, I was expecting something better for the second, since it is an implicit method, I was wrong.
$endgroup$
– user8469759
Jan 18 at 14:52
$begingroup$
No, they are both first order and time-reverse to each other. Alternating explicit and implicit steps you get the midpoint method which is of second order.
$endgroup$
– LutzL
Jan 18 at 14:54
$begingroup$
So one method might be more convenient than the other only for stability reasons I suppose
$endgroup$
– user8469759
Jan 18 at 14:55
1
$begingroup$
Yes, but except for educational purposes you would almost always use higher order implicit methods, one- or multi-step.
$endgroup$
– LutzL
Jan 18 at 15:18
add a comment |
$begingroup$
Ah, I was expecting something better for the second, since it is an implicit method, I was wrong.
$endgroup$
– user8469759
Jan 18 at 14:52
$begingroup$
No, they are both first order and time-reverse to each other. Alternating explicit and implicit steps you get the midpoint method which is of second order.
$endgroup$
– LutzL
Jan 18 at 14:54
$begingroup$
So one method might be more convenient than the other only for stability reasons I suppose
$endgroup$
– user8469759
Jan 18 at 14:55
1
$begingroup$
Yes, but except for educational purposes you would almost always use higher order implicit methods, one- or multi-step.
$endgroup$
– LutzL
Jan 18 at 15:18
$begingroup$
Ah, I was expecting something better for the second, since it is an implicit method, I was wrong.
$endgroup$
– user8469759
Jan 18 at 14:52
$begingroup$
Ah, I was expecting something better for the second, since it is an implicit method, I was wrong.
$endgroup$
– user8469759
Jan 18 at 14:52
$begingroup$
No, they are both first order and time-reverse to each other. Alternating explicit and implicit steps you get the midpoint method which is of second order.
$endgroup$
– LutzL
Jan 18 at 14:54
$begingroup$
No, they are both first order and time-reverse to each other. Alternating explicit and implicit steps you get the midpoint method which is of second order.
$endgroup$
– LutzL
Jan 18 at 14:54
$begingroup$
So one method might be more convenient than the other only for stability reasons I suppose
$endgroup$
– user8469759
Jan 18 at 14:55
$begingroup$
So one method might be more convenient than the other only for stability reasons I suppose
$endgroup$
– user8469759
Jan 18 at 14:55
1
1
$begingroup$
Yes, but except for educational purposes you would almost always use higher order implicit methods, one- or multi-step.
$endgroup$
– LutzL
Jan 18 at 15:18
$begingroup$
Yes, but except for educational purposes you would almost always use higher order implicit methods, one- or multi-step.
$endgroup$
– LutzL
Jan 18 at 15:18
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%2f3078291%2fexplicity-vs-implicit-first-order-euler-to-approximate-e-alpha-x-alpha-0%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