v0 ordered
This commit is contained in:
36
sim/csvplotter.py
Normal file
36
sim/csvplotter.py
Normal file
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
import glob
|
||||
import pandas as pd
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
def plot_csv_files_in_directory(directory):
|
||||
"""
|
||||
Loads all CSV files in the given directory and creates a plot for each file.
|
||||
Assumes all CSV files have two columns. The plot title is the base filename.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
directory : str
|
||||
Path to the directory containing CSV files.
|
||||
|
||||
Returns
|
||||
-------
|
||||
None
|
||||
"""
|
||||
csv_files = glob.glob(os.path.join(directory, "*.csv"))
|
||||
for csv_file in csv_files:
|
||||
df = pd.read_csv(csv_file)
|
||||
if df.shape[1] != 3:
|
||||
continue # Skip files that do not have exactly two columns
|
||||
plt.figure()
|
||||
|
||||
plt.plot(df.iloc[:, 0], df.iloc[:, 1])
|
||||
plt.title(os.path.splitext(os.path.basename(csv_file))[0])
|
||||
plt.xlabel('Column 1')
|
||||
plt.ylabel('Column 2')
|
||||
plt.tight_layout()
|
||||
plt.show()
|
||||
|
||||
if __name__ == "__main__":
|
||||
plot_csv_files_in_directory("./csvs")
|
||||
80
sim/led puls.asc
Normal file
80
sim/led puls.asc
Normal file
@@ -0,0 +1,80 @@
|
||||
Version 4
|
||||
SHEET 1 1812 788
|
||||
WIRE 80 0 80 -80
|
||||
WIRE 208 0 80 0
|
||||
WIRE 80 48 80 0
|
||||
WIRE 80 176 80 128
|
||||
WIRE 160 176 80 176
|
||||
WIRE 208 176 208 64
|
||||
WIRE 208 176 160 176
|
||||
WIRE -144 224 -160 224
|
||||
WIRE -64 224 -80 224
|
||||
WIRE 80 240 80 176
|
||||
WIRE -160 320 -160 224
|
||||
WIRE -160 320 -240 320
|
||||
WIRE -144 320 -160 320
|
||||
WIRE -64 320 -64 224
|
||||
WIRE -64 320 -80 320
|
||||
WIRE 32 320 -64 320
|
||||
WIRE 80 384 80 336
|
||||
FLAG -240 400 0
|
||||
FLAG -1088 176 0
|
||||
FLAG -1088 96 +3
|
||||
FLAG -512 0 +3
|
||||
FLAG -448 0 +3
|
||||
FLAG -512 64 0
|
||||
FLAG -448 64 0
|
||||
FLAG -480 768 0
|
||||
FLAG -480 688 eta
|
||||
FLAG 80 -80 +3
|
||||
FLAG 80 384 0
|
||||
FLAG 160 176 led-
|
||||
SYMBOL diode 224 64 R180
|
||||
WINDOW 0 24 64 Left 2
|
||||
WINDOW 3 -209 -9 Left 2
|
||||
SYMATTR InstName D1
|
||||
SYMATTR Value LV_CRBP.01_25-min
|
||||
SYMBOL ind 64 32 R0
|
||||
SYMATTR InstName L1
|
||||
SYMATTR Value 1m
|
||||
SYMATTR SpiceLine Ipk=0.14 Rser=29
|
||||
SYMBOL nmos 32 240 R0
|
||||
SYMATTR InstName M1
|
||||
SYMATTR Value IRLML6244
|
||||
SYMBOL voltage -240 304 R0
|
||||
WINDOW 123 0 0 Left 0
|
||||
WINDOW 39 24 124 Left 2
|
||||
WINDOW 3 -369 135 Left 2
|
||||
SYMATTR InstName V1
|
||||
SYMATTR Value PULSE(0 3 1.2e-6 17e-9 17e-9 6.12e-6 16e-3)
|
||||
SYMBOL voltage -1088 80 R0
|
||||
WINDOW 123 0 0 Left 0
|
||||
WINDOW 39 24 124 Left 2
|
||||
SYMATTR SpiceLine Rser=100
|
||||
SYMATTR InstName V2
|
||||
SYMATTR Value 3
|
||||
SYMBOL cap -528 0 R0
|
||||
SYMATTR InstName C1
|
||||
SYMATTR Value 10<31>
|
||||
SYMBOL cap -464 0 R0
|
||||
SYMATTR InstName C2
|
||||
SYMATTR Value 10n
|
||||
SYMBOL bv -480 672 R0
|
||||
SYMATTR InstName B1
|
||||
SYMATTR Value V=idt(-V(+3,led-)*I(D1))/idt(-V(+3)*I(V2))
|
||||
SYMBOL diode -144 336 R270
|
||||
WINDOW 0 32 32 VTop 2
|
||||
WINDOW 3 0 32 VBottom 2
|
||||
SYMATTR InstName D2
|
||||
SYMATTR Value ID
|
||||
SYMBOL diode -80 208 R90
|
||||
WINDOW 0 0 32 VBottom 2
|
||||
WINDOW 3 32 32 VTop 2
|
||||
SYMATTR InstName D3
|
||||
SYMATTR Value ID
|
||||
TEXT 208 -328 Left 2 !.model LV_CRBP.01_25-min D (BV=7 IS=3.223817631764513e-14 N=3.454960721622244 RS=0.3874073653535945 Tnom=25 mfg=OSRAM_OS)
|
||||
TEXT -1152 8 Left 2 !.tran 0 20e-6
|
||||
TEXT 352 -240 Left 2 ;.step dec param R_snub 10k 100k 2
|
||||
TEXT -464 168 Left 2 !.model ID D(Ron=0 Roff=1G Vfwd=0 Ilimit=32e-3)
|
||||
TEXT -216 144 Left 2 ;current clamp model
|
||||
TEXT 232 264 Left 2 !.model ID2 D(Ron=0 Roff=1G Vfwd=4.2)
|
||||
23
sim/led puls.log
Normal file
23
sim/led puls.log
Normal file
@@ -0,0 +1,23 @@
|
||||
Circuit: * C:\Users\Joseph\Documents\Basteln\KiCAD\rosaled\led puls.asc
|
||||
|
||||
WARNING: Less than two connections to node ETA. This node is used by B1.
|
||||
Direct Newton iteration for .op point succeeded.
|
||||
Heightened Def Con from 7.337e-006 to 7.34055e-006
|
||||
|
||||
Date: Sat Jan 21 00:44:22 2023
|
||||
Total elapsed time: 0.074 seconds.
|
||||
|
||||
tnom = 27
|
||||
temp = 27
|
||||
method = modified trap
|
||||
totiter = 3860
|
||||
traniter = 3854
|
||||
tranpoints = 1300
|
||||
accept = 1223
|
||||
rejected = 78
|
||||
matrix size = 12
|
||||
fillins = 1
|
||||
solver = Normal
|
||||
Matrix Compiler1: 36 opcodes 0.1/[0.0]/0.1
|
||||
Matrix Compiler2: off [0.1]/0.1/0.1
|
||||
|
||||
BIN
sim/led puls.op.raw
Normal file
BIN
sim/led puls.op.raw
Normal file
Binary file not shown.
BIN
sim/led puls.plt
Normal file
BIN
sim/led puls.plt
Normal file
Binary file not shown.
BIN
sim/led puls.raw
Normal file
BIN
sim/led puls.raw
Normal file
Binary file not shown.
Reference in New Issue
Block a user