R: deSolve - partial differential equation
up vote
2
down vote
favorite
Could somebody help me with the R package deSolve/ReacTran, which can be used for solving any parabolic partial differential equation:
I have found a similar example in the book
Karline Soetaert, Jeff_Cash, Francesca Mazzia: Solving Partial Differential Equations in R, chapter 9, page 179-181,
where is a solution for the equation:
Online version of book: Solving Partial Differential Equations in R
The PDE and the solution is defined like:
Schrodinger <- function(t, u, parms) {
du <- 1i * tran.1D (C = u, D = 1, dx = xgrid)$dC +
1i * gam * abs(u)ˆ2 * u
list(du) }
N <- 300
xgrid <- setup.grid.1D(-20, 80, N = N)
x <- xgrid$x.mid
out <- ode.1D(y = yini, parms = NULL, func = Schrodinger,
times = times, dimens = 300, method = "adams")
There's an example of the second partial derivative:
tran.1D (C = u, D = 1, dx = xgrid)$dC
but I'm not sure how to define the first partial derivatives in the PDE
and for derivatives by r_e and r_d (more 'xgrid', or ?)
Thank you in advance for any help.
r differential-equations
add a comment |
up vote
2
down vote
favorite
Could somebody help me with the R package deSolve/ReacTran, which can be used for solving any parabolic partial differential equation:
I have found a similar example in the book
Karline Soetaert, Jeff_Cash, Francesca Mazzia: Solving Partial Differential Equations in R, chapter 9, page 179-181,
where is a solution for the equation:
Online version of book: Solving Partial Differential Equations in R
The PDE and the solution is defined like:
Schrodinger <- function(t, u, parms) {
du <- 1i * tran.1D (C = u, D = 1, dx = xgrid)$dC +
1i * gam * abs(u)ˆ2 * u
list(du) }
N <- 300
xgrid <- setup.grid.1D(-20, 80, N = N)
x <- xgrid$x.mid
out <- ode.1D(y = yini, parms = NULL, func = Schrodinger,
times = times, dimens = 300, method = "adams")
There's an example of the second partial derivative:
tran.1D (C = u, D = 1, dx = xgrid)$dC
but I'm not sure how to define the first partial derivatives in the PDE
and for derivatives by r_e and r_d (more 'xgrid', or ?)
Thank you in advance for any help.
r differential-equations
Your PDE is really 2D+time (r_e as x and r_d as y). So you should look more into tran.2D I believe (same goes for grid.2D and ode.2D). Take a look at the full manual cran.r-project.org/web/packages/ReacTran/ReacTran.pdf or cran.r-project.org/web/packages/ReacTran/vignettes/PDE.pdf PS: never triedr
so I won't venture at an answer
– PilouPili
Nov 10 at 22:42
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Could somebody help me with the R package deSolve/ReacTran, which can be used for solving any parabolic partial differential equation:
I have found a similar example in the book
Karline Soetaert, Jeff_Cash, Francesca Mazzia: Solving Partial Differential Equations in R, chapter 9, page 179-181,
where is a solution for the equation:
Online version of book: Solving Partial Differential Equations in R
The PDE and the solution is defined like:
Schrodinger <- function(t, u, parms) {
du <- 1i * tran.1D (C = u, D = 1, dx = xgrid)$dC +
1i * gam * abs(u)ˆ2 * u
list(du) }
N <- 300
xgrid <- setup.grid.1D(-20, 80, N = N)
x <- xgrid$x.mid
out <- ode.1D(y = yini, parms = NULL, func = Schrodinger,
times = times, dimens = 300, method = "adams")
There's an example of the second partial derivative:
tran.1D (C = u, D = 1, dx = xgrid)$dC
but I'm not sure how to define the first partial derivatives in the PDE
and for derivatives by r_e and r_d (more 'xgrid', or ?)
Thank you in advance for any help.
r differential-equations
Could somebody help me with the R package deSolve/ReacTran, which can be used for solving any parabolic partial differential equation:
I have found a similar example in the book
Karline Soetaert, Jeff_Cash, Francesca Mazzia: Solving Partial Differential Equations in R, chapter 9, page 179-181,
where is a solution for the equation:
Online version of book: Solving Partial Differential Equations in R
The PDE and the solution is defined like:
Schrodinger <- function(t, u, parms) {
du <- 1i * tran.1D (C = u, D = 1, dx = xgrid)$dC +
1i * gam * abs(u)ˆ2 * u
list(du) }
N <- 300
xgrid <- setup.grid.1D(-20, 80, N = N)
x <- xgrid$x.mid
out <- ode.1D(y = yini, parms = NULL, func = Schrodinger,
times = times, dimens = 300, method = "adams")
There's an example of the second partial derivative:
tran.1D (C = u, D = 1, dx = xgrid)$dC
but I'm not sure how to define the first partial derivatives in the PDE
and for derivatives by r_e and r_d (more 'xgrid', or ?)
Thank you in advance for any help.
r differential-equations
r differential-equations
edited Nov 10 at 18:39
Ethan
8117
8117
asked Nov 10 at 11:14
Ab B Bg Kostroš
112
112
Your PDE is really 2D+time (r_e as x and r_d as y). So you should look more into tran.2D I believe (same goes for grid.2D and ode.2D). Take a look at the full manual cran.r-project.org/web/packages/ReacTran/ReacTran.pdf or cran.r-project.org/web/packages/ReacTran/vignettes/PDE.pdf PS: never triedr
so I won't venture at an answer
– PilouPili
Nov 10 at 22:42
add a comment |
Your PDE is really 2D+time (r_e as x and r_d as y). So you should look more into tran.2D I believe (same goes for grid.2D and ode.2D). Take a look at the full manual cran.r-project.org/web/packages/ReacTran/ReacTran.pdf or cran.r-project.org/web/packages/ReacTran/vignettes/PDE.pdf PS: never triedr
so I won't venture at an answer
– PilouPili
Nov 10 at 22:42
Your PDE is really 2D+time (r_e as x and r_d as y). So you should look more into tran.2D I believe (same goes for grid.2D and ode.2D). Take a look at the full manual cran.r-project.org/web/packages/ReacTran/ReacTran.pdf or cran.r-project.org/web/packages/ReacTran/vignettes/PDE.pdf PS: never tried
r
so I won't venture at an answer– PilouPili
Nov 10 at 22:42
Your PDE is really 2D+time (r_e as x and r_d as y). So you should look more into tran.2D I believe (same goes for grid.2D and ode.2D). Take a look at the full manual cran.r-project.org/web/packages/ReacTran/ReacTran.pdf or cran.r-project.org/web/packages/ReacTran/vignettes/PDE.pdf PS: never tried
r
so I won't venture at an answer– PilouPili
Nov 10 at 22:42
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%2fstackoverflow.com%2fquestions%2f53238389%2fr-desolve-partial-differential-equation%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
Your PDE is really 2D+time (r_e as x and r_d as y). So you should look more into tran.2D I believe (same goes for grid.2D and ode.2D). Take a look at the full manual cran.r-project.org/web/packages/ReacTran/ReacTran.pdf or cran.r-project.org/web/packages/ReacTran/vignettes/PDE.pdf PS: never tried
r
so I won't venture at an answer– PilouPili
Nov 10 at 22:42