{"id":828,"date":"2024-11-27T15:18:52","date_gmt":"2024-11-27T07:18:52","guid":{"rendered":"http:\/\/www.openwecd.fun\/?page_id=828"},"modified":"2025-01-19T16:00:43","modified_gmt":"2025-01-19T08:00:43","slug":"hawtc-dll-aqwa%e3%80%81matlab%e3%80%81python%e3%80%81c%e3%80%81c-%e6%8e%a5%e5%8f%a3","status":"publish","type":"page","link":"http:\/\/www.openwecd.fun\/index.php\/hawtc-dll-aqwa%e3%80%81matlab%e3%80%81python%e3%80%81c%e3%80%81c-%e6%8e%a5%e5%8f%a3\/","title":{"rendered":"HawtC.APIL \u4e0e \u52a8\u6001\u94fe\u63a5\u5e93\u9ad8\u9636\u63a5\u53e3"},"content":{"rendered":"<h2>HawtC.DLL \u6a21\u5757\u63d0\u4f9bAQWA\u3001Matlab\u3001python\u3001C++\u3001C# \u63a5\u53e3<\/h2>\n<h3>1\u3001\u524d\u8a00\uff1a<\/h3>\n<p>HawtC \u4e3a\u4e86\u4e0e\u5546\u4e1a\u548c\u5f00\u6e90\u8f6f\u4ef6\u8026\u5408\uff0c\u540c\u65f6\u5b9e\u73b0\u66f4\u591a\u57fa\u7840\u7684\u652f\u6301\u7c7b\u578b\uff0c\u5c06\u57fa\u7840\u7684\u6709\u9650\u5143\u65b9\u6cd5\u4e0e\u591a\u4f53\u52a8\u529b\u5b66\u65b9\u6cd5\u7ed3\u5408\uff0c\u7ed9\u51fa\u4e86dLL \u63a5\u53e3\uff0c\u4ee5\u65b9\u4fbfAQWA\u548cANSYS\u4ee5\u53camatlab\u7684\u8026\u5408\uff0c\u4e0b\u9762\u6211\u7ed9\u51fa\u4e86\u4e00\u4e2aPython\u8c03\u7528HawtC_user dll\u7684\u6848\u4f8b\uff0c\u7531\u4e8e\u662fc \u63a5\u53e3\uff0cc++\u4e0efortran\u4e5f\u53ef\u4ee5\u8c03\u7528\uff1a<\/p>\n<h3>2\u3001HawtC.API \u5f00\u53d1\u6587\u6863\uff1a<\/h3>\n<p>\u6587\u6863\uff1a<a href=\"http:\/\/www.hawtc.cn\/data\/HawtC.DLL_interface.html\">http:\/\/www.hawtc.cn\/data\/HawtC.DLL_interface.html<\/a><br \/>\n\u5bf9\u5e94\u7a0b\u5e8f\uff1a<a href=\"http:\/\/www.hawtc.cn\/data\/HawtC.DLL_V1.0.0_interface.ipynb\">http:\/\/www.hawtc.cn\/data\/HawtC.DLL_V1.0.0_interface.ipynb<\/a><\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">Dll \u7a0b\u5e8f\u5305<\/th>\n<th style=\"text-align: center;\">\u4e0b\u8f7d\u5730\u5740<\/th>\n<th style=\"text-align: center;\">\u63a5\u53e3dll\u7a0b\u5e8f\u5305<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">Python<\/td>\n<td style=\"text-align: center;\"><a href=\"http:\/\/www.hawtc.cn\/data\/HawtC_user_V1.0.0_.py\">http:\/\/www.hawtc.cn\/data\/HawtC_user_V1.0.0_.py<\/a><\/td>\n<td style=\"text-align: center;\"><a href=\"http:\/\/www.hawtc.cn\/data\/HawtC_User_C.dll\">http:\/\/www.hawtc.cn\/data\/HawtC_User_C.dll<\/a><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">Matlab,AQWA,C,C++ \u63a5\u53e3\u7a0b\u5e8f\u5305<\/td>\n<td style=\"text-align: center;\">\u8bf7\u53c2\u8003python\u5305\u81ea\u884c\u5f00\u53d1\uff0c\u6216\u8054\u7cfb\u6211\u4eec\u63d0\u4f9b\u652f\u6301<\/td>\n<td style=\"text-align: center;\"><a href=\"http:\/\/www.hawtc.cn\/data\/HawtC_User_C.dll\">http:\/\/www.hawtc.cn\/data\/HawtC_User_C.dll<\/a><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">AQWA \u63a5\u53e3\u7a0b\u5e8f\u5305<\/td>\n<td style=\"text-align: center;\">\u6bd5\u4e1a\u592a\u5fd9\uff0c\u4ee5\u540e\u9700\u8981\u518d\u8bf4\uff0c\u53c2\u8003python\u5f00\u53d1<\/td>\n<td style=\"text-align: center;\"><a href=\"http:\/\/www.hawtc.cn\/data\/HawtC_User_C.dll\">http:\/\/www.hawtc.cn\/data\/HawtC_User_C.dll<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>3\u3001\u7248\u672c\u53d1\u5e03<\/h3>\n<h4>\u6b63\u5f0f\u7248 V2.2.400\uff08\u4e0eHawtC\u4e3b\u7a0b\u5e8f\u4e00\u81f4\uff09\uff1a<\/h4>\n<h6>1\u3001\u63d0\u4f9b\u4e86AQWA\u8c03\u7528\u7684\u5854\u5e95\u529b\u63a5\u53e3\u3002<\/h6>\n<h6>2\u3001\u5168\u9762\u652f\u6301\u4e86\u91c7\u7528\u5916\u90e8\u8bed\u8a00\u8c03\u7528HawtC\u7684\u5168\u90e8\u529f\u80fd\uff0cMoptL \u9664\u5916\u3002<\/h6>\n<h6>3\u3001\u5168\u65b0\u7684C\u63a5\u53e3\u6837\u5f0f\u548c\u5f00\u53d1\u63a5\u53e3\uff0c\u53ca\u5176\u65b9\u4fbf\u7684\u5b9e\u73b0\u81ea\u5df1\u7684\u529f\u80fd\u3002<\/h6>\n<h6>4\u3001HawtC\u4e0eHawtC.dll \u5206\u79bb\u4e86\u591a\u4f53\u52a8\u529b\u5b66\u8026\u5408\u6c42\u89e3\u5668\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5355\u6b65\u6c42\u89e3\u3002<\/h6>\n<h6>5\u3001HawtC\u4e0eHawtC.dll \u589e\u52a0\u4e86Turbinenum \u53c2\u6570\uff0c\u4e3a\u4e86HawtC.Farm \u63d0\u4f9b\u4e86\u5f00\u53d1\u63a5\u53e3\u548c\u591a\u7ebf\u7a0b\u8ba1\u7b97\u63a5\u53e3\u3002<\/h6>\n<h6>6\u3001\u4fee\u590d\u4e86Python\u5f53\u4e2d\u8c03\u7528dll\u7684\u8f6f\u4ef6\u5305\u9519\u8bef\uff0c\u5bf9\u6240\u6709\u51fd\u6570\u8fdb\u884c\u4e86\u529f\u80fd\u9a8c\u8bc1<\/h6>\n<h3>4\u3001\u4f7f\u7528\u6848\u4f8b<\/h3>\n<h4>4.1 python \u8c03\u7528\u6848\u4f8b<\/h4>\n<pre><code class=\"language-python\">import HawtC\nMBD = HawtC(r&#039;G:\\2026\\OpenhastV7\\build\\\\HawtC_User_C.MBD&#039;)\nHaetCModel=MBD.HawtCModel(MBD.MBD)\nMBD=MBD.MBD(MBD.MBD)\nTest=MBD.Test(MBD.MBD)\n\np1=HaetCModel.INIMain(r&quot;G:\\2026\\OpenhastV7\\demo\\openhast_x64\\IEA_15MW_onshore\\Debug.hst&quot;)\n\nresult = Test.GetAddc(2,3)\nprint(f&quot;Result: {result}&quot;)   \n\n# \u5b9a\u4e49 Addc \u59d4\u6258\u7684 Python \u51fd\u6570\ndef add_func(a, b):\n    print(f&quot;\u8fd9\u662fPython \u52a0\u6cd5: {a} + {b}&quot;)\n    return a + b\n\nTest.SetAddc(add_func)\n\n# \u8c03\u7528 C# \u4e2d\u7684 Addc \u59d4\u6258\n# result = addc_delegate(3.0, 4.0)\n# print(f&quot; {result}&quot;)\nresult = Test.GetAddc(2,6)\nprint(f&quot; {result}&quot;)\n\n# result = MBD.GetAddc(3.0, 4.0)\n# print(f&quot;Result: {result}&quot;)\nfor i in range(100):\n    MBD.MBD_Update_step(0,i,0.03)\n    # print(MBD.MBD_GetTowerBaseFz(0)-MBD.MBD_GetLocalTowerFzLoads(0,0))\n    print(MBD.MBD_GetTowerBaseMz(0)-MBD.MBD_GetLocalTowerMzLoads(0,0))\n    # print(MBD.MBD_GetBladeRootFz(0,0))\n    # print(MBD.MBD_GetTowerBaseFx(0))\n    # print(MBD.MBD_GetPlatformHeave(0))\n    # print(MBD.MBD_GetPlatformHeaveVel(0))\n    # print(MBD.MBD_GetPlatformHeaveAcc(0))\n    # print(MBD.MBD_GetTimesSpan(0))   \n    # MBD.MBD_Solve(0)\n    # MBD.MBD_Update_step(0,0,0.03)\n    # print(MBD.MBD_GetTowerBaseFx(0))\n    # print(MBD.MBD_GetLocalTowerFxLoads(0,0))\n    # print(MBD.MBD_GetTowerBaseFy(0))\n    # print(MBD.MBD_GetLocalTowerFyLoads(0,0))\n    # print(MBD.MBD_GetTowerBaseFz(0))\n    # print(MBD.MBD_GetLocalTowerFzLoads(0,0))\n    # print(MBD.MBD_GetTowerBaseMx(0))\n    # print(MBD.MBD_GetLocalTowerMxLoads(0,0))\n    # print(MBD.MBD_GetTowerBaseMy(0))\n    # print(MBD.MBD_GetLocalTowerMyLoads(0,0))\n    # print(MBD.MBD_GetTowerBaseMz(0))\n    # print(MBD.MBD_GetLocalTowerMzLoads(0,0))<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>HawtC.DLL \u6a21\u5757\u63d0\u4f9bAQWA\u3001Matlab\u3001pyth&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-828","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/www.openwecd.fun\/index.php\/wp-json\/wp\/v2\/pages\/828","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.openwecd.fun\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.openwecd.fun\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.openwecd.fun\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.openwecd.fun\/index.php\/wp-json\/wp\/v2\/comments?post=828"}],"version-history":[{"count":21,"href":"http:\/\/www.openwecd.fun\/index.php\/wp-json\/wp\/v2\/pages\/828\/revisions"}],"predecessor-version":[{"id":976,"href":"http:\/\/www.openwecd.fun\/index.php\/wp-json\/wp\/v2\/pages\/828\/revisions\/976"}],"wp:attachment":[{"href":"http:\/\/www.openwecd.fun\/index.php\/wp-json\/wp\/v2\/media?parent=828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}