# No specific error message for algebraic loop with C-script

**URL:** <https://forum.plexim.com/t/no-specific-error-message-for-algebraic-loop-with-c-script/635>\
**Category:** PLECS\
**Tags:** c-script, algebraic-loop\
**Created:** [March 8, 2019, 7:35am UTC](https://forum.plexim.com/t/no-specific-error-message-for-algebraic-loop-with-c-script/635 "2019-03-08T07:35:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martello](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@Martello](https://forum.plexim.com/u/Martello)\
**Post date:** [March 8, 2019, 7:35am UTC](https://forum.plexim.com/t/no-specific-error-message-for-algebraic-loop-with-c-script/635/1 "2019-03-08T07:35:50Z")

</div>

I want to model a varistor using the functional description given by the manufacturer Littelfuse for PSPICE. The characteristic of the Varistor is modeled as a power function combined with a linear behavior around current zero. I use a variable voltage source which is controlled by the current through itself. It is clear that that is an algebraic loop, but the error message that I get don’t show me where the problem is in detail.

[Varistor2.plecs](https://forum.plexim.com/uploads/short-url/5cPpJFifXDfHNJj4vqu2yQxzvJb.plecs) (14.1 KB)

---

<div class="post-metadata">

**Author:** ![Kris\_Eberle](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/kris_eberle/32/6_2.png) [@Kris\_Eberle](https://forum.plexim.com/u/Kris_Eberle)\
**Post date:** [March 11, 2019, 3:29pm UTC](https://forum.plexim.com/t/no-specific-error-message-for-algebraic-loop-with-c-script/635/2 "2019-03-11T15:29:33Z")

</div>

Hello,

The problem stems from exactly what you said- the voltage is directly affected by the current through the voltage source, which is not allowed mathematically. Have you tried using the Variable Resistor component included in the PLECS component library?

Kris
