Got Questions? Get Answers.
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:
exponential integrator error

Subject: exponential integrator error

From: Suyash

Date: 26 Feb, 2013 23:44:10

Message: 1 of 1

Hello,

I am trying to write an equation that is that is similar to below equation. In this equation 0/int/t = integrate from 0 to t. Ta and Texp are constants.

I (t) =(1/Ta) * 0/int/t r(t) exp(t?t /Texp)dt'

Here is how I have written it, which I cannot get to work... Thanks in advance for your help!


function tstexpa
ta = 2e-1;
texp = 1e-1;
nt=1024*32;
dt=10/nt;
%
figure(1) % PLA step response
s=ones(nt,1);
t=(0:(nt-1))*dt;
r1=expadpt(s,ta,texp,dt);
plot(t,r1)
tlim=[-0.01 1];
subplot(3,1,1)
plot(t,r1)
axis([tlim/10 0 1])
title('PLA step response')
legend('Exp','PLA')
subplot(3,1,2)
plot(t,r1)
axis([tlim 0 0.8])
ylabel('normalized rate')
subplot(3,1,3)
plot(t,r1)
axis([tlim*10 0 0.6])
xlabel('time (s)')
%
return

function r=expadpt(s,ta,texp,dt)
r=s;
nt=length(s);
t=(1:nt)'*dt;
for k=2:nt
    m=1:(k-1);
    I = (1/ta) * sum(r(m).*exp((t(m)-k)./texp)) * dt;
    r(k)=max(0,s(k)-I);
end
return

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