ODE with Euler Method
$begingroup$
I have to solve the following ODE: $y'(t)=y(t)+t$, $y(0)=0$
with Eulers Method in two steps, where $h=0.1$. I tried the following:
$y'(0)=y(0)+0=0$ and then I get $y(0.1)=y(0)+h*y'(0)=0$ but then everything will be 0. I do not get how to solve this.
ordinary-differential-equations eulers-method
$endgroup$
add a comment |
$begingroup$
I have to solve the following ODE: $y'(t)=y(t)+t$, $y(0)=0$
with Eulers Method in two steps, where $h=0.1$. I tried the following:
$y'(0)=y(0)+0=0$ and then I get $y(0.1)=y(0)+h*y'(0)=0$ but then everything will be 0. I do not get how to solve this.
ordinary-differential-equations eulers-method
$endgroup$
$begingroup$
$y=0$ is the solution for initial condition $y(0)=0$. Choose a more interesting initial condition e.g. $y(0)=1$ and try again.
$endgroup$
– xidgel
Jan 23 at 18:56
$begingroup$
@xidgel : No, there is a non-zero forcing term, the general solution is $y(t)=ce^t-1-t$ and $c=1$ for $y(0)=0$.
$endgroup$
– LutzL
Jan 23 at 19:14
$begingroup$
@LutzL Thanks for catching that.
$endgroup$
– xidgel
Jan 23 at 19:16
add a comment |
$begingroup$
I have to solve the following ODE: $y'(t)=y(t)+t$, $y(0)=0$
with Eulers Method in two steps, where $h=0.1$. I tried the following:
$y'(0)=y(0)+0=0$ and then I get $y(0.1)=y(0)+h*y'(0)=0$ but then everything will be 0. I do not get how to solve this.
ordinary-differential-equations eulers-method
$endgroup$
I have to solve the following ODE: $y'(t)=y(t)+t$, $y(0)=0$
with Eulers Method in two steps, where $h=0.1$. I tried the following:
$y'(0)=y(0)+0=0$ and then I get $y(0.1)=y(0)+h*y'(0)=0$ but then everything will be 0. I do not get how to solve this.
ordinary-differential-equations eulers-method
ordinary-differential-equations eulers-method
asked Jan 23 at 18:12
Natalie_94Natalie_94
316
316
$begingroup$
$y=0$ is the solution for initial condition $y(0)=0$. Choose a more interesting initial condition e.g. $y(0)=1$ and try again.
$endgroup$
– xidgel
Jan 23 at 18:56
$begingroup$
@xidgel : No, there is a non-zero forcing term, the general solution is $y(t)=ce^t-1-t$ and $c=1$ for $y(0)=0$.
$endgroup$
– LutzL
Jan 23 at 19:14
$begingroup$
@LutzL Thanks for catching that.
$endgroup$
– xidgel
Jan 23 at 19:16
add a comment |
$begingroup$
$y=0$ is the solution for initial condition $y(0)=0$. Choose a more interesting initial condition e.g. $y(0)=1$ and try again.
$endgroup$
– xidgel
Jan 23 at 18:56
$begingroup$
@xidgel : No, there is a non-zero forcing term, the general solution is $y(t)=ce^t-1-t$ and $c=1$ for $y(0)=0$.
$endgroup$
– LutzL
Jan 23 at 19:14
$begingroup$
@LutzL Thanks for catching that.
$endgroup$
– xidgel
Jan 23 at 19:16
$begingroup$
$y=0$ is the solution for initial condition $y(0)=0$. Choose a more interesting initial condition e.g. $y(0)=1$ and try again.
$endgroup$
– xidgel
Jan 23 at 18:56
$begingroup$
$y=0$ is the solution for initial condition $y(0)=0$. Choose a more interesting initial condition e.g. $y(0)=1$ and try again.
$endgroup$
– xidgel
Jan 23 at 18:56
$begingroup$
@xidgel : No, there is a non-zero forcing term, the general solution is $y(t)=ce^t-1-t$ and $c=1$ for $y(0)=0$.
$endgroup$
– LutzL
Jan 23 at 19:14
$begingroup$
@xidgel : No, there is a non-zero forcing term, the general solution is $y(t)=ce^t-1-t$ and $c=1$ for $y(0)=0$.
$endgroup$
– LutzL
Jan 23 at 19:14
$begingroup$
@LutzL Thanks for catching that.
$endgroup$
– xidgel
Jan 23 at 19:16
$begingroup$
@LutzL Thanks for catching that.
$endgroup$
– xidgel
Jan 23 at 19:16
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
In the next step you get $f(0.1, 0)=0.1$ so that you get a non-zero value for the approximation at $0.2$.
The leading error coefficient in $y_k=y(t_k)+c(t_k)h+O(h^2)$ is a solution of $$c'(t)=f_y(t,y)c-frac12y''=c-frac12e^t, \~~text{ so that }~~
(e^{-t}c)'=-frac12implies c(t)=-frac12te^t
$$
Plotting the actual error coefficient $frac{y_k-y(t_k)}h$ against this first term curve for several values of $h$ gives the image
So that indeed the Euler points are below the exact solution, for large $h$ this can be a large error, and for $h=0.1$ the error is as large as the value of the solution.
$endgroup$
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%2f3084850%2fode-with-euler-method%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$
In the next step you get $f(0.1, 0)=0.1$ so that you get a non-zero value for the approximation at $0.2$.
The leading error coefficient in $y_k=y(t_k)+c(t_k)h+O(h^2)$ is a solution of $$c'(t)=f_y(t,y)c-frac12y''=c-frac12e^t, \~~text{ so that }~~
(e^{-t}c)'=-frac12implies c(t)=-frac12te^t
$$
Plotting the actual error coefficient $frac{y_k-y(t_k)}h$ against this first term curve for several values of $h$ gives the image
So that indeed the Euler points are below the exact solution, for large $h$ this can be a large error, and for $h=0.1$ the error is as large as the value of the solution.
$endgroup$
add a comment |
$begingroup$
In the next step you get $f(0.1, 0)=0.1$ so that you get a non-zero value for the approximation at $0.2$.
The leading error coefficient in $y_k=y(t_k)+c(t_k)h+O(h^2)$ is a solution of $$c'(t)=f_y(t,y)c-frac12y''=c-frac12e^t, \~~text{ so that }~~
(e^{-t}c)'=-frac12implies c(t)=-frac12te^t
$$
Plotting the actual error coefficient $frac{y_k-y(t_k)}h$ against this first term curve for several values of $h$ gives the image
So that indeed the Euler points are below the exact solution, for large $h$ this can be a large error, and for $h=0.1$ the error is as large as the value of the solution.
$endgroup$
add a comment |
$begingroup$
In the next step you get $f(0.1, 0)=0.1$ so that you get a non-zero value for the approximation at $0.2$.
The leading error coefficient in $y_k=y(t_k)+c(t_k)h+O(h^2)$ is a solution of $$c'(t)=f_y(t,y)c-frac12y''=c-frac12e^t, \~~text{ so that }~~
(e^{-t}c)'=-frac12implies c(t)=-frac12te^t
$$
Plotting the actual error coefficient $frac{y_k-y(t_k)}h$ against this first term curve for several values of $h$ gives the image
So that indeed the Euler points are below the exact solution, for large $h$ this can be a large error, and for $h=0.1$ the error is as large as the value of the solution.
$endgroup$
In the next step you get $f(0.1, 0)=0.1$ so that you get a non-zero value for the approximation at $0.2$.
The leading error coefficient in $y_k=y(t_k)+c(t_k)h+O(h^2)$ is a solution of $$c'(t)=f_y(t,y)c-frac12y''=c-frac12e^t, \~~text{ so that }~~
(e^{-t}c)'=-frac12implies c(t)=-frac12te^t
$$
Plotting the actual error coefficient $frac{y_k-y(t_k)}h$ against this first term curve for several values of $h$ gives the image
So that indeed the Euler points are below the exact solution, for large $h$ this can be a large error, and for $h=0.1$ the error is as large as the value of the solution.
edited Jan 29 at 18:01
answered Jan 23 at 19:15
LutzLLutzL
59.6k42057
59.6k42057
add a comment |
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%2f3084850%2fode-with-euler-method%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
$begingroup$
$y=0$ is the solution for initial condition $y(0)=0$. Choose a more interesting initial condition e.g. $y(0)=1$ and try again.
$endgroup$
– xidgel
Jan 23 at 18:56
$begingroup$
@xidgel : No, there is a non-zero forcing term, the general solution is $y(t)=ce^t-1-t$ and $c=1$ for $y(0)=0$.
$endgroup$
– LutzL
Jan 23 at 19:14
$begingroup$
@LutzL Thanks for catching that.
$endgroup$
– xidgel
Jan 23 at 19:16