# Simulink model of RLC circuit (2nd order differential equations)

4 views (last 30 days)
Tech on 29 Jun 2022
Commented: Tech on 29 Jun 2022
Hello guys,
I have those differential equations, that describe currents in RLC circuit: Then i created a model of those equations in Simulink: I set values of R,L,C like this:
R = 1000
L = 1.0000e-06
C = 2.0000e-12
and my problem is that I am getting error message when I try to run the Simulink model. Does anyone, please, know where the problem is?
##### 2 CommentsShowHide 1 older comment
Tech on 29 Jun 2022
Hello,
I will close my previous question as anwered.
I want to you those math blocks, because i believe that if i will go that way i will be able to get graphs of current or voltage from one part of the RLC circuit (for example i could get graph of current on resistor or something like that).
Do you know how could i solve my problem with that error message in this simulation?
Thank you.

Sam Chak on 29 Jun 2022
The first impression is that the singularity might be caused by the "Division by zero" issue.
Looking at your differential equations, four terms have divisions by .
Note that and are both very small numbers.
In fact, is even smaller than eps, the floating-point relative accuracy.
L = 1e-6;
C = 2e-12;
Test = L*C < eps % 1 is True, 0 is False
Test = logical
1
Tech on 29 Jun 2022
New Update of my situation.
I have found some mathematical mistakes I have made and i set values of L and C to bigger one and it is somehow working.
I will now mark this question as anwered and if i will have any more problems I will create a new article.
Thank you very much.

R2019b

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!