# Excercises Electric Machinery Fundamentals
## Chapter 6

## Animation: Determining the rotor-slip with  a compass


```python
from sympy import init_session
init_session()
%matplotlib inline
```

    IPython console for SymPy 1.0 (Python 3.5.2-64-bit) (ground types: python)
    
    These commands were executed:
    >>> from __future__ import division
    >>> from sympy import *
    >>> x, y, z, t = symbols('x y z t')
    >>> k, m, n = symbols('k m n', integer=True)
    >>> f, g, h = symbols('f g h', cls=Function)
    >>> init_printing()
    
    Documentation can be found at http://docs.sympy.org/1.0/


Look at a superposition of two sinusoidal signals:


```python
f=sin(x)*sin(y)
f
```

This product can be rewritten as a sum using trigonometric equalities. SymPy has a special function for those:


```python
from sympy.simplify.fu import *
g=TR8(f)     # TR8 is a trigonometric expression function from Fu paper
Eq(f, g)
```

Now let us take an example with two different angular frequencies:


```python
s = 0.03        # slip
fs = 50         # stator frequency in Hz
fr = (1-s)*fs   # rotor frequency in Hz
fr
```


```python
alpha=2*pi*fs*t
beta=2*pi*fr*t
```

Now plot the product of both frequencies:


```python
# Create the plot of the stator rotation frequency in blue:
p1=plot(sin(alpha), (t, 0, 1), show=False, line_color='b', adaptive=False, nb_of_points=5000)
# Create the plot of the rotor rotation frequency in green:
p2=plot(0.5*sin(beta), (t, 0, 1), show=False, line_color='g', adaptive=False, nb_of_points=5000)
# Create the plot of the combined flux in red:
p3=plot(0.5*f.subs([(x, alpha), (y, beta)]), (t, 0, 1), 
            show=False, line_color='r', adaptive=False, nb_of_points=5000)
# Make the second and third one a part of the first one.
p1.extend(p2)
p1.extend(p3)
# Display the modified plot object.
p1.show()
```

0a6d47db3b8e1d82d22a6069b8d6f71d10977d5d
ipynb
Jupyter Notebook
Chapman/Ch6-Animation_RotorSlipMeasurementWithCompass.ipynb
ofgod2/Ejercicios-de-Maquinas-Electricas
b6065da11d9826d8800e82baa3346b4501e1d4ff
Unlicense
Chapman/Ch6-Animation_RotorSlipMeasurementWithCompass.ipynb
ofgod2/Ejercicios-de-Maquinas-Electricas
b6065da11d9826d8800e82baa3346b4501e1d4ff
Unlicense
Chapman/Ch6-Animation_RotorSlipMeasurementWithCompass.ipynb
ofgod2/Ejercicios-de-Maquinas-Electricas
b6065da11d9826d8800e82baa3346b4501e1d4ff
Unlicense
Qwen/Qwen-72B
1. YES
2. YES