Re: NDSolve initial value problem

• To: mathgroup at smc.vnet.net
• Subject: [mg99232] Re: NDSolve initial value problem
• From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
• Date: Thu, 30 Apr 2009 06:24:27 -0400 (EDT)
• References: <gt90l4\$l1t\$1@smc.vnet.net>

```Hi Murat,

First, your definition of u is ok if you stick to the letter y,
otherwise it is better to use y_. I also would change the second
derivative to D[T[x, y], {y, 2}] for better looks.

To solve your problem I'd suggest changing the last condition:

pe = 0.5;
u[y_] = 1 - y^2;

sol =
NDSolve[
{
pe*u[y]*D[T[x, y], x] == D[T[x, y], {y, 2}],
T[0, y] == Piecewise[{{-y, y <= -1}, {0, -1 < y < 1}, {1, 1 <=
y}}],
T[x, 1] == 1,
T[x, -1] == 1
},
T[x, y], {x, 0, 1}, {y, -1, 1},
SolveDelayed -> True
]

g[x_, y_] = (T[x, y] /. sol[[1, 1]])
Animate[Plot[g[x, y], {y, -1, 1}, PlotRange -> {0, 1}], {x, 0, 1}]

Cheers -- Sjoerd

On Apr 29, 9:46 am, Murat Havzal=FD <gezginor... at gmail.com> wrote:
> Dear Mathematica users;
>
> I am trying to solve liquid heat/mass transfer equation with mixed bounda=
ry
> conditions.
>
> My code looks like this:
>
> pe=0.5;
>
> u[y]=1-y^2;
>
> sol=NDSolve[
>
> {
>
> pe*u[y]*D[T[x,y],x]==D[T[x,y],y,y],
>
> T[0,y]==Piecewise[{{-y,y<=-1},{0,-1< y<1},{1,1<=y}}],
>
> T[x,1]==1,
>
> (D[T[x,y],y]/.y->-1)==-1
>
> },
>
> T,{x,0,1},{y,-1,1},SolveDelayed->True];
>
> This returns inconsistent initial boundary conditions error.
>
> I also tried to make the piecewise initial condition, a numerical functio=
n
> namely:
>
> initial[y_?NumericQ]:=Piecewise[{{-y,y<=-1},{0,-1< y<1},{1,1<=y}}]
>
> However this did not work, too. I understand that there is a similar
>
> and I tried my best to convert it to my problem but couldn't. I couldn't
> find the code but I also tried to give the
>
> initial piecewise function as a interpolating function, it returned the s=
ame
> response.
>
> Any help would be appreciated.
>
> Thanks.
>
> Murat Havzal

```

• Prev by Date: Re: Copy/paste selection of a pdf on Mac
• Next by Date: Re: Inverse function warnings
• Previous by thread: Re: NDSolve initial value problem
• Next by thread: Manipulate + ListPlot3D +...
{"ft_lang_label":"__label__en","ft_lang_prob":0.8104756,"math_prob":0.95821464,"size":1978,"snap":"2023-14-2023-23","text_gpt3_token_len":732,"char_repetition_ratio":0.10587639,"word_repetition_ratio":0.011627907,"special_character_ratio":0.42366025,"punctuation_ratio":0.253493,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99418277,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],"im_url_duplicate_count":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-06-06T17:12:03Z\",\"WARC-Record-ID\":\"<urn:uuid:9475666e-b18c-4bc0-8f0a-9526527de8c8>\",\"Content-Length\":\"45631\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:703c5703-6302-4022-9233-fb1f4a9fabb9>\",\"WARC-Concurrent-To\":\"<urn:uuid:415546a6-bfdf-4947-b2ae-dc2c609b7a9b>\",\"WARC-IP-Address\":\"140.177.205.73\",\"WARC-Target-URI\":\"http://forums.wolfram.com/mathgroup/archive/2009/Apr/msg01106.html\",\"WARC-Payload-Digest\":\"sha1:G67MHJZQJH5H344YZG6U6CSSGHUCX2D4\",\"WARC-Block-Digest\":\"sha1:FXQA4ZHKNYEA7Y5DLBJMUDPJBRATMJUG\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-23/CC-MAIN-2023-23_segments_1685224652959.43_warc_CC-MAIN-20230606150510-20230606180510-00304.warc.gz\"}"}