René's URL Explorer Experiment


Title: Can you split an input to an interconnected system? · python-control/python-control · Discussion #1047 · GitHub

Open Graph Title: Can you split an input to an interconnected system? · python-control/python-control · Discussion #1047

X Title: Can you split an input to an interconnected system? · python-control/python-control · Discussion #1047

Description: Can you split an input to an interconnected system?

Open Graph Description: If I have an input that is external to an interconnected system, and I want this external input to connect into multiple systems contained within, the only way I can think to do this is by using se...

X Description: If I have an input that is external to an interconnected system, and I want this external input to connect into multiple systems contained within, the only way I can think to do this is by using se...

Opengraph URL: https://github.com/python-control/python-control/discussions/1047

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Can you split an input to an interconnected system?","text":"

If I have an input that is external to an interconnected system, and I want this external input to connect into multiple systems contained within, the only way I can think to do this is by using set_input_map. Is there a more elegant way? Even when I use set_input_map, I still get the \"unused input\" warning.

\n

Part of the motivation for this question is that it is difficult to understand how an external input is being used if you can only specify it in terms of the subsystem that it connects to. It might be intended for the input to connect to multiple subsystems.

\n

Here is an example of how I have implemented:

\n
import numpy as np\nimport control as ct\n\ndef dynamics(t, x, u, p):\n    A = np.array([[0, 1], [-p['spring_constant'], -p['damping_coefficient']]])\n    B = np.array([[0], [1]])\n    return A @ x + B @ u\n\ndef outputs(t, x, u, p):\n    C = np.array([[1, 0]])\n    D = np.array([[0]])\n    return C @ x + D @ u\n\nsys1 = ct.nlsys(updfcn=dynamics, outfcn=outputs, states=['pos', 'vel'], inputs=['u1'], outputs=['pos'], name='sys1')\nsys1.params = {'spring_constant': 10, 'damping_coefficient': 0.5}\n\nsys2 = ct.nlsys(updfcn=dynamics, outfcn=outputs, states=['pos', 'vel'], inputs=['u2'], outputs=['pos'], name='sys2')\nsys2.params = {'spring_constant': 1, 'damping_coefficient': 1}\n\nsys = ct.interconnect(\n    (sys1, sys2),\n    # inplist=['u'], # only works if both subsystem inputs are named u\n    outlist=['sys1.pos', 'sys2.pos'],\n    outputs=['pos1', 'pos2']\n)\n\n# /venv/lib/python3.12/site-packages/control/nlsys.py:1192: UserWarning: Unused input(s) in InterconnectedSystem: (1, 0)=sys2.u2; (0, 0)=sys1.u1\n\nsys.set_input_map(np.array([[1],[1]]))\nsys.set_inputs('external_input')\n\nt = np.linspace(0, 10, 1000)\n\nu0 = lambda t: 1\nU = np.array([\n    [u0(ti) for ti in t]\n])\n\nresults = ct.input_output_response(sys, T=t, U=U)\n\np = results.plot()\np.figure.show()
","upvoteCount":1,"answerCount":3,"acceptedAnswer":{"@type":"Answer","text":"

You can accomplish this interconnection using the following:

\n
    sys = ct.interconnect(\n        [sys1, sys2],\n        connections=None,\n        inplist=[\n            ['sys1.u1', 'sys2.u2']      # Input connects to multiple signals\n        ],\n        inputs='external_input',\n        outlist=['sys1.pos', 'sys2.pos'],\n        outputs=['pos1', 'pos2'],\n    )    \n
\n

The reason this works is that if you specify a list as an entry for inplist, it will connect that input (external_input) here to all of the signals in that list.

\n

I also like the alternative syntax you have proposed above, so I've added issue #1049 to track its implementation.

","upvoteCount":1,"url":"https://github.com/python-control/python-control/discussions/1047#discussioncomment-10923719"}}}

route-pattern/_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format)
route-controllervoltron_discussions_fragments
route-actiondiscussion_layout
fetch-noncev2:df3c8725-ceeb-f05b-3af8-29675aaa76ed
current-catalog-service-hash9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be
request-id90FC:1415B5:5BD51:80C8A:697A59E7
html-safe-nonce5e6b39024d8304f57f3a8456a4ff0ea3ce4d3cef01e3b20acf0c9803afa535f5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MEZDOjE0MTVCNTo1QkQ1MTo4MEM4QTo2OTdBNTlFNyIsInZpc2l0b3JfaWQiOiIzNTg2NTI4MzYzNzM4MTkyMzU5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac849330a467b827ac03641a8e6cc3f79c3dd21a665e835584e5a5dd961086c218
hovercard-subject-tagdiscussion:7296059
github-keyboard-shortcutsrepository,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/discussions_fragments/discussion_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/python-control/python-control/1047/discussion_layout
twitter:imagehttps://opengraph.githubassets.com/a9255e148fd44e828024cc78e10ebc743c917f155710f039527c5eac829acd24/python-control/python-control/discussions/1047
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a9255e148fd44e828024cc78e10ebc743c917f155710f039527c5eac829acd24/python-control/python-control/discussions/1047
og:image:altIf I have an input that is external to an interconnected system, and I want this external input to connect into multiple systems contained within, the only way I can think to do this is by using se...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonea2296221ffa83b7f45f8ba9b62e1aed869492cb43693309e51b8111607e38282
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
release46d8a07df71eb59259545c68ce36abf1075d2fca
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python-control/python-control/discussions/1047#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-control%2Fpython-control%2Fdiscussions%2F1047
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%2Fdiscussions%2F1047
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%2Fdiscussions_fragments%2Fdiscussion_layout&source=header-repo&source_repo=python-control%2Fpython-control
Reloadhttps://github.com/python-control/python-control/discussions/1047
Reloadhttps://github.com/python-control/python-control/discussions/1047
Reloadhttps://github.com/python-control/python-control/discussions/1047
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
Answered https://github.com/python-control/python-control/discussions/1047#discussioncomment-10923719
murrayrmhttps://github.com/murrayrm
corbinklett https://github.com/corbinklett
Q&Ahttps://github.com/python-control/python-control/discussions/categories/q-a
Can you split an input to an interconnected system? https://github.com/python-control/python-control/discussions/1047#top
corbinklett https://github.com/corbinklett
Answered https://github.com/python-control/python-control/discussions/1047#discussioncomment-10923719
murrayrmhttps://github.com/murrayrm
Return to tophttps://github.com/python-control/python-control/discussions/1047#top
Please reload this pagehttps://github.com/python-control/python-control/discussions/1047
https://github.com/python-control/python-control/discussions/1047
corbinklett https://github.com/corbinklett
Oct 9, 2024 https://github.com/python-control/python-control/discussions/1047#discussion-7296059
Give feedback.https://github.com/python-control/python-control/discussions/1047
murrayrm https://github.com/murrayrm
Oct 12, 2024 https://github.com/python-control/python-control/discussions/1047#discussioncomment-10923719
#1049https://github.com/python-control/python-control/issues/1049
View full answer https://github.com/python-control/python-control/discussions/1047#discussioncomment-10923719
Oldest https://github.com/python-control/python-control/discussions/1047?sort=old
Newest https://github.com/python-control/python-control/discussions/1047?sort=new
Top https://github.com/python-control/python-control/discussions/1047?sort=top
Please reload this pagehttps://github.com/python-control/python-control/discussions/1047
https://github.com/python-control/python-control/discussions/1047
corbinklett https://github.com/corbinklett
Oct 9, 2024 https://github.com/python-control/python-control/discussions/1047#discussioncomment-10895083
Give feedback.https://github.com/python-control/python-control/discussions/1047
Please reload this pagehttps://github.com/python-control/python-control/discussions/1047
https://github.com/python-control/python-control/discussions/1047
bavcol https://github.com/bavcol
Oct 11, 2024 https://github.com/python-control/python-control/discussions/1047#discussioncomment-10915008
Give feedback.https://github.com/python-control/python-control/discussions/1047
https://github.com/corbinklett
Please reload this pagehttps://github.com/python-control/python-control/discussions/1047
https://github.com/python-control/python-control/discussions/1047
corbinkletthttps://github.com/corbinklett
Oct 11, 2024 https://github.com/python-control/python-control/discussions/1047#discussioncomment-10916704
Give feedback.https://github.com/python-control/python-control/discussions/1047
Please reload this pagehttps://github.com/python-control/python-control/discussions/1047
https://github.com/python-control/python-control/discussions/1047
murrayrm https://github.com/murrayrm
Oct 12, 2024 https://github.com/python-control/python-control/discussions/1047#discussioncomment-10923719
#1049https://github.com/python-control/python-control/issues/1049
Give feedback.https://github.com/python-control/python-control/discussions/1047
corbinkletthttps://github.com/corbinklett
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-control%2Fpython-control%2Fdiscussions%2F1047
🙏 Q&A https://github.com/python-control/python-control/discussions/categories/q-a
https://github.com/corbinklett
https://github.com/murrayrm
https://github.com/bavcol
https://github.com/python-control/python-control/discussions/1047
https://github.com/settings/replies?return_to=1
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.