Cant create a variable capacitor in simulink
Mostra commenti meno recenti
Hey,
I am trying to create a model of the cardiovascular system and in this i am using a circuit to model the circulatory system. I have to create a capacitor which is the 'heart' and the circuit it is attached to eg. resistors are the blood vessels etc.
I have to create a variable capacitor so that stimulus depends on time and is not constant.
Now the problem i am having is when i attach the variable capacitor to the circuit and measure the voltage which is the 'flow' i keep getting 0. like almost as if there is no reading. Whats wrong with my circuit.
I have attached my circuit below. Please any help would be appreciated thanks.

1 Commento
Saurabh Sakpal
il 2 Feb 2015
Risposta accettata
Più risposte (2)
Saurabh Sakpal
il 3 Feb 2015
0 voti
Saurabh Sakpal
il 3 Feb 2015
Modificato: Saurabh Sakpal
il 3 Feb 2015
0 voti
1 Commento
Sebastian Castro
il 3 Feb 2015
Modificato: Sebastian Castro
il 3 Feb 2015
Saurabh,
For the algebraic loop situation, you are seeing this because you're taking an output from the Simscape network and feeding it back as an input without any delays/other ways to break the loop.
If you're building a custom capacitor (i.e., the equations are part of your physical system), I would make the following recommendations:
- Instead of using Simulink blocks, try using the Simscape > Foundation Library > Physical Systems library. If you build the same equations using these blocks, you will not get algebraic loops.
- Use the Simscape Language to build your own custom Simscape block. You can even start with the equations from the built-in Simscape Capacitor block by double-clicking it and selecting "View source code", then making modifications from there.
Sort of unrelated, but the Simulink derivative block is typically not recommended. If possible, try build your equations "backwards" and use an Integrator block instead. Integrator blocks actually hold a state in memory and play nicer with the Simulink solver because of this.
For the second issue, it's not too big a deal. Component equations for "symmetric" components like springs, inductors, resistors, etc. will not affect the behavior of your system. All this means is that, when you flip the block around, the measured current/voltage values will be negative of what they were before. It's just sign convention.
If you flip something like a diode now... that's when you start changing the behavior of the overall system.
- Sebastian
Categorie
Scopri di più su Nonlinear Operators in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




