{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 导入库"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>ScottPlot, 5.0.47</span></li></ul></div></div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "Loading extensions from `C:\\Users\\123\\.nuget\\packages\\skiasharp\\2.88.9\\interactive-extensions\\dotnet\\SkiaSharp.DotNet.Interactive.dll`"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# r\"G:\\2026\\OpenhastV7\\vs_build\\Openhast\\bin\\Debug\\net8.0\\HawtC.dll\"\n",
    "#r \"nuget:ScottPlot, 5.*\"\n",
    "// #r \"nuget:numflat, 1.*\"\n",
    "//# r\"C:\\Users\\123\\.nuget\\packages\\skiasharp\\2.88.8\\interactive-extensions\\dotnet\\SkiaSharp.DotNet.Interactive.dll\"\n",
    "\n",
    "using OpenWECD.IO.Log;\n",
    "using OpenWECD.WindL;\n",
    "using OpenWECD.WindL.SimWind;\n",
    "// using MathNet.Numerics.LinearAlgebra;\n",
    "// using OpenWECD.IO.math;\n",
    "// using OpenWECD.IO.Numerics;\n",
    "// using System.Collections.Generic;\n",
    "// using System.Linq;\n",
    "// using System.IO;\n",
    "// using static OpenWECD.IO.math.LinearAlgebraHelper;\n",
    "// using static System.Math;\n",
    "// using OpenWECD.FEML;\n",
    "// using ScottPlot;\n",
    "// using OpenWECD.IO.IO;"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// Setup a custom formatter to display plots as images\n",
    "using Microsoft.DotNet.Interactive.Formatting;\n",
    "Formatter.Register(typeof(ScottPlot.Plot), (p, w) => \n",
    "    w.Write(((ScottPlot.Plot)p).GetPngHtml(800, 400)), HtmlFormatter.MimeType);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1. WindL"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1.1.1 OpenWECD.HawtC.DLL.CAndC_DLL.SetSimWindDelSpecThin"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 使用 OpenWECD.HawtC.DLL.CAndC_DLL.SetSimWindDelSpecThin 指针接口实现自定义风谱模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "//# 用于Thin模式下的函数指针（c# 称为委托，是一种类型安全的指针），这是一个谱指针\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Debug 调试模式 develop by 赵子祯 Debug 调试模式 develop by 赵子祯 Debug 调试模式 develop by 赵子祯\n",
      "     ------------------------------------------------------------------------------------------     \n",
      "     !       000                                00     00    00  0000000   00000  000000      !     \n",
      "     !     0     0    000      000      00000   00    00    00  0        0       00     00    !     \n",
      "     !     0     0  0     0  0     0   0     0  00   0000   00  000000  0       00      00    !     \n",
      "     !      000    0      0 0       0 0     0    0  0   0  0   0        0       00     00     !     \n",
      "     !             0 0000   0  000    0     0     00     00    0000000   00000  0000000       !     \n",
      "     !             0        0     0                                                           !     \n",
      "     !            0          0000                                                             !     \n",
      "     !                                                                                        !     \n",
      " !                    Copyright (c) HawtC.Team.ZZZ,赵子祯 licensed under GPL v3 .                   !  \n",
      "     !                                                                                        !     \n",
      "     !   Copyright (c)  Key Laboratory of Jiangsu province High-Tech design of wind turbine   !     \n",
      "     !                                                                                        !     \n",
      "******                 Running Microsoft.DotNet.Interactive.App (vdebug.test  2024-12)                  ******\n",
      "     ------------------------------------------------------------------------------------------     \n",
      "Debug 调试模式 develop by 赵子祯 Debug 调试模式 develop by 赵子祯 Debug 调试模式 develop by 赵子祯\n",
      "       OpenWECD.Microsoft.DotNet.Interactive.App Lisenced To:超级用户 - Copyright (c)ZHAO ZIZHEN        \n",
      "Debug 调试模式 develop by 赵子祯 Debug 调试模式 develop by 赵子祯 Debug 调试模式 develop by 赵子祯\n",
      " SIMD_by赵子祯\n"
     ]
    }
   ],
   "source": [
    "\n",
    "LogHelper.DisplayInformation();\n",
    "\n",
    "var file = WindL_IO_Subs.ReadSimWind_MainFile(@\"G:\\2026\\OpenhastV7\\demo\\WindL\\SimWind湍流风生成模块案例\\\\HawtC.WindL.SimWind_MainFile_userSpec.dat\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<details open=\"open\" class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>OpenWECD.WindL.WND_SimWind</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>filepath</td><td><div class=\"dni-plaintext\"><pre>G:\\2026\\OpenhastV7\\demo\\WindL\\SimWind湍流风生成模块案例\\\\HawtC.WindL.SimWind_MainFile_userSpec.dat</pre></div></td></tr><tr><td>filedata</td><td><div class=\"dni-plaintext\"><pre>[ ------- OpenWECD.HawtC.WindL.SimWind  主文件 -------------------------------------------, 哈哈哈，终于把湍流谱方法弄明白且编写了HawtC自有的湍流风模块, ---------------------- 时间与IO定义 -------------------------------------- , 0.05           dt                  -  风的时间间隔[s], 600                Times          -  时间序列长度[s], 5                  FileType    -  生成的风文件类型{Bladed.wnd=1,FAST.bts=2,FAST and Bladed =3,ASCLL.txt=4,ALL=5}, , ---------------------- 风模型与风网格化  -------------------------------------- , 11                  SpecType            -  风的种类 {von_karman=1, kaimal=2,NPD=3, IEC_Von_Karman=4,IEC_Kaiman=5,IEC_Mann=6,User=11}(IEC为风力机谱，其他为桥梁工程和通用谱，无法设置湍流度), 1                  Profile         -  风的轮廓 {power=1, log=2, NPD=3}, 3                  Coh            -  空间相干性模型{DavenportModel=1(最简单),IEC_Von_karmanCoh =2,IEC_KaimanCoh=3,User=11}，可以自己定义相干性模型，对于IEC模型的空间相干性会遵循IEC-3rd的标准，但是会报警，MoptL下为了防止错误不支持自定义。, 2                 GenT         - 风谱生成方法{交叉谱 IFFT=1,Bladed IFFT=2,谐波叠加法=3(暂时不支持相干函数)}, 1,2,3                 Component  - 否生成的维度，1为u,2为v,3为w, 9                 MeanU       -  参考高度的平均风速[m/s], 150             RefZ           -  参考高度[m], 15                 Nyy             - 沿y轴的节点数量, 15                 Nzz             - 沿z轴的节点数量, 0                 Zmin           -  网格沿z轴的最小高度, 330               Zmax          -  网格沿z轴的最大高度, -160               Ymin          -   网格沿y轴的最小高度 ... (36 more) ]</pre></div></td></tr><tr><td>dt</td><td><div class=\"dni-plaintext\"><pre>0.05</pre></div></td></tr><tr><td>Times</td><td><div class=\"dni-plaintext\"><pre>600</pre></div></td></tr><tr><td>GenT</td><td><span>Thin</span></td></tr><tr><td>SpecType</td><td><span>user_SelfSpectralType</span></td></tr><tr><td>FileType</td><td><span>ALL</span></td></tr><tr><td>Component</td><td><div class=\"dni-plaintext\"><pre>[ 1, 2, 3 ]</pre></div></td></tr><tr><td>stdU</td><td><div class=\"dni-plaintext\"><pre>2.6</pre></div></td></tr><tr><td>stdV</td><td><div class=\"dni-plaintext\"><pre>2.2</pre></div></td></tr><tr><td>stdW</td><td><div class=\"dni-plaintext\"><pre>1.56</pre></div></td></tr><tr><td>Lux</td><td><div class=\"dni-plaintext\"><pre>340.2</pre></div></td></tr><tr><td>Lvx</td><td><div class=\"dni-plaintext\"><pre>113.4</pre></div></td></tr><tr><td>Lwx</td><td><div class=\"dni-plaintext\"><pre>27.72</pre></div></td></tr><tr><td>Coh</td><td><span>IEC_KaimanCoh</span></td></tr><tr><td>Cuy_1</td><td><div class=\"dni-plaintext\"><pre>7</pre></div></td></tr><tr><td>Cuz_1</td><td><div class=\"dni-plaintext\"><pre>10</pre></div></td></tr><tr><td>Cvy_1</td><td><div class=\"dni-plaintext\"><pre>7</pre></div></td></tr><tr><td>Cvz_1</td><td><div class=\"dni-plaintext\"><pre>10</pre></div></td></tr><tr><td>Cwy_1</td><td><div class=\"dni-plaintext\"><pre>6.5</pre></div></td></tr><tr><td>Cwz_1</td><td><div class=\"dni-plaintext\"><pre>3</pre></div></td></tr><tr><td>Lc</td><td><div class=\"dni-plaintext\"><pre>340.2</pre></div></td></tr><tr><td>Profile</td><td><span>power</span></td></tr><tr><td>MeanU</td><td><div class=\"dni-plaintext\"><pre>9</pre></div></td></tr><tr><td>RefZ</td><td><div class=\"dni-plaintext\"><pre>150</pre></div></td></tr><tr><td>a</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>u_star</td><td><div class=\"dni-plaintext\"><pre>0.8</pre></div></td></tr><tr><td>roughness</td><td><div class=\"dni-plaintext\"><pre>0.03</pre></div></td></tr><tr><td>kappa</td><td><div class=\"dni-plaintext\"><pre>0.4</pre></div></td></tr><tr><td>Nyy</td><td><div class=\"dni-plaintext\"><pre>15</pre></div></td></tr><tr><td>Nzz</td><td><div class=\"dni-plaintext\"><pre>15</pre></div></td></tr><tr><td>Zmin</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>Zmax</td><td><div class=\"dni-plaintext\"><pre>330</pre></div></td></tr><tr><td>Ymin</td><td><div class=\"dni-plaintext\"><pre>-160</pre></div></td></tr><tr><td>Ymax</td><td><div class=\"dni-plaintext\"><pre>160</pre></div></td></tr><tr><td>Seed</td><td><div class=\"dni-plaintext\"><pre>8560</pre></div></td></tr><tr><td>savepath</td><td><div class=\"dni-plaintext\"><pre>G:\\2026\\OpenhastV7\\demo\\WindL\\SimWind湍流风生成模块案例\\res.bts</pre></div></td></tr></tbody></table></div></details><style>\r\n",
       ".dni-code-hint {\r\n",
       "    font-style: italic;\r\n",
       "    overflow: hidden;\r\n",
       "    white-space: nowrap;\r\n",
       "}\r\n",
       ".dni-treeview {\r\n",
       "    white-space: nowrap;\r\n",
       "}\r\n",
       ".dni-treeview td {\r\n",
       "    vertical-align: top;\r\n",
       "    text-align: start;\r\n",
       "}\r\n",
       "details.dni-treeview {\r\n",
       "    padding-left: 1em;\r\n",
       "}\r\n",
       "table td {\r\n",
       "    text-align: start;\r\n",
       "}\r\n",
       "table tr { \r\n",
       "    vertical-align: top; \r\n",
       "    margin: 0em 0px;\r\n",
       "}\r\n",
       "table tr td pre \r\n",
       "{ \r\n",
       "    vertical-align: top !important; \r\n",
       "    margin: 0em 0px !important;\r\n",
       "} \r\n",
       "table th {\r\n",
       "    text-align: start;\r\n",
       "}\r\n",
       "</style>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "file"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "//# IEC karmal\n",
    "\n",
    "var U0 = file.MeanU;\n",
    "//I0 = 10.0;\n",
    "var sigma_u =2;// file.stdU;// (I0 * 0.01 * U0);\n",
    "var sigma_v =1.6; //file.stdV;// 0.8 * sigma_u;\n",
    "var sigma_w =1;// file.stdW;// 0.5 * sigma_u;\n",
    "var var_u = sigma_u * sigma_u;\n",
    "var var_v = sigma_v * sigma_v;\n",
    "var var_w = sigma_w * sigma_w;\n",
    "\n",
    "//p.StdU= sigma_u;\n",
    "//p.StdV= sigma_v;\n",
    "//p.StdW= sigma_w;\n",
    "\n",
    "var xLu = file.Lux;\n",
    "var xLv = file.Lvx;\n",
    "var xLw = file.Lwx;\n",
    "\n",
    "const double r = 5.0 / 3.0;\n",
    " \n",
    " /// <summary>\n",
    " /// \n",
    " /// </summary>\n",
    " /// <param name=\"U\"></param>\n",
    " /// <param name=\"Z\"></param>\n",
    " /// <param name=\"f\"></param>\n",
    " /// <param name=\"comp\"></param>\n",
    " /// <returns></returns>\n",
    " public float Spectral(in WND_SimRtHndSideType rths, double f, int comp, params float[] par)\n",
    " {\n",
    "     float Su = 0;\n",
    "     if (comp == 1)\n",
    "     {\n",
    "         Su = (float)(4.0 * var_u * (xLu / U0) / (Math.Pow(1.0 + 6.0 * f * (xLu / U0), r))) * 0.5f; //% Positive amplitude spectrum(U-component)\n",
    "     }\n",
    "     else if (comp == 2)\n",
    "     {\n",
    "         Su = (float)(4.0 * var_v * (xLv / U0) / (Math.Pow(1.0 + 6.0 * f * (xLv / U0), r))) * 0.5f; //% Positive amplitude spectrum(U-component)\n",
    "     }\n",
    "     else if (comp == 3)\n",
    "     {\n",
    "         Su = (float)(4.0 * var_w * (xLw / U0) / (Math.Pow(1.0 + 6.0 * f * (xLw / U0), r))) * 0.5f; //% Positive amplitude spectrum(U-component)\n",
    "     }\n",
    "     else\n",
    "     {\n",
    "         LogHelper.ErrorLog(\"The SimWind Kaimal Model only support 3D wind!\");\n",
    "     }\n",
    "\n",
    "\n",
    "     //var fr = (x * Z / U);\n",
    "\n",
    "\n",
    "     return Su;\n",
    "\n",
    " }\n",
    "\n",
    "//#将函数指针绑定到软件接口上面\n",
    "\n",
    "OpenWECD.HawtC.DLL.CAndC_DLL.SetSimWindDelSpecThin(Spectral);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " 欢迎使用OpenWECD.HawtC.WindL.SimWind 模块！Copyright (c) HawtC.Team.ZZZ, licensed under GPL\n",
      " The SimWind use User Define Spectral Model!\n",
      " The SimWind use IEC_karman Coherence Model!\n",
      " Component 1\n",
      "   [##############################] 100% (409/409)\n",
      " 22.32 s\n",
      "   TurbMeanU:-0.000 MeanU:9.000 Iv:28.889%\n",
      " Component 2\n",
      "   [##############################] 100% (409/409)\n",
      " 22.62 s\n",
      "   TurbMeanU:-0.000 MeanU:9.000 Iv:24.444%\n",
      " Component 3\n",
      "   [##############################] 100% (409/409)\n",
      " 33.52 s\n",
      "   TurbMeanU:-0.000 MeanU:9.000 Iv:17.333%\n",
      " SImWind file generation completed!.\n"
     ]
    }
   ],
   "source": [
    "var Sim=new GenerateWind_SimWind(file);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "//# 尝试读取风切绘图\n",
    "var mesh=SimWind_Subs.Plotmesh(Sim.GetRths.Y,Sim.GetRths.Z);\n",
    "mesh"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "using OpenWECD.IO.math;\n",
    "\n",
    "var t=Sim.GetRths.Wind1.TTurbSims;\n",
    "var windspeedu = Sim.GetRths.Wind1.Velocitys.GetElement<float>(':',7,7,0);\n",
    "var speeds=SimWind_Subs.Plot(t,windspeedu);\n",
    "//speeds;\n",
    "\n",
    "var plt1=new ScottPlot.Plot();\n",
    "var s=plt1.Add.Scatter(t, windspeedu);\n",
    "s.MarkerSize=0;\n",
    "s.LineWidth=0.5f;\n",
    "plt1.XLabel(\"Times[s]\");\n",
    "plt1.YLabel(\"Wind speed[m/s]\");\n",
    "plt1.Title(\"Wind Speed\");\n",
    "plt1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "OpenWECD.IO.IO.Otherhelper.Tostring(windspeedu.Select(x=>(double)x).ToArray())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "var t=Sim.GetRths.Wind1.TTurbSims;\n",
    "var windspeedv = Sim.GetRths.Wind1.Velocitys.GetElement<float>(':',7,6,1);\n",
    "var speeds=SimWind_Subs.Plot(t,windspeedv);\n",
    "//speeds;\n",
    "\n",
    "var plt1=new ScottPlot.Plot();\n",
    "var s=plt1.Add.Scatter(t, windspeedv);\n",
    "s.MarkerSize=0;\n",
    "s.LineWidth=0.5f;\n",
    "plt1.XLabel(\"Times[s]\");\n",
    "plt1.YLabel(\"Wind speed[m/s]\");\n",
    "plt1.Title(\"Wind Speed\");\n",
    "plt1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "var t=Sim.GetRths.Wind1.TTurbSims;\n",
    "var windspeedw= Sim.GetRths.Wind1.Velocitys.GetElement<float>(':',7,6,2);\n",
    "var speeds=SimWind_Subs.Plot(t,windspeedw);\n",
    "//speeds;\n",
    "\n",
    "var plt1=new ScottPlot.Plot();\n",
    "var s=plt1.Add.Scatter(t, windspeedw);\n",
    "s.MarkerSize=0;\n",
    "s.LineWidth=0.5f;\n",
    "plt1.XLabel(\"Times[s]\");\n",
    "plt1.YLabel(\"Wind speed[m/s]\");\n",
    "plt1.Title(\"Wind Speed\");\n",
    "plt1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "var spec = SimWind_Subs.Semilogx(Sim.GetRths.f.Map(x=>(float)x),Sim.GetRths.Su);\n",
    "SimWind_Subs.Semilogx(ref spec,Sim.GetRths.f,Sim.GetRths.Sv.Map(x=>(double)x));\n",
    "SimWind_Subs.Semilogx(ref spec,Sim.GetRths.f,Sim.GetRths.Sw.Map(x=>(double)x));\n",
    "spec"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "using MathNet.Numerics.LinearAlgebra;\n",
    "var u1 = MathHelper.fft(LinearAlgebraHelper.fzeros(windspeedu).ToComplex32()).Map(x=>x.Magnitude);\n",
    "var spec1 = SimWind_Subs.Semilogx(Sim.GetRths.f.Map(x=>(float)x)[1,-1],u1[1,-1]);\n",
    "SimWind_Subs.Semilogx(ref spec1,Sim.GetRths.f[1,-1],Sim.GetRths.Su.Map(x=>(double)x));\n",
    "spec1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "var v1 = MathHelper.fft(LinearAlgebraHelper.fzeros(windspeedv).ToComplex32()).Map(x=>x.Magnitude);\n",
    "var spec2 = SimWind_Subs.Semilogx(Sim.GetRths.f.Map(x=>(float)x)[1,-1],v1[1,-1]);\n",
    "SimWind_Subs.Semilogx(ref spec2,Sim.GetRths.f[1,-1],Sim.GetRths.Sv.Map(x=>(double)x));\n",
    "spec2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "var w1 = MathHelper.fft(LinearAlgebraHelper.fzeros(windspeedw).ToComplex32()).Map(x=>x.Magnitude);\n",
    "var spec3 = SimWind_Subs.Semilogx(Sim.GetRths.f.Map(x=>(float)x)[1,-1],w1[1,-1]);\n",
    "SimWind_Subs.Semilogx(ref spec3,Sim.GetRths.f[1,-1],Sim.GetRths.Sw.Map(x=>(double)x));\n",
    "spec3"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1.1.2 OpenWECD.WindL.SimWind.SpectralEquations.DelSpectralFull\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "//# 实现方法同 OpenWECD.WindL.SimWind.SpectralEquations.DelSpectralThin"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2. HawtC"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 2.1.1 OpenWECD.HawtC.Hast_Pro.INIMainC_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "G:\\2026\\OpenhastV7\\demo\\openhast_x64\\IEA_15MW_onshore\\\\Debug.hst\n",
      "Debug 调试模式 develop by 赵子祯 Debug 调试模式 develop by 赵子祯 Debug 调试模式 develop by 赵子祯\n",
      "     ------------------------------------------------------------------------------------------     \n",
      "     !       000                                00     00    00  0000000   00000  000000      !     \n",
      "     !     0     0    000      000      00000   00    00    00  0        0       00     00    !     \n",
      "     !     0     0  0     0  0     0   0     0  00   0000   00  000000  0       00      00    !     \n",
      "     !      000    0      0 0       0 0     0    0  0   0  0   0        0       00     00     !     \n",
      "     !             0 0000   0  000    0     0     00     00    0000000   00000  0000000       !     \n",
      "     !             0        0     0                                                           !     \n",
      "     !            0          0000                                                             !     \n",
      "     !                                                                                        !     \n",
      " !                    Copyright (c) HawtC.Team.ZZZ,赵子祯 licensed under GPL v3 .                   !  \n",
      "     !                                                                                        !     \n",
      "     !   Copyright (c)  Key Laboratory of Jiangsu province High-Tech design of wind turbine   !     \n",
      "     !                                                                                        !     \n",
      "******                 Running Microsoft.DotNet.Interactive.App (vdebug.test  2024-12)                  ******\n",
      "     ------------------------------------------------------------------------------------------     \n",
      "Debug 调试模式 develop by 赵子祯 Debug 调试模式 develop by 赵子祯 Debug 调试模式 develop by 赵子祯\n",
      "       OpenWECD.Microsoft.DotNet.Interactive.App Lisenced To:超级用户 - Copyright (c)ZHAO ZIZHEN        \n",
      "Debug 调试模式 develop by 赵子祯 Debug 调试模式 develop by 赵子祯 Debug 调试模式 develop by 赵子祯\n",
      " SIMD_by赵子祯\n",
      "------------------------------------------------------------------------------------\n",
      "! The Analysis: Openhast 15MW_Land_BaseLine_LinearBlade_NTM11.0\n",
      "------------------------------------------------------------------------------------\n",
      "Read File!\n",
      " 欢迎使用OpenWECD.ElastioL模块！Copyright (c) HawtC.Team.ZZZ, licensed under GPL\n",
      "Running AeroL.DynamicStall \n",
      " Run Staedy Modol to Solve！\n",
      "Running AeroL.Load \n",
      " Run BEMT.UnSteadyBEMT Modol to Solve！\n",
      " 欢迎使用OpenWECD.WindL模块！Copyright (c) HawtC.Team.ZZZ, licensed under GPL\n",
      " Generate Steady Wind. Speed:10. PL:0. RefHt:151 \n",
      " 欢迎使用OpenWECD.ControlL模块！Copyright (c) HawtC.Team.ZZZ, licensed under GPL\n",
      " BLADED ControL DLL DISCON Load Sucessful!\n",
      " 欢迎使用OpenWECD.ElastioL模块！\n",
      " Use Runge_Kutta_4t\n",
      "  HawtC.dll 初始化成功！等待操作\n",
      "初始化成功！\n"
     ]
    }
   ],
   "source": [
    "// 运行代码前请先安装OpenWECD模块,初始化模型\n",
    "OpenWECD.HawtC.Hast_Pro.INIMainC_(@\"G:\\2026\\OpenhastV7\\demo\\openhast_x64\\IEA_15MW_onshore\\\\Debug.hst\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 2.1.2 OpenWECD.HawtC.Hast_Pro.CloseC_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 关闭运行,输出结果\n",
    "OpenWECD.HawtC.Hast_Pro.CloseC_(0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.1.3 OpenWECD.HawtC.Hast_INI.HST_modulerths[turbinenum]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "    public class StaedyModel11: OpenWECD.AeroL.I_ALCalDynamicStall\n",
    "    {\n",
    "        private OpenWECD.AeroL. Airfoil1 Airfoil;\n",
    "        public StaedyModel11(OpenWECD.AeroL. AER_ParameterType p)\n",
    "        {\n",
    "            LogHelper.WriteLog(\"Run Staedy Modol to Solve！\", title: \"[success]\", leval: 1);\n",
    "            Airfoil = p.Airfoil;\n",
    "        }\n",
    "\n",
    "        public (double cl, double cd, double cm) LiftDragCoeffInterp(double t, double dt, int nstep, int FoilNum, double AOA, ref OpenWECD.AeroL. T_ALAeroBladeElement bld, OpenWECD.AeroL. T_ALAeroBladeElement srths)\n",
    "        {\n",
    "            bld.DCl = Airfoil[FoilNum].IterCl.Interpolate(AOA);\n",
    "            bld.DCd = Airfoil[FoilNum].IterCd.Interpolate(AOA);\n",
    "            bld.DCm = Airfoil[FoilNum].IterCm.Interpolate(AOA);\n",
    "            Console.WriteLine($\"cl:{bld.DCl},cd:{bld.DCd},cm:{bld.DCm}\");\n",
    "            return (bld.DCl, bld.DCd, bld.DCm);\n",
    "        }\n",
    "        public (double cl, double cd, double cm) LiftDragCoeffInterp(double t, double dt, int nstep, int FoilNum, double AOA)\n",
    "        {\n",
    "            var DCl = Airfoil[FoilNum].IterCl.Interpolate(AOA);\n",
    "            var DCd = Airfoil[FoilNum].IterCd.Interpolate(AOA);\n",
    "            var DCm = Airfoil[FoilNum].IterCm.Interpolate(AOA);\n",
    "            Console.WriteLine($\"cl:{DCl},cd:{DCd},cm:{DCm}\");\n",
    "            return (DCl, DCd, DCm);\n",
    "        }\n",
    "    }"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " Run Staedy Modol to Solve！\r\n"
     ]
    }
   ],
   "source": [
    "//这是一个高级接口,只适用与C# 语言当中,其中保存了运行过程当中每一个步长的所有数据集合,为了方便用户进行后续的数据处理.\n",
    "OpenWECD.HawtC.Hast_INI.HST_modulerths[0].AER_rths.CallDynamicStall=new StaedyModel11(OpenWECD.HawtC.Hast_INI.HST_modulepara[0].AER_p);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3. MBD"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.1 模型时域仿真迭代控制相关"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.1.1 OpenWECD.HawtC.DLL.CAndC_DLL.Update"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "G:\\2026\\OpenhastV7\\demo\\openhast_x64\\IEA_15MW_onshore\\\\Debug用.hst\n",
      "------------------------------------------------------------------------------------\n",
      "! The Analysis: Openhast 15MW_Land_BaseLine_LinearBlade_NTM11.0\n",
      "------------------------------------------------------------------------------------\n",
      "Read File!\n",
      " 欢迎使用OpenWECD.ElastioL模块！Copyright (c) HawtC.Team.ZZZ, licensed under GPL\n",
      "Running AeroL.DynamicStall \n",
      " Run Staedy Modol to Solve！\n",
      "Running AeroL.Load \n",
      " Run BEMT.UnSteadyBEMT Modol to Solve！\n",
      " 欢迎使用OpenWECD.WindL模块！Copyright (c) HawtC.Team.ZZZ, licensed under GPL\n",
      " Generate Steady Wind. Speed:10. PL:0. RefHt:151 \n",
      " 欢迎使用OpenWECD.ControlL模块！Copyright (c) HawtC.Team.ZZZ, licensed under GPL\n",
      " BLADED ControL DLL DISCON Load Sucessful!\n",
      " 欢迎使用OpenWECD.ElastioL模块！\n",
      " Use Runge_Kutta_4t\n",
      "  HawtC.dll 初始化成功！等待操作\n",
      "初始化成功！\n"
     ]
    }
   ],
   "source": [
    "// 必须先初始化模型\n",
    "OpenWECD.HawtC.Hast_Pro.INIMainC_(@\"G:\\2026\\OpenhastV7\\demo\\openhast_x64\\IEA_15MW_onshore\\\\Debug用.hst\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " Time Elapsed: 45 to 300 secs. final time left: 02 mins 51 secs.            \r"
     ]
    }
   ],
   "source": [
    "//# 更新仿真\n",
    "for (int i = 0; i < 1000; i++)\n",
    "{\n",
    "    OpenWECD.HawtC.DLL.CAndC_DLL.Update(0,i,0.08);\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "vscode": {
     "languageId": "polyglot-notebook"
    }
   },
   "source": [
    "#### 3.1.2 OpenWECD.HawtC.DLL.CAndC_DLL.Solve"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "OpenWECD.HawtC.DLL.CAndC_DLL.Solve(0);//对风力机0进行求解"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "vscode": {
     "languageId": "polyglot-notebook"
    }
   },
   "source": [
    "#### 3.1.3 OpenWECD.HawtC.DLL.CAndC_DLL.GetTimesSpan\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "OpenWECD.HawtC.DLL.CAndC_DLL.GetTimesSpan(0);\n",
    "var plt=OpenWECD.WindL.SimWind.SimWind_Subs.Plot(OpenWECD.HawtC.DLL.CAndC_DLL.GetTimesSpan(0));\n",
    "plt"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.1.4 OpenWECD.HawtC.DLL.CAndC_DLL.GetTimesN"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "OpenWECD.HawtC.DLL.CAndC_DLL.GetTimesN(0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.2 塔底力获取相关"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.2.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetTowerBaseFx"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "//# 必须在更新update之后才能进行计算\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "299.20050048828125\n",
      "-1012.576904296875\n",
      "653.5311889648438\n",
      "2173.321044921875\n",
      "2473.79541015625\n",
      "1444.2440185546875\n",
      "86.00758361816406\n",
      "-424.6497802734375\n",
      "218.80636596679688\n",
      "1262.8392333984375\n"
     ]
    }
   ],
   "source": [
    "//# 更新仿真\n",
    "for (int i = 0; i < 10; i++)\n",
    "{\n",
    "    OpenWECD.HawtC.DLL.CAndC_DLL.Update(0,i,0.08);\n",
    "    Console.WriteLine(OpenWECD.HawtC.DLL.CAndC_DLL.GetTowerBaseFx(0));\n",
    "}\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.2.2 OpenWECD.HawtC.DLL.CAndC_DLL.GetTowerBaseFy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 用法同 OpenWECD.HawtC.DLL.CAndC_DLL.GetTowerBaseFx"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.2.3 OpenWECD.HawtC.DLL.CAndC_DLL.GetTowerBaseFz"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 用法同 OpenWECD.HawtC.DLL.CAndC_DLL.GetTowerBaseFx"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.2.4 OpenWECD.HawtC.DLL.CAndC_DLL.GetTowerBaseMx"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 用法同 OpenWECD.HawtC.DLL.CAndC_DLL.GetTowerBaseFx"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.2.5 OpenWECD.HawtC.DLL.CAndC_DLL.GetTowerBaseMy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 用法同 OpenWECD.HawtC.DLL.CAndC_DLL.GetTowerBaseFx"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.2.6 OpenWECD.HawtC.DLL.CAndC_DLL.GetTowerBaseMz"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 用法同 OpenWECD.HawtC.DLL.CAndC_DLL.GetTowerBaseFx"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.3 塔架节点力获取相关"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.3.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetLocalTowerFxLoads"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// public static double GetLocalTowerFxLoads(int turbinenum, int J)//风机编号和节点编号\n",
    "//# 更新仿真\n",
    "for (int i = 0; i < 10; i++)\n",
    "{\n",
    "    OpenWECD.HawtC.DLL.CAndC_DLL.Update(0,i,0.08);\n",
    "    Console.WriteLine(OpenWECD.HawtC.DLL.CAndC_DLL.GetLocalTowerFxLoads(0,2));\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.3.2 OpenWECD.HawtC.DLL.CAndC_DLL.GetLocalTowerFyLoads"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "//同 OpenWECD.HawtC.DLL.CAndC_DLL.GetLocalTowerFxLoads"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.3.3 OpenWECD.HawtC.DLL.CAndC_DLL.GetLocalTowerFzLoads"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "//同 OpenWECD.HawtC.DLL.CAndC_DLL.GetLocalTowerFxLoads"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.3.4 OpenWECD.HawtC.DLL.CAndC_DLL.GetLocalTowerMxLoads"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "//同 OpenWECD.HawtC.DLL.CAndC_DLL.GetLocalTowerFxLoads"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.3.5 OpenWECD.HawtC.DLL.CAndC_DLL.GetLocalTowerMyLoads"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "//同 OpenWECD.HawtC.DLL.CAndC_DLL.GetLocalTowerFxLoads"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.3.6 OpenWECD.HawtC.DLL.CAndC_DLL.GetLocalTowerMzLoads"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "//同 OpenWECD.HawtC.DLL.CAndC_DLL.GetLocalTowerFxLoads"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.4 叶片叶根力获取相关"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.4.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeRootFx"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "叶片1:75.6799087524414\n",
      "叶片2:194.39212036132812\n",
      "叶片3:138.1440887451172\n",
      "叶片1:74.16834259033203\n",
      "叶片2:197.24252319335938\n",
      "叶片3:142.8839111328125\n",
      "叶片1:71.36116790771484\n",
      "叶片2:200.39877319335938\n",
      "叶片3:144.98153686523438\n",
      "叶片1:70.83309173583984\n",
      "叶片2:202.3513641357422\n",
      "叶片3:147.5386962890625\n",
      "叶片1:73.45348358154297\n",
      "叶片2:202.6669921875\n",
      "叶片3:147.21615600585938\n",
      "叶片1:76.24305725097656\n",
      "叶片2:198.95755004882812\n",
      "叶片3:143.69090270996094\n",
      "叶片1:76.7735366821289\n",
      "叶片2:191.605712890625\n",
      "叶片3:138.93458557128906\n",
      "叶片1:74.95237731933594\n",
      "叶片2:182.5645294189453\n",
      "叶片3:135.32249450683594\n",
      "叶片1:72.73506927490234\n",
      "叶片2:174.09812927246094\n",
      "叶片3:134.02896118164062\n",
      "叶片1:72.21968841552734\n",
      "叶片2:168.10604858398438\n",
      "叶片3:134.62229919433594\n"
     ]
    }
   ],
   "source": [
    "// public static double GetLocalTowerFxLoads(int turbinenum, int J)//风机编号和节点编号\n",
    "//# 更新仿真\n",
    "for (int i = 0; i < 10; i++)\n",
    "{\n",
    "    OpenWECD.HawtC.DLL.CAndC_DLL.Update(0,i,0.08);\n",
    "    Console.WriteLine(\"叶片1:\"+OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeRootFx(0,0));\n",
    "    Console.WriteLine(\"叶片2:\"+OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeRootFx(0,1));\n",
    "    Console.WriteLine(\"叶片3:\"+OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeRootFx(0,2));\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.4.2 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeRootFy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "//同 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeRootFx"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.4.3 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeRootFz"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "//同 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeRootFx"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.4.4 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeRootMx"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "//同 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeRootFx"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.4.5 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeRootMy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "//同 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeRootFx"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.4.6 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeRootMz"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "//同 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeRootFx"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.5 叶片节点力获取相关"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "vscode": {
     "languageId": "polyglot-notebook"
    }
   },
   "source": [
    "#### 3.5.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeLocalMx"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "叶片1:-27.540935516357422\n",
      "叶片2:296.0452880859375\n",
      "叶片3:67.50149536132812\n",
      "叶片1:-9.209775924682617\n",
      "叶片2:321.6797180175781\n",
      "叶片3:58.86741638183594\n",
      "叶片1:-0.9608211517333984\n",
      "叶片2:341.52044677734375\n",
      "叶片3:48.90780258178711\n",
      "叶片1:6.05915641784668\n",
      "叶片2:360.6646423339844\n",
      "叶片3:38.45258331298828\n",
      "叶片1:11.155315399169922\n",
      "叶片2:368.25286865234375\n",
      "叶片3:30.01717758178711\n",
      "叶片1:13.322402954101562\n",
      "叶片2:361.1633605957031\n",
      "叶片3:24.37307357788086\n",
      "叶片1:12.830663681030273\n",
      "叶片2:344.50738525390625\n",
      "叶片3:20.886550903320312\n",
      "叶片1:11.215400695800781\n",
      "叶片2:326.6657409667969\n",
      "叶片3:18.666486740112305\n",
      "叶片1:10.824895858764648\n",
      "叶片2:313.94647216796875\n",
      "叶片3:17.36250877380371\n",
      "叶片1:13.674610137939453\n",
      "叶片2:307.813720703125\n",
      "叶片3:17.032644271850586\n"
     ]
    }
   ],
   "source": [
    "// public static double GetLocalTowerFxLoads(int turbinenum, int J)//风机编号和节点编号\n",
    "//# 更新仿真\n",
    "for (int i = 0; i < 10; i++)\n",
    "{\n",
    "    OpenWECD.HawtC.DLL.CAndC_DLL.Update(0,i,0.08);\n",
    "    Console.WriteLine(\"叶片1:\"+OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeLocalRootFx(0,0,4));\n",
    "    Console.WriteLine(\"叶片2:\"+OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeLocalRootFx(0,1,5));\n",
    "    Console.WriteLine(\"叶片3:\"+OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeLocalRootFx(0,2,6));\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.5.2 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeLocalMy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeLocalMx"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.5.3 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeLocalMz"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeLocalMx"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.5.4 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeLocalFx"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeLocalMx"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.5.5 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeLocalFy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeLocalMx"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.5.6 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeLocalFz"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 OpenWECD.HawtC.DLL.CAndC_DLL.GetBladeLocalMx"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.6 基础位移相关"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.6.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurge"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "0\n",
      "0\n",
      "0\n",
      "0\n",
      "0\n",
      "0\n",
      "0\n",
      "0\n",
      "0\n"
     ]
    }
   ],
   "source": [
    "// public static double GetLocalTowerFxLoads(int turbinenum, int J)//风机编号和节点编号\n",
    "//# 更新仿真\n",
    "for (int i = 0; i < 10; i++)\n",
    "{\n",
    "    OpenWECD.HawtC.DLL.CAndC_DLL.Update(0,i,0.08);\n",
    "    Console.WriteLine(OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformHeave(0));\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.6.2 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSway"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 3.6.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurge"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.6.3 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformHeave\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 3.6.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurge"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.6.4 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformRoll"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 3.6.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurge"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.6.5 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformPitch"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 3.6.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurge"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.6.6 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformYaw"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 3.6.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurge"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.7 平台速度相关"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.7.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurgeVel"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "0\n",
      "0\n",
      "0\n",
      "0\n",
      "0\n",
      "0\n",
      "0\n",
      "0\n",
      "0\n"
     ]
    }
   ],
   "source": [
    "// public static double GetLocalTowerFxLoads(int turbinenum, int J)//风机编号和节点编号\n",
    "//# 更新仿真\n",
    "for (int i = 0; i < 10; i++)\n",
    "{\n",
    "    OpenWECD.HawtC.DLL.CAndC_DLL.Update(0,i,0.08);\n",
    "    Console.WriteLine(OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformHeaveVel(0));\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.7.2 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSwayVel"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 3.7.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurgeVel"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.7.3 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformHeaveVel"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 3.7.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurgeVel"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.7.4 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformRollVel"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 3.7.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurgeVel"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.7.5 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformPitchVel"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 3.7.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurgeVel"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "vscode": {
     "languageId": "polyglot-notebook"
    }
   },
   "source": [
    "#### 3.7.6 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformYawVel"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 3.7.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurgeVel"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.8 平台加速度相关"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.8.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurgeAcc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "0\n",
      "0\n",
      "0\n",
      "0\n",
      "0\n",
      "0\n",
      "0\n",
      "0\n",
      "0\n"
     ]
    }
   ],
   "source": [
    "// public static double GetLocalTowerFxLoads(int turbinenum, int J)//风机编号和节点编号\n",
    "//# 更新仿真\n",
    "for (int i = 0; i < 10; i++)\n",
    "{\n",
    "    OpenWECD.HawtC.DLL.CAndC_DLL.Update(0,i,0.08);\n",
    "    Console.WriteLine(OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurgeAcc(0));\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.8.2 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSwayAcc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 3.8.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurgeAcc"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.8.3 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformHeaveAcc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 3.8.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurgeAcc"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.8.4 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformRollAcc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 3.8.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurgeAcc"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.8.5 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformPitchAcc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 3.8.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurgeAcc"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.8.6 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformYawAcc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "// 同 3.8.1 OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurgeAcc"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4. ControL"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### OpenWECD.ControlL.IControLler"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "using OpenWECD.ControlL;\n",
    "using OpenWECD.MBD;\n",
    "public class ControLUser:OpenWECD.ControlL.IControLler\n",
    "{\n",
    "    public void ICall_Controller(double t, int i_t,double dt, CON_ParameterType p, MBD_OutputType y, ref CON_RtHndSideType rths)\n",
    "    {\n",
    "        Console.WriteLine(\"用户自定义控制器\");\n",
    "    }\n",
    "    public void FreeDLL()\n",
    "    {\n",
    "     Console.WriteLine(\"用户自定义控制器\");\n",
    "    }\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "//# 首先INIMainC_初始化模型,不要Update或者Solver然后在高级接口绑定\n",
    "OpenWECD.ControlL.IControLler user=new ControLUser();\n",
    "var s=OpenWECD.HawtC.Hast_INI.HST_modulerths[0];\n",
    "s.CON_rths.ICallControLler=user;\n",
    "OpenWECD.HawtC.Hast_INI.HST_modulerths[0]=s;\n",
    "for (int i = 0; i < 1; i++)\n",
    "{\n",
    "    OpenWECD.HawtC.DLL.CAndC_DLL.Update(0,i,0.08);\n",
    "    //Console.WriteLine(OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurgeAcc(0));\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [],
   "source": [
    "for (int i = 0; i < 100; i++)\n",
    "{\n",
    "    OpenWECD.HawtC.DLL.CAndC_DLL.Update(0,i,0.08);\n",
    "    //Console.WriteLine(OpenWECD.HawtC.DLL.CAndC_DLL.GetPlatformSurgeAcc(0));\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "用户自定义风谱模型与相干函数模型案例\r\n"
     ]
    }
   ],
   "source": [
    "OpenWECD.HawtC.Hast_INI.HST_modulerths[0].CON_rths.ICallControLler.FreeDLL()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 5. AeroL"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "name": "python",
   "version": "3.9.12"
  },
  "polyglot_notebook": {
   "kernelInfo": {
    "defaultKernelName": "csharp",
    "items": [
     {
      "aliases": [],
      "name": "csharp"
     }
    ]
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
