Help with ODE solving using RK method in Matlab
up vote
-1
down vote
favorite
I have the following ode
$idot{x_n}(t)=-x_{n+1}(t)-x_{n-1}(t)+g~ x_n(t)$ with I.C. $phi(0)=-2cos(2.5)$ and $g=1$.
where $dot{x_n}=frac{dx_n}{dt}$, $n$ are discrete points in space, and $x$ is the value of field on each point.
However, I am unable to produce desired plot of $x_n$ (at a fixed time) along y-axis vs $n$ on x-axis.
I am trying to solve it via Matlab ODE45 but unable to get around it. We could take say $-5leq nleq5$, i.e., 11 total space points to start. Thanks
differential-equations numerical-methods matlab
add a comment |
up vote
-1
down vote
favorite
I have the following ode
$idot{x_n}(t)=-x_{n+1}(t)-x_{n-1}(t)+g~ x_n(t)$ with I.C. $phi(0)=-2cos(2.5)$ and $g=1$.
where $dot{x_n}=frac{dx_n}{dt}$, $n$ are discrete points in space, and $x$ is the value of field on each point.
However, I am unable to produce desired plot of $x_n$ (at a fixed time) along y-axis vs $n$ on x-axis.
I am trying to solve it via Matlab ODE45 but unable to get around it. We could take say $-5leq nleq5$, i.e., 11 total space points to start. Thanks
differential-equations numerical-methods matlab
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I have the following ode
$idot{x_n}(t)=-x_{n+1}(t)-x_{n-1}(t)+g~ x_n(t)$ with I.C. $phi(0)=-2cos(2.5)$ and $g=1$.
where $dot{x_n}=frac{dx_n}{dt}$, $n$ are discrete points in space, and $x$ is the value of field on each point.
However, I am unable to produce desired plot of $x_n$ (at a fixed time) along y-axis vs $n$ on x-axis.
I am trying to solve it via Matlab ODE45 but unable to get around it. We could take say $-5leq nleq5$, i.e., 11 total space points to start. Thanks
differential-equations numerical-methods matlab
I have the following ode
$idot{x_n}(t)=-x_{n+1}(t)-x_{n-1}(t)+g~ x_n(t)$ with I.C. $phi(0)=-2cos(2.5)$ and $g=1$.
where $dot{x_n}=frac{dx_n}{dt}$, $n$ are discrete points in space, and $x$ is the value of field on each point.
However, I am unable to produce desired plot of $x_n$ (at a fixed time) along y-axis vs $n$ on x-axis.
I am trying to solve it via Matlab ODE45 but unable to get around it. We could take say $-5leq nleq5$, i.e., 11 total space points to start. Thanks
differential-equations numerical-methods matlab
differential-equations numerical-methods matlab
asked 22 hours ago
AtoZ
135
135
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f3004826%2fhelp-with-ode-solving-using-rk-method-in-matlab%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