mirror of
https://github.com/gabrielkheisa/control-system.git
synced 2024-11-23 20:03:22 +07:00
Edit denumerator
This commit is contained in:
parent
55426d22b8
commit
335927a157
@ -2,7 +2,7 @@
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 132,
|
||||
"execution_count": 1,
|
||||
"metadata": {
|
||||
"id": "aDtFkeqAvLX2"
|
||||
},
|
||||
@ -15,7 +15,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 133,
|
||||
"execution_count": 4,
|
||||
"metadata": {
|
||||
"id": "Letb52yp47Gb"
|
||||
},
|
||||
@ -46,8 +46,12 @@
|
||||
"\n",
|
||||
" for i in range(2, height+2):\n",
|
||||
" for j in range(height-1):\n",
|
||||
" arr[i][j] = (arr[i-1][0]*arr[i-2][j+1] - arr[i-2][0]*arr[i-1][j+1])/arr[i-1][0]\n",
|
||||
" arr[i][j] = (arr[i-1][0]*arr[i-2][j+1] - arr[i-2][0]*arr[i-1][j+1])\n",
|
||||
" arr[i][j] += 0\n",
|
||||
" try:\n",
|
||||
" arr[i][j] /= arr[i-1][0]\n",
|
||||
" except ZeroDivisionError:\n",
|
||||
" arr[i][j] = 0\n",
|
||||
" \n",
|
||||
" self.df = pd.DataFrame(arr)\n",
|
||||
" self.show_tab()\n",
|
||||
@ -82,27 +86,27 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 134,
|
||||
"execution_count": 5,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/"
|
||||
},
|
||||
"id": "Je19fGrvtOu4",
|
||||
"outputId": "c99b1159-f745-4c3f-c012-c2f464b8edb0"
|
||||
"outputId": "bcf1f997-2fa1-4838-eac7-3aa5156d4a43"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Enter your polynomial: 1 2 3 4 5\n",
|
||||
"Enter your K: 6\n",
|
||||
"Enter your polynomial: 1 3 5 7\n",
|
||||
"Enter your K: 9\n",
|
||||
" 0 1 2\n",
|
||||
"0 1.0 3.0 5.0\n",
|
||||
"1 2.0 4.0 6.0\n",
|
||||
"2 1.0 2.0 0.0\n",
|
||||
"3 0.0 3.0 0.0\n",
|
||||
"4 -2.0 0.0 0.0\n",
|
||||
"0 1.000000 5.0 9.0\n",
|
||||
"1 3.000000 7.0 0.0\n",
|
||||
"2 2.666667 9.0 0.0\n",
|
||||
"3 -3.125000 0.0 0.0\n",
|
||||
"4 9.000000 -0.0 0.0\n",
|
||||
"SYSTEM IS UNSTABLE\n"
|
||||
]
|
||||
}
|
||||
@ -119,28 +123,28 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 136,
|
||||
"execution_count": 6,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/"
|
||||
},
|
||||
"id": "kFgcxNcscafI",
|
||||
"outputId": "25aadcc4-6a29-4c16-c992-46d95a56cbfb"
|
||||
"outputId": "e67322ca-5a85-4434-a690-655b07c9404a"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Enter your polynomial: 12 56 37 80\n",
|
||||
"Enter your K: 17\n",
|
||||
"Enter your polynomial: 11 15 19 21\n",
|
||||
"Enter your K: 29\n",
|
||||
" 0 1 2\n",
|
||||
"0 12.0 37.0 17.0\n",
|
||||
"1 56.0 80.0 0.0\n",
|
||||
"2 556.0 476.0 0.0\n",
|
||||
"3 8912.0 0.0 0.0\n",
|
||||
"4 2121056.0 0.0 0.0\n",
|
||||
"SYSTEM IS STABLE\n"
|
||||
"0 11.000000 19.0 29.0\n",
|
||||
"1 15.000000 21.0 0.0\n",
|
||||
"2 3.600000 29.0 0.0\n",
|
||||
"3 -99.833333 0.0 0.0\n",
|
||||
"4 29.000000 -0.0 0.0\n",
|
||||
"SYSTEM IS UNSTABLE\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -156,26 +160,26 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 137,
|
||||
"execution_count": 7,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/"
|
||||
},
|
||||
"id": "jaif_A4_hfeJ",
|
||||
"outputId": "0b387e7e-efbf-4f5c-fb45-d98489bbba3e"
|
||||
"outputId": "a231e081-6ff2-4e13-db18-759225fcd948"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Enter your polynomial: 1.2 6.81 7.31\n",
|
||||
"Enter your polynomial: 1.2 6.78 11.11\n",
|
||||
"Enter your K: 3.141\n",
|
||||
" 0 1\n",
|
||||
"0 1.20 7.310\n",
|
||||
"1 6.81 3.141\n",
|
||||
"2 23.00 0.000\n",
|
||||
"3 36.00 0.000\n",
|
||||
"0 1.200000 11.110\n",
|
||||
"1 6.780000 3.141\n",
|
||||
"2 10.554071 0.000\n",
|
||||
"3 3.141000 0.000\n",
|
||||
"SYSTEM IS STABLE\n"
|
||||
]
|
||||
}
|
||||
@ -189,6 +193,15 @@
|
||||
"rs.set_k(k_in)\n",
|
||||
"rs.calc_routh()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "SjkQCR9chk6P"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
@ -197,11 +210,18 @@
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "Python 3.8.10 64-bit",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
"name": "python",
|
||||
"version": "3.8.10"
|
||||
},
|
||||
"vscode": {
|
||||
"interpreter": {
|
||||
"hash": "e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a"
|
||||
}
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
40
README.md
40
README.md
@ -92,39 +92,39 @@ rs.calc_routh()
|
||||
```
|
||||
It takes coefficient of polynomial and K from user, insert it into ```RouthStability``` class as constructor parameter, insert the K value, and generate Routh Table. The result can be found below:
|
||||
```
|
||||
Enter your polynomial: 1 2 3 4 5
|
||||
Enter your K: 6
|
||||
Enter your polynomial: 1 3 5 7
|
||||
Enter your K: 9
|
||||
0 1 2
|
||||
0 1.0 3.0 5.0
|
||||
1 2.0 4.0 6.0
|
||||
2 1.0 2.0 0.0
|
||||
3 0.0 3.0 0.0
|
||||
4 -2.0 0.0 0.0
|
||||
0 1.000000 5.0 9.0
|
||||
1 3.000000 7.0 0.0
|
||||
2 2.666667 9.0 0.0
|
||||
3 -3.125000 0.0 0.0
|
||||
4 9.000000 -0.0 0.0
|
||||
SYSTEM IS UNSTABLE
|
||||
```
|
||||
|
||||
## Testing 2
|
||||
```
|
||||
Enter your polynomial: 12 56 37 80
|
||||
Enter your K: 17
|
||||
Enter your polynomial: 11 15 19 21
|
||||
Enter your K: 29
|
||||
0 1 2
|
||||
0 12.0 37.0 17.0
|
||||
1 56.0 80.0 0.0
|
||||
2 556.0 476.0 0.0
|
||||
3 8912.0 0.0 0.0
|
||||
4 2121056.0 0.0 0.0
|
||||
SYSTEM IS STABLE
|
||||
0 11.000000 19.0 29.0
|
||||
1 15.000000 21.0 0.0
|
||||
2 3.600000 29.0 0.0
|
||||
3 -99.833333 0.0 0.0
|
||||
4 29.000000 -0.0 0.0
|
||||
SYSTEM IS UNSTABLE
|
||||
```
|
||||
|
||||
## Testing 3
|
||||
```
|
||||
Enter your polynomial: 1.2 6.81 7.31
|
||||
Enter your polynomial: 1.2 6.78 11.11
|
||||
Enter your K: 3.141
|
||||
0 1
|
||||
0 1.20 7.310
|
||||
1 6.81 3.141
|
||||
2 23.00 0.000
|
||||
3 36.00 0.000
|
||||
0 1.200000 11.110
|
||||
1 6.780000 3.141
|
||||
2 10.554071 0.000
|
||||
3 3.141000 0.000
|
||||
SYSTEM IS STABLE
|
||||
```
|
||||
### Notes
|
||||
|
Loading…
Reference in New Issue
Block a user