Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Anyone has "'Seen" this "Unseen" boundary condition?

Subject: Anyone has "'Seen" this "Unseen" boundary condition?

From: Baha

Date: 11 Jul, 2013 09:11:13

Message: 1 of 3

Hi,
I have been trying to solve a problem, in which there are coupled term in Neumann BCs.

They look like this:
@x=d -> D(u1)/Dx = 1*(u4 - u1*(1 - u4));
@y=0 -> D(u1)/Dy =-1*(u4 - u1*(1 - u4));

I defined these conditions while creating boundary condition matrix (b) as following
xBd_1 = ' 1 * ( u(4,:) - u(1,:) . * (1 - u(4,:) )';
yB0_1 = '-1 * ( u(4,:) - u(1,:) . * (1 - u(4,:) )';

PDE toolbox accepts the numeric codes of each character, so I had to do this
ChxBd_1 = double(char(xBd_1));
ChyB0_1 = double(char(yB0_1));

And these numerical values go into the boundary matrix and I used "pdenonlin" to solve it. I applied this method for other boundary conditions, e.g., for boundary conditions of constant, x and y linear or nonlinear etc. and works perfectly. But, whatsoever I couldn't get it worked for coupled main variables as above, u(1,:) and u(4,:). This problem has u1, u2, u3, u4 variables. The code sucks once it reaches the comma term "," in expression u(1,:). And it gives this error message "Invalid expression ',' when evaluating boundary conditions."

Question?
* Can I define u1 and u4 as u(1,:) & u(4,:) in the boundary matrix? I think I can't since it didn't work for me as explained above. If I can define them in a way, can you explain how?
* Is there anyone who has seen this type of coupled boundary condition before? I haven't seen as I searched for so far.

Thanks,
Baha

Subject: Anyone has "'Seen" this "Unseen" boundary condition?

From: Torsten

Date: 11 Jul, 2013 09:40:30

Message: 2 of 3

"Baha " <ibaha411@gmail.com> wrote in message <krlsrh$62a$1@newscl01ah.mathworks.com>...
> Hi,
> I have been trying to solve a problem, in which there are coupled term in Neumann BCs.
>
> They look like this:
> @x=d -> D(u1)/Dx = 1*(u4 - u1*(1 - u4));
> @y=0 -> D(u1)/Dy =-1*(u4 - u1*(1 - u4));
>
> I defined these conditions while creating boundary condition matrix (b) as following
> xBd_1 = ' 1 * ( u(4,:) - u(1,:) . * (1 - u(4,:) )';
> yB0_1 = '-1 * ( u(4,:) - u(1,:) . * (1 - u(4,:) )';
>
> PDE toolbox accepts the numeric codes of each character, so I had to do this
> ChxBd_1 = double(char(xBd_1));
> ChyB0_1 = double(char(yB0_1));
>
> And these numerical values go into the boundary matrix and I used "pdenonlin" to solve it. I applied this method for other boundary conditions, e.g., for boundary conditions of constant, x and y linear or nonlinear etc. and works perfectly. But, whatsoever I couldn't get it worked for coupled main variables as above, u(1,:) and u(4,:). This problem has u1, u2, u3, u4 variables. The code sucks once it reaches the comma term "," in expression u(1,:). And it gives this error message "Invalid expression ',' when evaluating boundary conditions."
>
> Question?
> * Can I define u1 and u4 as u(1,:) & u(4,:) in the boundary matrix? I think I can't since it didn't work for me as explained above. If I can define them in a way, can you explain how?
> * Is there anyone who has seen this type of coupled boundary condition before? I haven't seen as I searched for so far.
>
> Thanks,
> Baha

In both expressions (for xBd_1 and yBd_1), I see 5 brackets opening and 4 brackets closing ...

Best wishes
Torsten.

Subject: Anyone has "'Seen" this "Unseen" boundary condition?

From: Baha

Date: 11 Jul, 2013 17:59:06

Message: 3 of 3

Hi Torsten,
It is my bad, while copying an simplifying the expression, I misplaced braces. In my original code, it is correct.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us