[Date Index]
[Thread Index]
[Author Index]
Re: boundary conditions
*To*: mathgroup at smc.vnet.net
*Subject*: [mg121600] Re: boundary conditions
*From*: DrMajorBob <btreat1 at austin.rr.com>
*Date*: Wed, 21 Sep 2011 05:35:53 -0400 (EDT)
*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com
*References*: <201109181219.IAA09184@smc.vnet.net>
*Reply-to*: drmajorbob at yahoo.com
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 at 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 at 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 at 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 at 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 at 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 at yahoo.com
>>>>
>>>>
>>
>> --
>> DrMajorBob at yahoo.com
>>
--
DrMajorBob at yahoo.com
Prev by Date:
**Re: Parallel remote kernel: MathLink connection not active**
Next by Date:
**Re: Compilation: Avoiding inlining**
Previous by thread:
**boundary conditions**
Next by thread:
**Re: boundary conditions**
| |