File:ACPower-en.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 576 × 432 pixels, file size: 40 KB)

Captions

Captions

Relation between current, voltage and power in AC circuits.

Summary[edit]

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[edit]

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.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current16:26, 30 March 2019Thumbnail for version as of 16:26, 30 March 2019576 × 432 (40 KB)Mewasul (talk | contribs)current and voltage swapped
16:13, 30 March 2019Thumbnail for version as of 16:13, 30 March 2019576 × 432 (43 KB)Mewasul (talk | contribs)Font size
15:54, 30 March 2019Thumbnail for version as of 15:54, 30 March 2019576 × 432 (43 KB)Mewasul (talk | contribs)python 3 version :)
15:46, 30 March 2019Thumbnail for version as of 15:46, 30 March 2019720 × 540 (48 KB)Mewasul (talk | contribs)User created page with UploadWizard

There are no pages that use this file.

Metadata