Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diffusionC = 1;
- charge = 1;
- mobility = 1;
- equation =
- D[u[t, x], t] == -D[-diffusionC*D[u[t, x], x] -
- charge*mobility*u[t, x]*D[[CapitalPhi][t, x], x], x];
- potential = [CapitalPhi][t, x] == -2.5*x + 5;
- ic = {(D[[CapitalPhi][t, x], t] /. t -> 0) == 0, [CapitalPhi][0, x] == 5 - 2.5 x}
- bc = {u[t, 0] == 8, u[t, 2] == 0}
- sol = NDSolve[{equation, potential, ic, bc}, {u, [CapitalPhi]}, {t, 0, 10}, {x, 0, 2}]
- Plot3D[u[t, x] /. sol, {x, 0, 2}, {t, 0, 10}, PlotRange -> All, AxesLabel -> {x, t, u}]
- Plot3D[[CapitalPhi][t, x] /. sol, {x, 0, 2}, {t, 0, 10},
- PlotRange -> All, AxesLabel -> {x, t, [CapitalPhi]}]
- NDSolve::ibcinc: Warning: boundary and initial conditions are inconsistent. >>
- NDSolve::bcart: Warning: an insufficient number of boundary conditions have
- been specified for the direction of independent variable x. Artificial
- boundary effects may be present in the solution. >>
- bc = {u[t, 0] == 8-7*Exp[-1000t], u[t, 2] == 0}
- NDSolve::ibcinc: Warning: boundary and initial conditions are inconsistent. >>
- NDSolve::bcart: Warning: an insufficient number of boundary conditions have
- been specified for the direction of independent variable x. Artificial
- boundary effects may be present in the solution. >>
- NDSolve::mconly: For the method IDA, only machine real code is available.
- Unable to continue with complex values or beyond floating-point exceptions. >>
- NDSolve::eerr: Warning: scaled local spatial error estimate of
- 652895.9781327343` at t = 0.14272838549715564` in the direction of
- independent variable x is much greater than the prescribed error tolerance.
- Grid spacing with 25 points may be too large to achieve the desired accuracy
- or precision. A singularity may have formed or a smaller grid spacing can be
- specified using the MaxStepSize or MinPoints method options. >>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement