Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6a0e136
New function for LTI system norm computation
Jan 7, 2024
a0fbc80
* Updated documentation of function norm
Jan 8, 2024
457c623
Update sysnorm.py
Jan 9, 2024
adcb486
Merge branch 'python-control:main' into system-norms
henriks76 Jan 21, 2024
fd076c5
New function for LTI system norm computation
Jan 7, 2024
0fe2c57
* Updated documentation of function norm
Jan 8, 2024
cdf4bab
Update sysnorm.py
Jan 9, 2024
34f9537
Do not track changes in VS Code setup.
Jan 14, 2024
b419f12
Lowered tolerances in tests.
Jan 21, 2024
9ecd594
Added:
Jan 21, 2024
14fce67
Merge branch 'system-norms' of https://github.com/henriks76/python-co…
Jan 21, 2024
5c38d4f
escape latex labels
bnavigator Jan 22, 2024
99e56f8
Use Numpy API for pi instead of undocumented scipy.pi
bnavigator Jan 22, 2024
2c32913
Update notebooks (no rerun, no output change)
bnavigator Jan 22, 2024
85328d9
Merge pull request #965 from bnavigator/fix-examples
bnavigator Jan 23, 2024
7ace4bc
New function for LTI system norm computation
Jan 7, 2024
5103448
* Updated documentation of function norm
Jan 8, 2024
4fb252e
Update sysnorm.py
Jan 9, 2024
108817c
Do not track changes in VS Code setup.
Jan 14, 2024
6683eb3
Lowered tolerances in tests.
Jan 21, 2024
32d38bf
Added:
Jan 21, 2024
6f810ba
Update sysnorm.py
Jan 9, 2024
793f0d6
Added:
Jan 28, 2024
12ba677
Merge branch 'system-norms' of https://github.com/henriks76/python-co…
Jan 28, 2024
7a5af50
Fixed merge error with __all__.
Jan 28, 2024
49f7e5f
Update sysnorm.py
Jan 9, 2024
247cff5
Merge branch 'system-norms' of https://github.com/henriks76/python-co…
Jan 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions examples/bode-and-nyquist-plots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import scipy as sp\n",
"import matplotlib.pyplot as plt\n",
"import control as ct"
Expand Down Expand Up @@ -109,9 +110,9 @@
"w001rad = 1. # 1 rad/s\n",
"w010rad = 10. # 10 rad/s\n",
"w100rad = 100. # 100 rad/s\n",
"w001hz = 2*sp.pi*1. # 1 Hz\n",
"w010hz = 2*sp.pi*10. # 10 Hz\n",
"w100hz = 2*sp.pi*100. # 100 Hz\n",
"w001hz = 2*np.pi*1. # 1 Hz\n",
"w010hz = 2*np.pi*10. # 10 Hz\n",
"w100hz = 2*np.pi*100. # 100 Hz\n",
"# First order systems\n",
"pt1_w001rad = ct.tf([1.], [1./w001rad, 1.], name='pt1_w001rad')\n",
"display(pt1_w001rad)\n",
Expand Down Expand Up @@ -153,7 +154,7 @@
],
"source": [
"sampleTime = 0.001\n",
"display('Nyquist frequency: {:.0f} Hz, {:.0f} rad/sec'.format(1./sampleTime /2., 2*sp.pi*1./sampleTime /2.))"
"display('Nyquist frequency: {:.0f} Hz, {:.0f} rad/sec'.format(1./sampleTime /2., 2*np.pi*1./sampleTime /2.))"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/genswitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def genswitch(y, t, mu=4, n=2):
# set(pl, 'LineWidth', AM_data_linewidth)
plt.axis([0, 25, 0, 5])

plt.xlabel('Time {\itt} [scaled]')
plt.xlabel('Time {\\itt} [scaled]')
plt.ylabel('Protein concentrations [scaled]')
plt.legend(('z1 (A)', 'z2 (B)')) # 'Orientation', 'horizontal')
# legend(legh, 'boxoff')
Expand Down
4 changes: 2 additions & 2 deletions examples/kincar-flatsys.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def plot_results(t, x, ud, rescale=True):

plt.subplot(2, 4, 8)
plt.plot(t, ud[1])
plt.xlabel('Ttime t [sec]')
plt.ylabel('$\delta$ [rad]')
plt.xlabel('Time t [sec]')
plt.ylabel('$\\delta$ [rad]')
plt.tight_layout()

#
Expand Down
2 changes: 1 addition & 1 deletion examples/singular-values-plot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
],
"source": [
"sampleTime = 10\n",
"display('Nyquist frequency: {:.4f} Hz, {:.4f} rad/sec'.format(1./sampleTime /2., 2*sp.pi*1./sampleTime /2.))"
"display('Nyquist frequency: {:.4f} Hz, {:.4f} rad/sec'.format(1./sampleTime /2., 2*np.pi*1./sampleTime /2.))"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/type2_type3.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import matplotlib.pyplot as plt # Grab MATLAB plotting functions
from control.matlab import * # MATLAB-like functions
from scipy import pi
from numpy import pi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has already been resolved in #965. Please rebase.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I tried again.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope.

  1. Fast forward your main branch to upstream/main
  2. In system-norms use git rebase -i main

https://github.com/python-control/python-control/wiki/How-to-contribute-with-a-pull-request

This gets rid of the extra commits which are already in the main branch. While you are at it, you can also squash some of the commits and use better messages than "Update sysnorm.py"

@henriks76 henriks76 Jan 28, 2024 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did steps 7-9:

... `git checkout main; git fetch --all; git merge origin/main
git push
and then bring those changes into your branch:

git checkout ; git rebase main`

Is it step 12 I should do?
git checkout main; git fetch --all; git merge upstream/main

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am afraid your multiple merges and manual fixes like 7a5af50 have created a situation which git cannot resolve automatically:

image

[ben@skylab:~/src/python-control]% git status                                                             [0]
On branch system-norms
Your branch is up to date with 'henriks76/system-norms'.

nothing to commit, working tree clean
[ben@skylab:~/src/python-control]% git rebase main                                                        [0]
Auto-merging control/sysnorm.py
CONFLICT (add/add): Merge conflict in control/sysnorm.py
error: could not apply fd076c5... New function for LTI system norm computation
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply fd076c5... New function for LTI system norm computation
[ben@skylab:~/src/python-control]% git status                                                             [1]
interactive rebase in progress; onto 85328d9
Last commands done (10 commands done):
   pick 49f7e5f Update sysnorm.py
   pick fd076c5 New function for LTI system norm computation
  (see more in file .git/rebase-merge/done)
Next commands to do (9 remaining commands):
   pick 0fe2c57 * Updated documentation of function norm * Added control/tests/sysnorm_test.py
   pick cdf4bab Update sysnorm.py
  (use "git rebase --edit-todo" to view and edit)
You are currently rebasing branch 'system-norms' on '85328d9'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)

Unmerged paths:
  (use "git restore --staged <file>..." to unstage)
  (use "git add <file>..." to mark resolution)
        both added:      control/sysnorm.py

no changes added to commit (use "git add" and/or "git commit -a")

You have to go through it step by step, because only you know what is relevant.

integrator = tf([0, 1], [1, 0]) # 1/s

# Parameters defining the system
Expand Down