René's URL Explorer Experiment


Title: TimeResponseData.to_pandas() fails if there are no states in a NonlinearIOSystem · Issue #957 · python-control/python-control · GitHub

Open Graph Title: TimeResponseData.to_pandas() fails if there are no states in a NonlinearIOSystem · Issue #957 · python-control/python-control

X Title: TimeResponseData.to_pandas() fails if there are no states in a NonlinearIOSystem · Issue #957 · python-control/python-control

Description: TimeResponseData.to_pandas() fails if there are no states in a NonlinearIOSystem: import control as ct class System: @classmethod def _outputs(cls, t, x, u, params: dict): v = u[0] i = u[1] k = u[2] return k*v**2 + i @classmethod def bui...

Open Graph Description: TimeResponseData.to_pandas() fails if there are no states in a NonlinearIOSystem: import control as ct class System: @classmethod def _outputs(cls, t, x, u, params: dict): v = u[0] i = u[1] k = u[2...

X Description: TimeResponseData.to_pandas() fails if there are no states in a NonlinearIOSystem: import control as ct class System: @classmethod def _outputs(cls, t, x, u, params: dict): v = u[0] i = u[1] k = u[2...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TimeResponseData.to_pandas() fails if there are no states in a NonlinearIOSystem","articleBody":"TimeResponseData.to_pandas() fails if there are no states in a NonlinearIOSystem:\r\n\r\n```python\r\n\r\nimport control as ct\r\n\r\nclass System:\r\n    @classmethod\r\n    def _outputs(cls, t, x, u, params: dict):\r\n        v = u[0]\r\n        i = u[1]\r\n        k = u[2]\r\n\r\n        return k*v**2 + i\r\n\r\n    @classmethod\r\n    def build(cls):\r\n        return ct.NonlinearIOSystem(\r\n            None,\r\n            cls._outputs,\r\n            name=\"system\",\r\n            states=None,\r\n            inputs=('v', 'i', 'V'),\r\n            outputs=('I',),\r\n            params=params,\r\n        )\r\n\r\nT = np.arange(100)   # simulation time in seconds\r\nU = np.ones(shape=(3, len(T)))\r\n\r\nsys = System.build()\r\nydata = ct.input_output_response(sys, T=T, U=U, solve_ivp_method=\"Radau\").to_pandas()\r\n\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\nCell In[106], [line 28](vscode-notebook-cell:?execution_count=106\u0026line=28)\r\n     [25](vscode-notebook-cell:?execution_count=106\u0026line=25) U = np.ones(shape=(3, len(T)))\r\n     [27](vscode-notebook-cell:?execution_count=106\u0026line=27) sys = System.build()\r\n---\u003e [28](vscode-notebook-cell:?execution_count=106\u0026line=28) ydata = ct.input_output_response(sys, T=T, U=U, solve_ivp_method=\"Radau\").to_pandas()\r\n     [29](vscode-notebook-cell:?execution_count=106\u0026line=29) ydata\r\n\r\nFile [~/workspace_TCC/repo_2022_2/.env/lib/python3.10/site-packages/control/timeresp.py:655](https://file+.vscode-resource.vscode-cdn.net/home/joaoantoniocardoso/workspace_TCC/repo_2022_2/models/2020/panel/~/workspace_TCC/repo_2022_2/.env/lib/python3.10/site-packages/control/timeresp.py:655), in TimeResponseData.to_pandas(self)\r\n    [650](https://file+.vscode-resource.vscode-cdn.net/home/joaoantoniocardoso/workspace_TCC/repo_2022_2/models/2020/panel/~/workspace_TCC/repo_2022_2/.env/lib/python3.10/site-packages/control/timeresp.py:650) data.update(\r\n    [651](https://file+.vscode-resource.vscode-cdn.net/home/joaoantoniocardoso/workspace_TCC/repo_2022_2/models/2020/panel/~/workspace_TCC/repo_2022_2/.env/lib/python3.10/site-packages/control/timeresp.py:651)     {name: self.u[i] for i, name in enumerate(self.input_labels)})\r\n    [652](https://file+.vscode-resource.vscode-cdn.net/home/joaoantoniocardoso/workspace_TCC/repo_2022_2/models/2020/panel/~/workspace_TCC/repo_2022_2/.env/lib/python3.10/site-packages/control/timeresp.py:652) data.update(\r\n    [653](https://file+.vscode-resource.vscode-cdn.net/home/joaoantoniocardoso/workspace_TCC/repo_2022_2/models/2020/panel/~/workspace_TCC/repo_2022_2/.env/lib/python3.10/site-packages/control/timeresp.py:653)     {name: self.y[i] for i, name in enumerate(self.output_labels)})\r\n    [654](https://file+.vscode-resource.vscode-cdn.net/home/joaoantoniocardoso/workspace_TCC/repo_2022_2/models/2020/panel/~/workspace_TCC/repo_2022_2/.env/lib/python3.10/site-packages/control/timeresp.py:654) data.update(\r\n--\u003e [655](https://file+.vscode-resource.vscode-cdn.net/home/joaoantoniocardoso/workspace_TCC/repo_2022_2/models/2020/panel/~/workspace_TCC/repo_2022_2/.env/lib/python3.10/site-packages/control/timeresp.py:655)     {name: self.x[i] for i, name in enumerate(self.state_labels)})\r\n    [657](https://file+.vscode-resource.vscode-cdn.net/home/joaoantoniocardoso/workspace_TCC/repo_2022_2/models/2020/panel/~/workspace_TCC/repo_2022_2/.env/lib/python3.10/site-packages/control/timeresp.py:657) return pandas.DataFrame(data)\r\n\r\nTypeError: 'NoneType' object is not iterable\r\n```\r\n\r\nNot optimal, but as a workaround, I'm introducing a state:\r\n\r\n```python\r\nclass System:\r\n    @classmethod\r\n    def _updates(cls, t, x, u, params: dict):\r\n        return 0\r\n\r\n    @classmethod\r\n    def _outputs(cls, t, x, u, params: dict):\r\n        v = u[0]\r\n        i = u[1]\r\n        k = u[2]\r\n\r\n        return k*v**2 + i\r\n\r\n    @classmethod\r\n    def build(cls):\r\n        return ct.NonlinearIOSystem(\r\n            cls._updates,\r\n            cls._outputs,\r\n            name=\"system\",\r\n            states=1,\r\n            inputs=('v', 'i', 'V'),\r\n            outputs=('I',),\r\n            params=params,\r\n        )\r\n```","author":{"url":"https://github.com/joaoantoniocardoso","@type":"Person","name":"joaoantoniocardoso"},"datePublished":"2024-01-03T18:02:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/957/python-control/issues/957"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:df15431a-f9f9-cc8e-8b20-224791b7e74b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB732:AB0E6:6BEF89:97A927:697A6A72
html-safe-nonce8c07d9b7904979da42472b54783396fa033f63dbd6a6610ecf3dd0181739915a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzMyOkFCMEU2OjZCRUY4OTo5N0E5Mjc6Njk3QTZBNzIiLCJ2aXNpdG9yX2lkIjoiMTMxODg3NTg2NDQxODExODI1OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac6fb46d5222200abdc616b3e3d0b7067e16cb1b79828856e866223e23d21d76ac
hovercard-subject-tagissue:2064441121
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/957/issue_layout
twitter:imagehttps://opengraph.githubassets.com/fb59aa1a4ded2228c80b68ccf39821acb052e9105488b07279287832452b7a1b/python-control/python-control/issues/957
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/fb59aa1a4ded2228c80b68ccf39821acb052e9105488b07279287832452b7a1b/python-control/python-control/issues/957
og:image:altTimeResponseData.to_pandas() fails if there are no states in a NonlinearIOSystem: import control as ct class System: @classmethod def _outputs(cls, t, x, u, params: dict): v = u[0] i = u[1] k = u[2...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejoaoantoniocardoso
hostnamegithub.com
expected-hostnamegithub.com
None4f4c032790588250388c2e36a0e1ea776c0a3f887d37d994e1ac3d7ea79d34ef
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
release06b3a5a9a6214e1e06e508d250d778cbaf17c577
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python-control/python-control/issues/957#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-control%2Fpython-control%2Fissues%2F957
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%2F957
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/957
Reloadhttps://github.com/python-control/python-control/issues/957
Reloadhttps://github.com/python-control/python-control/issues/957
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/957
New issuehttps://github.com/login?return_to=https://github.com/python-control/python-control/issues/957
#958https://github.com/python-control/python-control/pull/958
TimeResponseData.to_pandas() fails if there are no states in a NonlinearIOSystemhttps://github.com/python-control/python-control/issues/957#top
#958https://github.com/python-control/python-control/pull/958
https://github.com/murrayrm
bughttps://github.com/python-control/python-control/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/joaoantoniocardoso
https://github.com/joaoantoniocardoso
joaoantoniocardosohttps://github.com/joaoantoniocardoso
on Jan 3, 2024https://github.com/python-control/python-control/issues/957#issue-2064441121
murrayrmhttps://github.com/murrayrm
bughttps://github.com/python-control/python-control/issues?q=state%3Aopen%20label%3A%22bug%22
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.