Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: rounding issue
Date: Sat, 21 Mar 2009 09:05:04 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 27
Message-ID: <gq2ak0$gtp$1@fred.mathworks.com>
References: <gq04jp$8ee$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1237626304 17337 172.30.248.37 (21 Mar 2009 09:05:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 21 Mar 2009 09:05:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:526585


"G. B." <gavrilo.dot.bozovic@gmail.dot.ch> wrote in message <gq04jp$8ee$1@fred.mathworks.com>...
> Hi!
> 
> I have to calculate a voltage raise in a constant phase element, using following code:
> 
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> 
> I0 = -0.001;     % pulse current
> k = 0;
> temp=0;
> 
> while(k<1000)
>     Vtemp = (((-1)^k) * ((R*C)^(-k-1)) * (t^(alpha*(k+1))))/gamma(alpha*(k+1)+1);
>     if abs(Vtemp) < 1e-20
>         break
>     else
>         k = k+1;
>         temp = temp + Vtemp;
>     end
> end
> 

Was the above sum approximates an integral? How alpha is chosen? I guess it is related to a timestep? Have you analyzed what kind of error induced for the alpha you are using?

Sometime it's better to go back to the blackboard and take a new look on the original problem instead of persisting on the bad discretization.

Bruno