


{"id":393673,"date":"2024-11-12T01:00:09","date_gmt":"2024-11-12T01:00:09","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/393673\/"},"modified":"2024-11-12T01:00:09","modified_gmt":"2024-11-12T01:00:09","slug":"393673","status":"publish","type":"reply","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/393673\/","title":{"rendered":"Reply To: Trapezoidal ring"},"content":{"rendered":"<p>&lt;p style=&#8221;margin-bottom: 20px; font-size: 11pt; line-height: 1.5;&#8221;&gt;Hello Rahul,&lt;\/p&gt;&lt;p style=&#8221;margin-bottom: 10px; font-size: 11pt; line-height: 1.5;&#8221;&gt;I can suggest following debugging tips.&lt;\/p&gt;&lt;p style=&#8221;margin-bottom: 10px; font-size: 11pt; line-height: 1.5;&#8221;&gt;Isolate the issue. Try simplifying your script by commenting out parts that could be causing the problem. Focus on the most reliable sections and make sure each one works when tested individually.&lt;\/p&gt;&lt;p style=&#8221;margin-bottom: 10px; font-size: 11pt; line-height: 1.5;&#8221;&gt;Check your waveguide parameters. If you&rsquo;re having trouble with waveguide objects, double-check that the construction parameters are correct. It can help to print them out and manually create a few waveguides with those parameters to see if they behave as expected.&lt;\/p&gt;&lt;p style=&#8221;margin-bottom: 10px; font-size: 11pt; line-height: 1.5;&#8221;&gt;I&rsquo;m not sure if this would be helpful, but this script creates a set of concentric waveguides with tilted walls.&lt;\/p&gt;&lt;!&#8211; Code Block &#8211;&gt;<\/p>\n<pre>for (x = 1:10) {\n    addwaveguide;\n    set(\"name\", \"wg_\" + num2str(x));             # Set waveguide name\n    set(\"x\", 0.0); set(\"y\", 0.0); set(\"z\", 0.0); # Position of waveguide\n\n    set(\"base width\", 600.0e-9);\n    set(\"base height\", 220.0e-9);\n    set(\"base angle\", 60.0);\n\n    # Angle and arc parameters\n    start_angle = -30.0; end_angle = 30.0; radius = x*1e-6; m = 0.55191502449;\n    start_angle_rad = start_angle * pi \/ 180; end_angle_rad = end_angle * pi \/ 180;\n    arc_angle = end_angle_rad - start_angle_rad;\n    m_adj = m * arc_angle \/ (pi \/ 2);\n\n    # Calculating control points for Bezier curve approximation\n    p0_x = cos(start_angle_rad) * radius;\n    p0_y = sin(start_angle_rad) * radius;\n    p1_x = p0_x - sin(start_angle_rad) * m_adj * radius;\n    p1_y = p0_y + cos(start_angle_rad) * m_adj * radius;\n    p3_x = cos(end_angle_rad) * radius;\n    p3_y = sin(end_angle_rad) * radius;\n    p2_x = p3_x + sin(end_angle_rad) * m_adj * radius;\n    p2_y = p3_y - cos(end_angle_rad) * m_adj * radius;\n\n    # Defining poles\n    px = [p0_x; p1_x; p2_x; p3_x];\n    py = [p0_y; p1_y; p2_y; p3_y];\n    poles = [px, py];\n\n    set(\"poles\", poles);                     # Apply poles to the waveguide\n    set(\"material\", \"Si (Silicon) - Palik\"); # Set material for the waveguide\n}\n\n# Create a rectangle\naddrect;\nset(\"name\", \"rectangle\");\nset(\"x\", 6.0e-6); set(\"x span\", 12.0e-6);\nset(\"y\", 0.0e-6); set(\"y span\", 12.0e-6);\nset(\"z\", -220.0e-9); set(\"z span\", 220.0e-9);\nset(\"material\", \"Si (Silicon) - Palik\");\n<\/pre>\n<p>&lt;!&#8211; End Code Block &#8211;&gt;&lt;p style=&#8221;margin-top: 15px; font-size: 11pt; line-height: 1.5;&#8221;&gt;<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/forum\/wp-content\/uploads\/sites\/2\/2024\/11\/12-11-2024-1731372713-Screenshot 2024-11-11 185513.png\" alt=\"\" width=\"380\" height=\"276\" \/>&lt;\/p&gt;&lt;p style=&#8221;margin-top: 15px; font-size: 11pt; line-height: 1.5;&#8221;&gt;Best regards,&lt;\/p&gt;&lt;p style=&#8221;margin-top: 10px; font-size: 11pt; line-height: 1.5;&#8221;&gt;Kirill&lt;\/p&gt;<\/p>\n","protected":false},"template":"","class_list":["post-393673","reply","type-reply","status-publish","hentry"],"aioseo_notices":[],"acf":[],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/replies\/393673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/replies"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/reply"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/replies\/393673\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=393673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}