File:ACPower-en.svg

Uploaded by Mewasul
Upload date 2019-03-30T16:26:14Z
MIME type image/svg+xml
Dimensions 576 × 432 px
File size 40.0 KB

Summary

Description
English: Current, voltage, power and average power for AC circuits. Similar to File:ACPower02CJC.png. Created using Python / Matplotlib.
Date
Source Own work
Author Åshild Telle
Other versions File:ACPower-no.svg, File:ACPower-nolabels.svg
SVG development
InfoField
 The SVG code is valid.
 This plot was created with Matplotlib.
Source code
InfoField

Python code

import numpy as np
import matplotlib.pyplot as plt


def current(i_hat, omega, theta_u, theta_i, r):
    return i_hat*np.cos(omega*r + theta_u - theta_i)

def voltage(u_hat, omega, r):
    return u_hat*np.cos(omega*r)

def power(P, omega, r):
    return P + P*np.cos(2*omega*r)

# parameteres

omega = theta_u = theta_i = P = 1
u_hat = 3
i_hat = 2

# x axes

rad = np.linspace(0, 2*np.pi, 100)
deg = np.linspace(0, 360, 100)

# y axes

v = voltage(u_hat, omega, rad)
c = current(i_hat, omega, theta_u, theta_i, rad)
p = power(P, omega, rad)
a = np.mean(p)*np.ones(100)

# plot values

for y in (v, c, p, a):
    plt.plot(deg, y, linewidth=2)

plt.xlabel("Degrees", fontsize=10)
plt.ylabel("Volt (V) / Ampere (A) / Watt (W) / Watt (W)", fontsize=10)
plt.legend(["Voltage", "Current", "Power", "Average"], loc=4, fontsize=15)
plt.savefig("ACPower-en.svg")
plt.show()

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

Captions

Relation between current, voltage and power in AC circuits.

Items portrayed in this file

depicts

30 March 2019

image/svg+xml

1a4a2cbbbb20808c2b67d844feb11fcc14bc297c

41,006 byte

432 pixel

576 pixel

Category:AC waves Category:CC-Zero Category:Electricity diagrams Category:Self-published work Category:Valid SVG created with Matplotlib code