Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5128 > unrolled thread
| Started by | DrMajorBob <btreat1@austin.rr.com> |
|---|---|
| First post | 2011-09-21 09:43 +0000 |
| Last post | 2011-09-21 09:43 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: boundary conditions DrMajorBob <btreat1@austin.rr.com> - 2011-09-21 09:43 +0000
| From | DrMajorBob <btreat1@austin.rr.com> |
|---|---|
| Date | 2011-09-21 09:43 +0000 |
| Subject | Re: boundary conditions |
| Message-ID | <j5cbkf$d32$1@smc.vnet.net> |
I didn't solve the problem, but I did make a few changes that may be
useful:
Clear[v]
alpham[v_] = (0.1 (-40 - v))/(Exp[(-40 - v)/10] - 1);
betam[v_] = 4*Exp[(-65 - v)/18];
alphah[v_] = 0.07*Exp[(-65 - v)/20];
betah[v_] = 1/(Exp[(-35 - v)/10] + 1);
alphan[v_] = 0.01 (-55 - v)/(Exp[(-55 - v)/10] - 1);
betan[v_] = 0.125 Exp[(-65 - v)/80];
eqv = Derivative[1, 0][v][t,
x] == (0.0238/(2*35400)) Derivative[0, 2][v][t, x] -
120 (v[t, x] - 50)*h[t, x]*m[t, x]^(3) -
36 (v[t, x] + 77)*n[t, x]^(4) - 0.3 (v[t, x] + 54.387) + 200;
eqm = Derivative[1, 0][m][t, x] ==
alpham[v[t, x]]*(1 - m[t, x]) - betam[v[t, x]]*m[t, x];
eqh = Derivative[1, 0][h][t, x] ==
alphah[v[t, x]]*(1 - h[t, x]) - betah[v[t, x]]*h[t, x];
eqn = Derivative[1, 0][n][t, x] ==
alphan[v[t, x]]*(1 - n[t, x]) - betan[v[t, x]]*n[t, x];
iniconds = {Derivative[1, 0][v][0, x] == 0,
Derivative[1, 0][m][0, x] == Derivative[1, 0][h][0, x] == 0,
Derivative[1, 0][n][0, x] == 0};
bconds = {Derivative[0, 1][v][t, 0] == 0,
Derivative[0, 1][m][t, 0] == 0, Derivative[0, 1][h][t, 0] == 0,
Derivative[0, 1][n][t, 0] == 0, Derivative[0, 1][v][t, 5] == 0,
Derivative[0, 1][m][t, 5] == 0, Derivative[0, 1][h][t, 5] == 0,
Derivative[0, 1][n][t, 5] == 0};
NDSolve[Join[{eqv, eqm, eqh, eqn}, iniconds, bconds], {v[t, x],
m[t, x], h[t, x], n[t, x]}, {t, 0, 5}, {x, 0, 5},
Method -> {"MethodOfLines",
"SpatialDiscretization" -> {"TensorProductGrid",
MinPoints -> 1000}}, PrecisionGoal -> 2]
SetDelayed wasn't needed and, in defining alpham and alphan, it makes no
difference what the value is at a single point -- v==-40 or -55. "Which"
is also NOT differentiable, so your definitions could cause problems
(potentially). If you meant v <= -40 or something like that, try using
UnitStep or HeavisideTheta, rather than Which.
Reversing the order of the variables in NDSolve -- {t, 0, 5}, {x, 0, 5}
rather than the other way around -- caused the error message to mention m
rather than something unrecognizable, like TemporaryVariable$3339. The
complaint is about (m^(0,1))[t,0], which DOES appear in your boundary
conditions, but it seems to match the condition that WORKS (not the one
that doesn't) in the ONLY help example for the error message. Obviously,
more examples are needed.
Beyond that, sorry, I don't understand the problem well enough to help.
Bobby
On Tue, 20 Sep 2011 01:56:26 -0500, tahereh tekieh <golesang80@gmail.com>
wrote:
> I had attached the nb file but anyway i write it here as well.
>
> alpham[v_] := Which [v == -40, 1, True, (0.1 (-40 - v))/(Exp[(-40 -
> v)/10]
> - 1) ];
>
> betam[v_] := 4*Exp[(-65 - v)/18];
>
> alphah[v_] := 0.07*Exp[(-65 - v)/20];
>
> betah[v_] := 1/(Exp[(-35 - v)/10] + 1);
>
> alphan[v_] := Which [v == -55, 1, True, 0.01 (-55 - v)/(Exp[(-55 -
> v)/10]
> - 1)] ;
>
> betan[v_] := 0.125 Exp[(-65 - v)/80];
>
> eqv = Derivative[1, 0][v][t, x] == (0.0238/(2*35400)) Derivative[0,
> 2][v][t,
> x] - 120 (v[t, x] - 50)*h[t, x]*m[t, x]^(3) -
> 36 (v[t, x] + 77)*n[t, x]^(4) - 0.3 (v[t, x] + 54.387) + 200;
>
> eqm = Derivative[1, 0][m][t, x] == alpham[v[t, x]]*(1 - m[t, x]) -
> betam[v[t, x]]* m[t, x];
>
> eqh = Derivative[1, 0][h][t, x] == alphah[v[t, x]]*(1 - h[t, x]) -
> betah[v[t, x]]* h[t, x];
>
> eqn = Derivative[1, 0][n][t, x] == alphan[v[t, x]]*(1 - n[t, x]) -
> betan[v[t, x]]* n[t, x];
>
> iniconds = {Derivative[1, 0][v][0, x] == Derivative[1, 0][m][0, x] ==
> Derivative[1, 0][h][0, x] == Derivative[1, 0][n][0, x] == 0};
>
> bconds = {Derivative[0, 1][v][t, 0] == Derivative[0, 1][m][t, 0]
> ==Derivative[0, 1][h][t, 0] == Derivative[0, 1][n][t, 0] == 0,
> Derivative[0, 1][v][t, 5] == Derivative[0, 1][m][t, 5] ==Derivative[0,
> 1][h][t, 5] == Derivative[0, 1][n][t, 5] == 0};
>
> here's the last statement which the error occures:
>
> solution =NDSolve[Join[{eqv, eqm, eqh, eqn}, iniconds, bconds], {v[t,
> x],m[t, x], h[t, x], n[t, x]}, {x, 0, 5}, {t, 0, 5},
> Method -> {"MethodOfLines", "SpatialDiscretization" ->
> {"TensorProductGrid",MinPoints -> 1000}}, PrecisionGoal -> 2];
>
> and this is the error:
> NDSolve::bdord: Boundary condition (TemporaryVariable$2704^(1,0))[0,t]
> should have derivatives of order lower than the differential order of the
> partial differential equation. >>
>
> On Mon, Sep 19, 2011 at 3:56 PM, DrMajorBob <btreat1@austin.rr.com>
> wrote:
>
>> Show us the statements in which the error occurs.
>>
>> We're not mind-readers.
>>
>> Bobby
>>
>>
>> On Mon, 19 Sep 2011 03:32:26 -0500, tahereh tekieh
>> <golesang80@gmail.com>
>> wrote:
>>
>> Dear Bobby,
>>> Thanks for the clue, I have attached my notebook file, the problem is
>>> with
>>> this legal expression I'll receive an bdord error. I have no idea how
>>> to
>>> impose my boundary condition the way it is. I am looking to hearing
>>> from
>>> you.
>>> regards
>>>
>>> On Sun, Sep 18, 2011 at 10:29 PM, DrMajorBob <btreat1@austin.rr.com>
>>> wrote:
>>>
>>> Neither one is a legal expression, so I suppose there is no
>>> difference.
>>>>
>>>> Try instead:
>>>>
>>>> Derivative[0, 1][v][t, 0]
>>>>
>>>> Bobby
>>>>
>>>> On Sun, 18 Sep 2011 07:19:50 -0500, goli <golesang80@gmail.com> wrote:
>>>>
>>>> what is the difference between these boundary conditions? do they
>>>>
>>>>> represent the same thing?
>>>>> Derivative[0,1]v[t,0]==0
>>>>> v(0,1)[t,0]==0
>>>>>
>>>>>
>>>>>
>>>> --
>>>> DrMajorBob@yahoo.com
>>>>
>>>>
>>
>> --
>> DrMajorBob@yahoo.com
>>
--
DrMajorBob@yahoo.com
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web