# Gyrator in matlab

I am new to matlab , i am trying to simulate a simple circuit to check my calculation I have done on paper.

The circuit is the following, it has a gyrator and couple resistors.1 amp is flowing into the circuit.You can see the node names on matlab picture.

I got the following equations:

Solved with calculator:

The results:

I built the circuit in matlab simulink but i got different results there. I am pretty sure missing something. Here is the matlab circuit:

Values for the resistors and gyrator set correctly, the names show the resistors resistance. Gyrator conductance set :3.141592654

My problem is that i get different values for the nodes' potential not even close to that i have calculated.

So if you canfind what i am missing please tell me. Thank you

• If solver A doesn't equal solver B then make a very, very simple circuit to solve and it should be obvious which method is correct. – Andy aka Mar 17 '18 at 19:30
• What are $\gamma$ and $\psi$ suppose to represent? There's inconsistent notation in your equations. You appear to be switching variables. – user103380 Mar 17 '18 at 19:31
• @Andy aka I have used matlab for solving a circuit that had more components then this. I am almost certain ,becaused i checked couple times ,that i didn't miss calculated or something. The problem is in my matlab skills . – Levente Bartos Mar 17 '18 at 19:41
• @KingDuken Sorry for the various names for the variables. The psi and phi represents node potential relatively to 0V. I used psi on the calculator and phi on the matlab and the hand drawed circuit. Sorry for that . – Levente Bartos Mar 17 '18 at 19:43
• @KingDuken I suppose the thing you think is a gamma that is actually is the gyrator conductance ,little r. – Levente Bartos Mar 17 '18 at 20:11

So you need to enter $\frac{1}{\pi}$ instead of $\pi$