Title: Odd errors in helix geometry · Issue #27 · tmolteno/python-necpp · GitHub
Open Graph Title: Odd errors in helix geometry · Issue #27 · tmolteno/python-necpp
X Title: Odd errors in helix geometry · Issue #27 · tmolteno/python-necpp
Description: Long story short, I'm trying to build a helical antenna based on physical parameters. What I mean by this is that the user should be able to specify a desired frequency [MHz] which is then converted to wavelength [m] and used to build th...
Open Graph Description: Long story short, I'm trying to build a helical antenna based on physical parameters. What I mean by this is that the user should be able to specify a desired frequency [MHz] which is then converte...
X Description: Long story short, I'm trying to build a helical antenna based on physical parameters. What I mean by this is that the user should be able to specify a desired frequency [MHz] which is then conv...
Opengraph URL: https://github.com/tmolteno/python-necpp/issues/27
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Odd errors in helix geometry","articleBody":"Long story short, I'm trying to build a helical antenna based on physical parameters. What I mean by this is that the user should be able to specify a desired frequency [MHz] which is then converted to wavelength [m] and used to build the antenna. For instance, the relationship between [the distance between each turn of the helix and wavelength](https://ham.stackexchange.com/questions/10127/what-is-the-turn-spacing-on-a-helix-antenna#:~:text=Add%20a%20comment-,1%20Answer,-Sorted%20by%3A).\r\n\r\nI wrote a function to specify this in more user-friendly terms:\r\n\r\n```\r\ndef create_helix(s=1, hl=3, a1=1.0, b1=1.0, a2=1.0, b2=1.0, rad=0.001, tagid=0,\r\n segcnt=36):\r\n '''\r\n Generates a helix or spiral of wire segments.\r\n\r\n Parameters:\r\n s: Spacing between helix turns\r\n hl: Total length of the helix\r\n a1: Helical radius (X) at z = 0 \r\n b1: Helical radius (Y) at z = 0\r\n a2: Helical radius (X) at z = hl\r\n b2: Helical radius (Y) at z = hl\r\n rad: Radius of the wire\r\n seg_cnt: Number of segments comprising the helix\r\n tag_id: Tag number assigned to all segments of the helix\r\n Returns:\r\n object: \u003cPyNEC geometry object\u003e\r\n \r\n NOTES:\r\n * The segments generated by GA form a section of polygons inscribed within\r\n the arc\r\n \r\n - If an arc in a different position or orientation is desired, the segements\r\n may be moved within a GM card.\r\n \r\n * Use of GA to form a circle will not result in symmetry being used in the\r\n calculation. It is a good way to form the beginning of the circle, to be\r\n completed by GR, however.\r\n '''\r\n return context, geo.helix(s, hl, a1, b1, a2, b2, rad, tagid, segcnt)\r\n```\r\n\r\nOf course, this calls the `helix` function from PyNEC:\r\n\r\n```\r\n def helix(self, s, hl, a1, b1, a2, b2, rad, segment_count, tag_id):\r\n return _PyNEC.c_geometry_helix(self, s, hl, a1, b1, a2, b2, rad, segment_count, tag_id)\r\n```\r\n\r\nAs a base use case, ```create_helix(s=1, hl=3, a1=1.0, b1=1.0, a2=1.0, b2=1.0, rad=0.001, tagid=0, segcnt=36)``` works fine. \r\n\r\n\r\n\r\n____**ISSUE 1**____\r\nIf I use a desired frequency of 400 MHz, this is equivalent to a wavelength of 0.749 meters and results in a vertical separation between turns for the helical antenna (S = 0.225*wavelength) of 0.225 * 0.749 = 0.1685. Plugging `S = 0.1685` into the previous use case:\r\n\r\ncreate_helix(s=0.1685, hl=3, a1=1.0, b1=1.0, a2=1.0, b2=1.0, rad=0.001, tagid=0, segcnt=36)\r\n\r\nresults in an error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"/Users/apung/Documents/Repositories/antenna-modeling/src/radPattern_3d.py\", line 139, in \u003cmodule\u003e\r\n geometry_module.define_excitation()\r\n File \"/Users/apung/Documents/Repositories/antenna-modeling/src/geometry_module.py\", line 463, in define_excitation\r\n return context.ex_card(extype, tagTheta, rnkPhi, pntRa, chkimp, vltTheta,\r\n File \"/Users/apung/anaconda3/lib/python3.10/site-packages/PyNEC.py\", line 151, in ex_card\r\n return _PyNEC.nec_context_ex_card(self, *args)\r\nRuntimeError: NO SEGMENT HAS AN ITAG OF 1\r\n```\r\nIn fact, I get the same error for a value of `S = 0.99`, but the simulation run fine with `S = 1.0`.\r\n\r\nWhat's causing this? I read through the NEC documentation and the PyNEC documentation, but nothing seems to explain the units well.\r\n\r\nAdditionally, is there a way I can extract the (X,Y,Z) points of the 36 components that comprise the helix within the `context` geometry?\r\n\r\n\r\n\r\n____**ISSUE 2**____\r\nFor a moment, let's accept that `S` simply needs to be greater than 1 to get a working helix. The documentation also states that the helix can be made into a spiral by setting the height (`hl`) equal to zero. However, this also seems to be broken, because\r\n\r\n`geometry_module.create_helix(s=1.5, hl=0, a1=a1, b1=b1, a2=a2, b2=b2, rad=0.001, tagid=0, segcnt=36)`\r\n\r\nresults in the following error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"/Users/apung/Documents/Repositories/antenna-modeling/src/radPattern_3d.py\", line 134, in \u003cmodule\u003e\r\n context.geometry_complete(0)\r\n File \"/Users/apung/anaconda3/lib/python3.10/site-packages/PyNEC.py\", line 148, in geometry_complete\r\n return _PyNEC.nec_context_geometry_complete(self, *args)\r\nRuntimeError: Geometry has no wires or patches.\r\n```\r\n\r\nI would really appreciate any work-arounds and explanations on either of these issues, because I'm at a loss and I cannot seem to find anything in the documentation .","author":{"url":"https://github.com/aeropung","@type":"Person","name":"aeropung"},"datePublished":"2023-06-21T18:58:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/27/python-necpp/issues/27"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7c9d8e96-c506-84a1-2c13-b81cc7a734e4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A53C:63765:45E8A84:5F1C12E:69709AE6 |
| html-safe-nonce | cc5483bd46dd72ae49fd989e6f4cbc01a183d0f644f25dd16b23344c6ad31e52 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTNDOjYzNzY1OjQ1RThBODQ6NUYxQzEyRTo2OTcwOUFFNiIsInZpc2l0b3JfaWQiOiI0NzI0NDU1MzI0NTA2MjYyNzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9e8b043542a5a59862c0a0cb8e081859345b57d1b8fdf7759713078d31ca88fb |
| hovercard-subject-tag | issue:1768227031 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/tmolteno/python-necpp/27/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a5cf1ff547ed7b2a10c1da79c582132897a2f5a63e89341a999e55e074a00038/tmolteno/python-necpp/issues/27 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a5cf1ff547ed7b2a10c1da79c582132897a2f5a63e89341a999e55e074a00038/tmolteno/python-necpp/issues/27 |
| og:image:alt | Long story short, I'm trying to build a helical antenna based on physical parameters. What I mean by this is that the user should be able to specify a desired frequency [MHz] which is then converte... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | aeropung |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9920a62ba22d06470388e2904804fb7e5ec51c9e35f81784e9191394c74b2bd2 |
| turbo-cache-control | no-preview |
| go-import | github.com/tmolteno/python-necpp git https://github.com/tmolteno/python-necpp.git |
| octolytics-dimension-user_id | 85630 |
| octolytics-dimension-user_login | tmolteno |
| octolytics-dimension-repository_id | 33094484 |
| octolytics-dimension-repository_nwo | tmolteno/python-necpp |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 33094484 |
| octolytics-dimension-repository_network_root_nwo | tmolteno/python-necpp |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7d6181066430cc06553c8396ca201e194ae33cb9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width