Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Divide block in simulink

660 views
Skip to first unread message

Didi Istardi

unread,
Feb 7, 2009, 4:04:02 PM2/7/09
to
Hi..

can anyone give me a way to avoid zero division in divide block in simulink..

cause i always have a problem with zero division or in singularities..

thanks

Srikanth

unread,
Feb 7, 2009, 4:39:30 PM2/7/09
to

What do you expect the simulation to do when there does come a
computation with a divide by zero error occurs? I'm not sure if there
is a generic block for this - you could always use a switch that takes
in the 'denominator' and checks for a zero - if there is one, take an
alternate path or add a small offset to the denominator before
continuing on.

Giampiero Campa

unread,
Feb 9, 2009, 9:11:57 AM2/9/09
to

instead of doing a/b, you can do a/(b+realmin*sign(b))

realmin is 2.2251e-308 so it does not have any effect on any practical
division.

G.


"Didi Istardi" <ist...@gmail.com> wrote in message
news:gmkt01$os$1...@fred.mathworks.com...

Didi Istardi

unread,
Feb 15, 2009, 12:14:02 PM2/15/09
to
thanks for your advice..

now my simulation don't have problem again

"Giampiero Campa" <Giampie...@mail.wvu.edu> wrote in message <gmpdjn$12e$1...@fred.mathworks.com>...

0 new messages