在本例中,我们将演示如何输出 Engee 动力模型的极坐标系图形。
Graphs in the polar coordinate system allow you to see interrelationships that are not visible on graphs in the rectangular (Cartesian) coordinate system: to get an idea of the expression of some process in certain directions in space, or to trace the recurring dynamics within some cyclic process...
如果工作是在交互式脚本 Engee 中完成,则使用参数proj
将图形转换为极坐标系。其值:polar
允许我们以极坐标绘制图表:
让我们尝试只使用画布和动态模型图形输出工具,在极坐标系中绘制图形( ).
要在不使用交互式脚本工具的情况下为动态模型绘制极坐标图,我们需要将向量从矩形坐标系转换为极坐标系。
请考虑以下模型 (draw_polar_engee_logo.engee
):
我们可以在不运行仿真的情况下,只需参考每个区块的属性,就可以检查每个区块LUT
中定义了哪些片断线性关系。
因此,模型在矩形坐标系中绘制,但经过转换后输出,将输入信号解释为极坐标系中的数据。
输出图形是极坐标系中两个图形的总和。第一个部分设定了构成徽标的两条曲线(曲线LUT2
,其半径1.0
)各自的中心线位置。第二个部分(曲线LUT1
,显示半径为0.25
)模拟了与中心线的偏差。
坐标变换有两种不同的方式。两种方法都可以互换。在第一种情况下,我们使用基础调色板中的简单图块进行坐标变换:
在第二种情况下,我们使用Engee Function
块,用以下代码执行相同的操作:
``朱莉娅
struct Block <: AbstractCausalComponent
# 无参数
结束
函数 (c::Block)(t::Real, α, r)
x = r * sin( α )
y = r * cos( α )
返回 (x,y)
结束
在Engee 中,您可以逐渐使用越来越复杂的绘图工具,而无需编程。
在本演示中,我们展示了如何在无需编程的情况下绘制极坐标图(或者,如何使用Engee Function
块进行绘制)。 <br
与交互式脚本 中的图形不同,动态模型 中的图形可以在仿真过程中直接更新,这为交互式模型仿真创造了有趣的可能性。
{"id": "f645543f-5259-4652-92fa-76bb1e1f1f8b", "data": [{"showlegend": true, "mode": "lines+markers", "xaxis": "x", "colorbar": {"title": {"text": ""}}, "name": "y1", "zmin": null, "yaxis": "y", "legendgroup": "y1", "r": [0.052077331458093006, 0.1414680978568679, 0.3114998086864485, 0.37112761938395844, 0.5840204076078983, 0.6882132458430446, 0.7373715219773448, 0.763498082775455, 0.9286186248413238, 0.848932582763119, 1.022695354617578, 0.9454644195616699, 0.9611914158823638, 0.9082636099387181, 1.0389593178505314, 0.7417154150845715, 0.4983333386318608, 0.6556457615550872, 0.37712065875701506, 0.7184579782479548, 0.5260639430035099, 0.08236589775671815, 0.03401326900810071, 0.09789417277509628, 0.31240890329226934, 0.5068105593643969, 0.541799063400822, 0.5407980921109471, 0.8057458123045157, 1.0258104030017636, 0.9662203779160848, 0.8914807413143189, 1.0190582348593842, 0.9217072619717019, 1.1064462371208845, 0.9741892538699739, 0.9593492248628304, 0.8316108901094845, 0.715634258280182, 0.7398146408105261, 0.5681184507926905, 0.3976985938856331, 0.21180338112731023, 0.09591937615128443, 0.047592441411702026, 0.133409555343843, 0.23160247808710388, 0.47273732561811926, 0.5230502285465738, 0.5579747395266885, 0.6701024160384301, 0.8466343072915126, 0.8114138214849713, 0.9023171236572698, 1.0699636845405578, 1.0585670600621906, 0.9603618619041401, 0.8301432672506429, 0.977830320928892, 0.8482430054674311, 0.9676592983268654, 0.6095865425502475, 0.48299158959977145, 0.41332601544219183, 0.24223386374021907, 0.13595215350504736, 0.04010708633470035, 0.2887921277601918, 0.1925277006332445, 0.41673880372430766, 0.43434317001437844, 0.6576124249188121, 0.5927512528377328, 0.7442093630415743, 0.9767912788472548, 0.9812806680403509, 0.8092583070899907, 1.1243222715791172, 1.0220017501375824, 0.9338207706045277, 0.9441921096317526, 1.0121840814352454, 0.6583700712990694, 0.6747217164952095, 0.5152470626411259, 0.34271440935161873, 0.15682476210569896, 0.07265547971816538, 0.16659715604874828, 0.09080974449651585, 0.3272072462824619, 0.388856534179125, 0.6368635339950839, 0.5579680632387685, 0.8371062370140779, 1.0355992709919288, 0.7660026137774769, 0.9164780135888477, 1.0675826604687535, 1.1212805613614005], "marker": {"symbol": "circle", "color": "rgba(0, 154, 250, 1.000)", "line": {"color": "rgba(0, 0, 0, 1)", "width": 1}, "size": 4}, "zmax": null, "line": {"color": "rgba(0, 154, 250, 1.000)", "shape": "linear", "dash": "solid", "width": 1}, "type": "scatterpolar", "theta": [0, 2.727272727272727, 5.454545454545454, 8.181818181818182, 10.909090909090908, 13.636363636363637, 16.363636363636363, 19.09090909090909, 21.818181818181817, 24.545454545454543, 27.272727272727273, 29.999999999999996, 32.72727272727273, 35.45454545454545, 38.18181818181818, 40.909090909090914, 43.63636363636363, 46.36363636363637, 49.090909090909086, 51.81818181818182, 54.54545454545455, 57.27272727272727, 59.99999999999999, 62.72727272727273, 65.45454545454545, 68.18181818181819, 70.9090909090909, 73.63636363636363, 76.36363636363636, 79.0909090909091, 81.81818181818183, 84.54545454545455, 87.27272727272727, 90, 92.72727272727273, 95.45454545454545, 98.18181818181817, 100.9090909090909, 103.63636363636364, 106.36363636363636, 109.0909090909091, 111.81818181818181, 114.54545454545455, 117.27272727272728, 119.99999999999999, 122.72727272727273, 125.45454545454545, 128.1818181818182, 130.9090909090909, 133.63636363636363, 136.36363636363637, 139.0909090909091, 141.8181818181818, 144.54545454545456, 147.27272727272725, 150, 152.72727272727272, 155.45454545454544, 158.1818181818182, 160.9090909090909, 163.63636363636365, 166.36363636363637, 169.0909090909091, 171.8181818181818, 174.54545454545453, 177.27272727272728, 180, 182.72727272727272, 185.45454545454547, 188.1818181818182, 190.9090909090909, 193.63636363636363, 196.36363636363635, 199.0909090909091, 201.8181818181818, 204.54545454545456, 207.27272727272728, 210, 212.72727272727272, 215.45454545454544, 218.1818181818182, 220.9090909090909, 223.63636363636363, 226.36363636363637, 229.0909090909091, 231.8181818181818, 234.54545454545456, 237.27272727272728, 239.99999999999997, 242.72727272727272, 245.45454545454547, 248.18181818181816, 250.9090909090909, 253.63636363636365, 256.3636363636364, 259.09090909090907, 261.8181818181818, 264.54545454545456, 267.27272727272725, 270]}], "config": {"angularaxis": {"showline": true, "visible": true, "range": [0, 360]}, "showlegend": true, "paper_bgcolor": "rgba(255, 255, 255, 1.000)", "legend": {"yanchor": "auto", "xanchor": "auto", "bordercolor": "rgba(0, 0, 0, 1)", "bgcolor": "rgba(255, 255, 255, 1.000)", "borderwidth": 1, "tracegroupgap": 0, "y": 1, "font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 11}, "title": {"font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 15}, "text": ""}, "traceorder": "normal", "x": 1}, "height": 400, "radialaxis": {"showline": true, "visible": true, "range": [0, 1.233353171836219], "orientation": -90}, "annotations": [], "plot_bgcolor": "rgba(255, 255, 255, 1.000)", "margin": {"l": 0, "b": 20, "r": 0, "t": 20}, "direction": "counterclockwise", "width": 1015.375, "polar": {"angularaxis": {"type": "linear"}, "radialaxis": {"type": "linear", "autorange": true, "range": [0, 1.1433785812668988]}}}}
{"id": "07762a54-5d75-48e0-8960-983d279031d6", "data": [{"showlegend": true, "mode": "lines+markers", "xaxis": "x", "colorbar": {"title": {"text": ""}}, "name": "y1", "zmin": null, "yaxis": "y", "legendgroup": "y1", "marker": {"symbol": "circle", "color": "rgba(0, 154, 250, 1.000)", "line": {"color": "rgba(0, 0, 0, 1)", "width": 1}, "size": 4}, "zmax": null, "line": {"color": "rgba(0, 154, 250, 1.000)", "shape": "linear", "dash": "solid", "width": 1}, "y": [0.052077331458093006, 0.1414680978568679, 0.3114998086864485, 0.37112761938395844, 0.5840204076078983, 0.6882132458430446, 0.7373715219773448, 0.763498082775455, 0.9286186248413238, 0.848932582763119, 1.022695354617578, 0.9454644195616699, 0.9611914158823638, 0.9082636099387181, 1.0389593178505314, 0.7417154150845715, 0.4983333386318608, 0.6556457615550872, 0.37712065875701506, 0.7184579782479548, 0.5260639430035099, 0.08236589775671815, 0.03401326900810071, 0.09789417277509628, 0.31240890329226934, 0.5068105593643969, 0.541799063400822, 0.5407980921109471, 0.8057458123045157, 1.0258104030017636, 0.9662203779160848, 0.8914807413143189, 1.0190582348593842, 0.9217072619717019, 1.1064462371208845, 0.9741892538699739, 0.9593492248628304, 0.8316108901094845, 0.715634258280182, 0.7398146408105261, 0.5681184507926905, 0.3976985938856331, 0.21180338112731023, 0.09591937615128443, 0.047592441411702026, 0.133409555343843, 0.23160247808710388, 0.47273732561811926, 0.5230502285465738, 0.5579747395266885, 0.6701024160384301, 0.8466343072915126, 0.8114138214849713, 0.9023171236572698, 1.0699636845405578, 1.0585670600621906, 0.9603618619041401, 0.8301432672506429, 0.977830320928892, 0.8482430054674311, 0.9676592983268654, 0.6095865425502475, 0.48299158959977145, 0.41332601544219183, 0.24223386374021907, 0.13595215350504736, 0.04010708633470035, 0.2887921277601918, 0.1925277006332445, 0.41673880372430766, 0.43434317001437844, 0.6576124249188121, 0.5927512528377328, 0.7442093630415743, 0.9767912788472548, 0.9812806680403509, 0.8092583070899907, 1.1243222715791172, 1.0220017501375824, 0.9338207706045277, 0.9441921096317526, 1.0121840814352454, 0.6583700712990694, 0.6747217164952095, 0.5152470626411259, 0.34271440935161873, 0.15682476210569896, 0.07265547971816538, 0.16659715604874828, 0.09080974449651585, 0.3272072462824619, 0.388856534179125, 0.6368635339950839, 0.5579680632387685, 0.8371062370140779, 1.0355992709919288, 0.7660026137774769, 0.9164780135888477, 1.0675826604687535, 1.1212805613614005], "type": "scatter", "x": [0, 0.04759988869075444, 0.09519977738150888, 0.14279966607226333, 0.19039955476301776, 0.23799944345377222, 0.28559933214452665, 0.3331992208352811, 0.3807991095260355, 0.42839899821678995, 0.47599888690754444, 0.5235987755982988, 0.5711986642890533, 0.6187985529798077, 0.6663984416705622, 0.7139983303613167, 0.761598219052071, 0.8091981077428255, 0.8567979964335799, 0.9043978851243344, 0.9519977738150889, 0.9995976625058433, 1.0471975511965976, 1.0947974398873521, 1.1423973285781066, 1.189997217268861, 1.2375971059596154, 1.2851969946503699, 1.3327968833411243, 1.3803967720318788, 1.4279966607226333, 1.4755965494133876, 1.523196438104142, 1.5707963267948966, 1.618396215485651, 1.6659961041764055, 1.7135959928671598, 1.7611958815579143, 1.8087957702486688, 1.8563956589394233, 1.9039955476301778, 1.951595436320932, 1.9991953250116865, 2.046795213702441, 2.0943951023931953, 2.14199499108395, 2.1895948797747042, 2.237194768465459, 2.284794657156213, 2.3323945458469675, 2.379994434537722, 2.4275943232284765, 2.4751942119192307, 2.5227941006099854, 2.5703939893007397, 2.6179938779914944, 2.6655937666822487, 2.713193655373003, 2.7607935440637577, 2.808393432754512, 2.8559933214452666, 2.903593210136021, 2.951193098826775, 2.99879298751753, 3.046392876208284, 3.093992764899039, 3.141592653589793, 3.1891925422805474, 3.236792430971302, 3.2843923196620564, 3.331992208352811, 3.3795920970435653, 3.4271919857343196, 3.4747918744250743, 3.5223917631158286, 3.5699916518065833, 3.6175915404973376, 3.665191429188092, 3.7127913178788465, 3.760391206569601, 3.8079910952603555, 3.8555909839511098, 3.903190872641864, 3.9507907613326188, 3.998390650023373, 4.045990538714127, 4.093590427404882, 4.141190316095637, 4.1887902047863905, 4.236390093477145, 4.2839899821679, 4.331589870858654, 4.3791897595494085, 4.426789648240163, 4.474389536930918, 4.521989425621672, 4.569589314312426, 4.617189203003181, 4.664789091693935, 4.71238898038469], "zaxis": null, "z": null, "metadata": {"shouldEnableSmartZoom": false, "smartZoomParams": {"minCount": 25000, "maxCount": 100, "currentCount": 100}}}], "config": {"showlegend": true, "xaxis": {"showticklabels": true, "gridwidth": 0.5, "range": [-0.14137166941154078, 4.8537606497962305], "domain": [0.05100612423447069, 0.9934383202099737], "mirror": false, "tickangle": 0, "showline": true, "zeroline": false, "tickfont": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 11}, "zerolinecolor": "rgba(0, 0, 0, 1)", "anchor": "y", "visible": true, "ticks": "inside", "tickmode": "array", "linecolor": "rgba(0, 0, 0, 1)", "showgrid": true, "title": {"text": "", "font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 15}}, "gridcolor": "rgba(0, 0, 0, 0.1)", "tickcolor": "rgb(0, 0, 0)", "type": "linear"}, "paper_bgcolor": "rgba(255, 255, 255, 1.000)", "annotations": [], "height": 400, "margin": {"l": 0, "b": 20, "r": 0, "t": 20}, "plot_bgcolor": "rgba(255, 255, 255, 1.000)", "yaxis": {"showticklabels": true, "gridwidth": 0.5, "range": [0.0013039989309702182, 1.1570315416562478], "domain": [0.03762029746281716, 0.9901574803149606], "mirror": false, "tickangle": 0, "showline": true, "zeroline": false, "tickfont": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 11}, "zerolinecolor": "rgba(0, 0, 0, 1)", "anchor": "x", "visible": true, "ticks": "inside", "tickmode": "array", "linecolor": "rgba(0, 0, 0, 1)", "showgrid": true, "title": {"text": "", "font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 15}}, "gridcolor": "rgba(0, 0, 0, 0.1)", "tickcolor": "rgb(0, 0, 0)", "type": "linear"}, "legend": {"yanchor": "auto", "xanchor": "auto", "bordercolor": "rgba(0, 0, 0, 1)", "bgcolor": "rgba(255, 255, 255, 1.000)", "borderwidth": 1, "tracegroupgap": 0, "y": 1, "font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 11}, "title": {"font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 15}, "text": ""}, "traceorder": "normal", "x": 1}, "width": 1015.375}}
{"id": "01ef8043-9a94-4117-9b7c-46e5b534435c", "data": [{"showlegend": true, "mode": "lines", "xaxis": "x", "colorbar": {"title": {"text": ""}}, "name": "y1", "zmin": null, "yaxis": "y", "legendgroup": "y1", "zmax": null, "line": {"color": "rgba(0, 154, 250, 1.000)", "shape": "linear", "dash": "solid", "width": 1}, "y": [-0.40142572795869574, -1.1693705988362006, 1.9722220547535922, 2.740166925631097, 5.88175957922089, -0.9948376736367678, -2.722713633111154, -5.759586531581287, -1.8849555921538759, -5.026548245743669, -6.649704450098395], "type": "scatter", "x": [0, 0.811, 1.5, 2.447, 3, 3.0001, 4.638, 5.034, 7.766, 8.362, 10], "zaxis": null, "z": null, "metadata": {"shouldEnableSmartZoom": false, "smartZoomParams": {"minCount": 25000, "maxCount": 11, "currentCount": 11}}}, {"showlegend": true, "mode": "lines", "xaxis": "x2", "colorbar": {"title": {"text": ""}}, "name": "y1", "zmin": null, "yaxis": "y2", "legendgroup": "y1", "zmax": null, "line": {"color": "rgba(0, 154, 250, 1.000)", "shape": "linear", "dash": "solid", "width": 1}, "y": [2.722713633111154, 1.9722220547535922, 1.9722220547535922, 2.722713633111154, 2.722713633111154, -0.9948376736367678, -2.722713633111154, -2.722713633111154, 1.1519173063162575, 1.1519173063162575, -0.47123889803846897], "type": "scatter", "x": [0, 0.811, 1.5, 2.447, 3, 3.0001, 4.638, 5.034, 7.766, 8.362, 10], "zaxis": null, "z": null, "metadata": {"shouldEnableSmartZoom": false, "smartZoomParams": {"minCount": 25000, "maxCount": 11, "currentCount": 11}}}], "config": {"showlegend": false, "paper_bgcolor": "rgba(255, 255, 255, 1.000)", "height": 400, "yaxis2": {"showticklabels": true, "gridwidth": 0.5, "range": [-2.886076451097823, 2.886076451097823], "domain": [0.03762029746281716, 0.9901574803149606], "mirror": false, "tickangle": 0, "showline": true, "zeroline": false, "tickfont": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 11}, "zerolinecolor": "rgba(0, 0, 0, 1)", "anchor": "x2", "visible": true, "ticks": "inside", "tickmode": "array", "linecolor": "rgba(0, 0, 0, 1)", "showgrid": true, "title": {"text": "", "font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 15}}, "gridcolor": "rgba(0, 0, 0, 0.1)", "tickcolor": "rgb(0, 0, 0)", "type": "linear"}, "xaxis2": {"showticklabels": true, "gridwidth": 0.5, "range": [-0.3000000000000007, 10.3], "domain": [0.5510061242344707, 0.9934383202099738], "mirror": false, "tickangle": 0, "showline": true, "zeroline": false, "tickfont": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 11}, "zerolinecolor": "rgba(0, 0, 0, 1)", "anchor": "y2", "visible": true, "ticks": "inside", "tickmode": "array", "linecolor": "rgba(0, 0, 0, 1)", "showgrid": true, "title": {"text": "", "font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 15}}, "gridcolor": "rgba(0, 0, 0, 0.1)", "tickcolor": "rgb(0, 0, 0)", "type": "linear"}, "annotations": [], "plot_bgcolor": "rgba(255, 255, 255, 1.000)", "margin": {"l": 0, "b": 20, "r": 0, "t": 20}, "width": 1015.375, "xaxis": {"showticklabels": true, "gridwidth": 0.5, "range": [-0.3000000000000007, 10.3], "domain": [0.0658209390492855, 0.5082531350247886], "mirror": false, "tickangle": 0, "showline": true, "zeroline": false, "tickfont": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 11}, "zerolinecolor": "rgba(0, 0, 0, 1)", "anchor": "y", "visible": true, "ticks": "inside", "tickmode": "array", "linecolor": "rgba(0, 0, 0, 1)", "showgrid": true, "title": {"text": "", "font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 15}}, "gridcolor": "rgba(0, 0, 0, 0.1)", "tickcolor": "rgb(0, 0, 0)", "type": "linear"}, "yaxis": {"showticklabels": true, "gridwidth": 0.5, "range": [-7.025648370977974, 6.257703500100469], "domain": [0.03762029746281716, 0.9901574803149606], "mirror": false, "tickangle": 0, "showline": true, "zeroline": false, "tickfont": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 11}, "zerolinecolor": "rgba(0, 0, 0, 1)", "anchor": "x", "visible": true, "ticks": "inside", "tickmode": "array", "linecolor": "rgba(0, 0, 0, 1)", "showgrid": true, "title": {"text": "", "font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 15}}, "gridcolor": "rgba(0, 0, 0, 0.1)", "tickcolor": "rgb(0, 0, 0)", "type": "linear"}}}