René's URL Explorer Experiment


Title: place function fails for simple case · Issue #177 · python-control/python-control · GitHub

Open Graph Title: place function fails for simple case · Issue #177 · python-control/python-control

X Title: place function fails for simple case · Issue #177 · python-control/python-control

Description: The pole placement function place fails in some simple situations. This bug is related to the current implementation of place, which is a wrapper for slicot sb01bd. If PR 176 is accepted, this bug report will refer to place_varga instead...

Open Graph Description: The pole placement function place fails in some simple situations. This bug is related to the current implementation of place, which is a wrapper for slicot sb01bd. If PR 176 is accepted, this bug ...

X Description: The pole placement function place fails in some simple situations. This bug is related to the current implementation of place, which is a wrapper for slicot sb01bd. If PR 176 is accepted, this bug ...

Opengraph URL: https://github.com/python-control/python-control/issues/177

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"place function fails for simple case","articleBody":"### The pole placement function `place` fails in some simple situations. \r\nThis bug is related to the *current* implementation of `place`, which is a wrapper for slicot sb01bd. If PR [176](https://github.com/python-control/python-control/pull/176) is accepted, this bug report will refer to `place_varga` instead.\r\n\r\nExample of failure:\r\n```\r\nimport numpy as np\r\nimport control as pc\r\nA = np.array([[0, 1],[100, 0]])\r\nB = np.array([[0],[1]])\r\nPdes = np.array([-20 + 10*1j, -20 - 10*1j])\r\nK = pc.place(A, B, Pdes)\r\n```\r\nThis raises the error (with python 2.7)\r\n\"ValueError: an attempt was made to place a complex conjugate pair on the location of a real eigenvalue\"\r\n\r\nThe problem is related to how the `alpha` parameter is computed when calling `sb01bd`, which is calculated as \r\n```\r\nsystem_eigs = np.linalg.eig(A_mat)[0]\r\nalpha = min(system_eigs.real);\r\n```\r\nClearly, A has eigenvalues [-10, +10]. But np.lingalg.eigvals(A) reports \r\neigvals = [10.000000000000002, -9.9999999999999982], and so we have set\r\n```\r\nalpha = -9.9999999999999982\r\n```\r\n\r\n`sb01bd` will only move eigenvalues that are greater than `alpha`. It seems that `sb01bd` must calculate the eigenvalues slightly differently than scipy, so it thinks it has only one eigenvalue to move (namely, the one at +10). This evidently corresponds to [error 4](http://slicot.org/objects/software/shared/doc/SB01BD.html).\r\n\r\nIf we fudge the `alpha` parameter, and call the sb01bd wrapper directly, this works as expected\r\n```\r\nimport numpy as np\r\nfrom slycot import sb01bd\r\nA = np.array([[0, 1],[100, 0]])\r\nB = np.array([[0],[1]])\r\nPdes = np.array([-20 + 10*1j, -20 - 10*1j])\r\n\r\nalpha = min(np.linalg.eigvals(A).real)*2;\r\nA_z,w,nfp,nap,nup,K,Z = sb01bd(B.shape[0], B.shape[1],\r\n                               len(Pdes), alpha, A, B, Pdes, 'C')\r\nprint 'Placed Poles: %s'%np.linalg.eigvals(A + B.dot(K))\r\n# yields on my system:\r\n# Placed Poles: [-20.+10.j -20.-10.j]\r\n````\r\n\r\n\r\n\r\n### place() is not implemented for discrete time\r\n`sb01bd` can place poles for discrete time systems. However, the current wrapper assumes a continuous time system, both in how `alpha` is calculated (it should be based on `abs(eigvals)` for discrete systems) and by passing `C` as the dico parameter. This is undocumented in the doc string.\r\n","author":{"url":"https://github.com/rabraker","@type":"Person","name":"rabraker"},"datePublished":"2018-01-03T20:42:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/177/python-control/issues/177"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f046a339-33ae-85c8-90bb-b1ca32502b71
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDF88:3257A7:2262A9:2FAADE:697BBB5B
html-safe-nonce481293414347c3c533b97f02db85dc63ccce6dc1ee2f9054c6558c2d48270ecc
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjg4OjMyNTdBNzoyMjYyQTk6MkZBQURFOjY5N0JCQjVCIiwidmlzaXRvcl9pZCI6IjY0ODExNjc4MzgyNjUxOTUzNTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac80ddddb42c6e52b21aab1beb7d84b9c6dc529d042c6aed1728300ebea1f5e983
hovercard-subject-tagissue:285803519
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-control/python-control/177/issue_layout
twitter:imagehttps://opengraph.githubassets.com/20078ec5db27f27970146789779d775a45fb96c168903f2b6b23530aed5411c0/python-control/python-control/issues/177
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/20078ec5db27f27970146789779d775a45fb96c168903f2b6b23530aed5411c0/python-control/python-control/issues/177
og:image:altThe pole placement function place fails in some simple situations. This bug is related to the current implementation of place, which is a wrapper for slicot sb01bd. If PR 176 is accepted, this bug ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamerabraker
hostnamegithub.com
expected-hostnamegithub.com
Noneab413746e1b95376981dfec4a04b2384a611b96affe802ee3ee6d752200afbb1
turbo-cache-controlno-preview
go-importgithub.com/python-control/python-control git https://github.com/python-control/python-control.git
octolytics-dimension-user_id2285872
octolytics-dimension-user_loginpython-control
octolytics-dimension-repository_id22791752
octolytics-dimension-repository_nwopython-control/python-control
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id22791752
octolytics-dimension-repository_network_root_nwopython-control/python-control
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasebea0e0f1995ab0bb7fa336572c353032cf897ec1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python-control/python-control/issues/177#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-control%2Fpython-control%2Fissues%2F177
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-control%2Fpython-control%2Fissues%2F177
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python-control%2Fpython-control
Reloadhttps://github.com/python-control/python-control/issues/177
Reloadhttps://github.com/python-control/python-control/issues/177
Reloadhttps://github.com/python-control/python-control/issues/177
python-control https://github.com/python-control
python-controlhttps://github.com/python-control/python-control
Notifications https://github.com/login?return_to=%2Fpython-control%2Fpython-control
Fork 447 https://github.com/login?return_to=%2Fpython-control%2Fpython-control
Star 2k https://github.com/login?return_to=%2Fpython-control%2Fpython-control
Code https://github.com/python-control/python-control
Issues 87 https://github.com/python-control/python-control/issues
Pull requests 8 https://github.com/python-control/python-control/pulls
Discussions https://github.com/python-control/python-control/discussions
Actions https://github.com/python-control/python-control/actions
Projects 0 https://github.com/python-control/python-control/projects
Wiki https://github.com/python-control/python-control/wiki
Security 0 https://github.com/python-control/python-control/security
Insights https://github.com/python-control/python-control/pulse
Code https://github.com/python-control/python-control
Issues https://github.com/python-control/python-control/issues
Pull requests https://github.com/python-control/python-control/pulls
Discussions https://github.com/python-control/python-control/discussions
Actions https://github.com/python-control/python-control/actions
Projects https://github.com/python-control/python-control/projects
Wiki https://github.com/python-control/python-control/wiki
Security https://github.com/python-control/python-control/security
Insights https://github.com/python-control/python-control/pulse
New issuehttps://github.com/login?return_to=https://github.com/python-control/python-control/issues/177
New issuehttps://github.com/login?return_to=https://github.com/python-control/python-control/issues/177
place function fails for simple casehttps://github.com/python-control/python-control/issues/177#top
bughttps://github.com/python-control/python-control/issues?q=state%3Aopen%20label%3A%22bug%22
0.8.1https://github.com/python-control/python-control/milestone/4
https://github.com/rabraker
https://github.com/rabraker
rabrakerhttps://github.com/rabraker
on Jan 3, 2018https://github.com/python-control/python-control/issues/177#issue-285803519
176https://github.com/python-control/python-control/pull/176
error 4http://slicot.org/objects/software/shared/doc/SB01BD.html
bughttps://github.com/python-control/python-control/issues?q=state%3Aopen%20label%3A%22bug%22
0.8.1https://github.com/python-control/python-control/milestone/4
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.