Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: analytical solution laminar flow in rectangular microchannel
Replies: 29   Last Post: Mar 21, 2013 4:58 AM

 Search Thread: Advanced Search

 Messages: [ Previous | Next ]
 Torsten Hennig Posts: 2,419 Registered: 12/6/04
Re: analytical solution laminar flow in rectangular microchannel
Posted: Oct 30, 2012 3:31 AM
 Plain Text Reply

> I tried the codes but there is error.
>
> In an assignment A(I) = B, the number of elements in
> B and I must be the same.
>
> How to identify the error?
>
> Thank you.
>
> Regards,
> Anne

I could identify one error in the code: in the definition of term1, you will have to use y(i) instead of y.
And take care that w,h and z are scalars, not vectors.

eps=1e-8;

For i = 1:21
y(i) = 5*(i-1);
term1 = 1.0;
term2 = 1.0;
n = 1;
a = 0;
b = 0;
While (term1 > eps) | (term2 > eps)
term1 = 1/n^3 [1-(cosh(n*pi* y(i)/h))/(cosh(n*pi* w/h))]* sin(n*pi* z/h);
term2 = 192*h/(n^5* pi^5* w)*tanh(n*pi*w/h)
a=a+term1;
b=b+term2;
n=n+2;
end
b=1-b;
ux(i)=48*Q/(pi^3*h*w)*a/b;
end

Best wishes
Torsten.

Date Subject Author
10/28/12 Anne
10/29/12 Torsten Hennig
10/29/12 Anne
10/29/12 Torsten Hennig
10/29/12 Anne
10/30/12 Torsten Hennig
10/31/12 Torsten Hennig
11/3/12 Anne
11/3/12 Torsten Hennig
11/4/12 Anne
11/5/12 Torsten Hennig
11/16/12 Anne
11/16/12 Torsten Hennig
11/16/12 Anne
11/19/12 Torsten Hennig
11/19/12 Torsten Hennig
12/3/12 Anne
12/4/12 Torsten Hennig
12/4/12 Anne
12/4/12 Torsten Hennig
12/4/12 Anne
12/4/12 Torsten Hennig
12/4/12 Anne
12/4/12 Torsten Hennig
12/4/12 Anne
12/5/12 Torsten Hennig
12/5/12 Anne
12/5/12 Anne
12/6/12 Torsten Hennig
3/21/13 Anne

© The Math Forum at NCTM 1994-2018. All Rights Reserved.