Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lecture-tutorials
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adam Friedrich Schrey
lecture-tutorials
Commits
39279ba3
Commit
39279ba3
authored
3 years ago
by
Adam Friedrich Schrey
Browse files
Options
Downloads
Patches
Plain Diff
Update Sandkasten.ipynb
parent
33201aae
No related branches found
No related tags found
1 merge request
!1
merge develop into master
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
notebooks/Sandkasten.ipynb
+1
-1
1 addition, 1 deletion
notebooks/Sandkasten.ipynb
with
1 addition
and
1 deletion
notebooks/Sandkasten.ipynb
+
1
−
1
View file @
39279ba3
...
...
@@ -105,7 +105,7 @@
"id": "sapphire-member",
"metadata": {},
"source": [
"# Liste nützlicher Funktionen für Matrizen und Funktionen:\n",
"# Liste nützlicher Funktionen für Matrizen und
mathematische
Funktionen:\n",
"print_det(M)\n",
"\n",
"print_rank(M)\n",
...
...
%% Cell type:markdown id:sacred-child tags:
# <span style='color:OrangeRed'>Sandkasten</span>
%% Cell type:code id:adaptive-optimum tags:
```
python
from
systheo2functions
import
*
%
matplotlib
inline
```
%% Cell type:code id:outdoor-confidence tags:
```
python
# Untersuche Eigenschaften einer beliebigen Regelstrecke:
Gs
=
80
/
((
1
+
2
*
s
)
**
7
)
#Gebe hier eine beliebige Funktion ein; s**N steht für s^N
print
(
"
Gs:
"
+
str
(
Gs
))
plt_bode
(
Gs
)
margin
(
Gs
)
#plt_nyquist(G,x-Skalierung,y-Skalierung,x-Anfang,x-Ende):
plt_nyquist
(
Gs
,
0.5
,
0.4
,
-
20
,
0
)
#Benutze plt_nyquist(Gs,1,1,0,0) um das ganze Diagramm zu sehen
```
%% Cell type:code id:fresh-reviewer tags:
```
python
# Erstellen einer einfachen Simulation mit einem Eingangs- und einem Ausgangs-Signal:
tini
=
0
# Start time
tfinal
=
1.5
# End time
dt
=
0.001
# Time Step
nflows
=
3
# Number of data flows in the schematic
Ts
=
0.1
# Sampling time for discrete time
sc
=
Schema
(
tini
,
tfinal
,
dt
,
nflows
)
# Instance of the simulation schematic
c1
=
SinusoidalSignalSource
(
1
,
0
,
1
,
2
*
pi
,
0
)
#SinusoidalSignalSource(out,startv,Am,om,phi)
c2
=
TransferFunction
(
1
,
2
,[
1
],[
1
,
1
]);
#TransferFunction(inp,out,num,den)
sc
.
AddListComponents
(
np
.
array
([
c1
,
c2
]));
#Run the schematic and plot:
out
=
sc
.
Run
(
np
.
array
([
1
,
2
]))
fig
=
plt
.
figure
()
ax
=
fig
.
add_subplot
(
1
,
1
,
1
)
fig
.
set_dpi
(
120
)
ax
.
plot
(
out
[
0
,:],
out
[
1
,:],
out
[
0
,:],
out
[
2
,:])
ax
.
grid
()
ax
.
legend
([
'
Eingangssignal (SinusoidalSignalSource)
'
,
'
Ausgangssignal durch TransferFunction
'
])
plt
.
show
()
```
%% Cell type:code id:hungry-newton tags:
```
python
``
`
%%
Cell
type
:
code
id
:
elementary
-
lambda
tags
:
```
python
```
%% Cell type:code id:moving-knock tags:
```
python
```
%% Cell type:markdown id:sapphire-member tags:
# Liste nützlicher Funktionen für Matrizen und Funktionen:
# Liste nützlicher Funktionen für Matrizen und
mathematische
Funktionen:
print_det(M)
print_rank(M)
print_eig(M)
matmul_loop(mats)
plt_bode(G)
plt_nyquist(G,scale_x,scale_y,x0,x1)
margin(G)
# Liste nützlicher Klassen für Simulationen:
StepSource(out,startv,endv,ts)
SinusoidalSignalSource(out,startv,Am,om,phi)
SquareSignal(out,hi,lo,f,duty)
Constant(out,value)
Division(in1,in2,out)
Product(in1,in2,out)
Sum(in1,in2,out,sign1,sign2)
Saturation(inp,out,minout,maxout)
Gain(inp,out,k)
PI(inp,out,Kp,Ki,ini)
PID(inp,out,Kp,Ki,Kd,ini)
Integrator(inp,out,ini)
Not(inp,out)
StateSpace(inp,out,A,B,C,D,xo)
TransferFunction(inp,out,num,den)
### -------
FIR(inp,out,a,ts)
DTIntegral(inp,out,ts,xo)
ZOH(inp,out,ts)
DTDelay(inp,out,init,ts)
IIR(inp,out,a,b,ts)
DTTransferFunction(inp,out,num,den,Ts)
DTStateSpace(inp,out,A,B,C,D,xo,Ts)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment