0
0
mirror of http://CODE.RHODECODE.COM/u/O/O/O synced 2024-11-30 03:48:50 -05:00
O/⚪ᕤᕦ⚪ИN⚪ꖴ⚪ᙏ⚪ᗩ⚪ᴥ⚪ᕤᕦ⚪Ⓞ⚪ᴥ⚪ߦ⚪◌⚪◌⚪◌⚪◌⚪◌⚪◌⚪ߦ⚪ᴥ⚪Ⓞ⚪ᕤᕦ⚪ᴥ⚪ᗩ⚪ᙏ⚪ꖴ⚪ИN⚪ᕤᕦ⚪/⚪ИN⚪Ⓞ⚪옷⚪✤⚪人⚪ߦ⚪◌⚪◌⚪◌⚪◌⚪◌⚪◌⚪ߦ⚪人⚪✤⚪옷⚪Ⓞ⚪ИN⚪/⚪ᴥ⚪ᗱᗴ⚪✤⚪人⚪ߦ⚪ᑎ⚪ᒍᒐ⚪◌⚪◌⚪◌⚪◌⚪◌⚪◌⚪ᒍᒐ⚪ᑎ⚪ߦ⚪人⚪✤⚪ᗱᗴ⚪ᴥ⚪/YP.⚪ИN⚪Ⓞ⚪ꖴ⚪✤⚪ᗩ⚪ᙏ⚪ꖴ⚪ꕤ⚪Ⓞ⚪ᴥ⚪ߦ⚪ᗩ⚪◯⚪ᙁ⚪ᗩ⚪ꖴ⚪✤⚪ИN⚪ᗱᗴ⚪ИN⚪Ⓞ⚪ߦ⚪ꕤ⚪ᗱᗴ⚪◯⚪ᗱᗴ⚪ᙁ⚪ᑐᑕ⚪ᴥ⚪ꖴ⚪ᑎ⚪¤⚪ᔓᔕ⚪◯⚪ᗱᗴ⚪ᴥ⚪ᑎ⚪✤⚪ᗩ⚪ᗯ⚪ᴥ⚪ᑎ⚪ᑐᑕ⚪◯⚪ᔓᔕ⚪ᑎ⚪ꖴ⚪⚭⚪ᗩ⚪ꗳ⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪ꗳ⚪ᗩ⚪⚭⚪ꖴ⚪ᑎ⚪ᔓᔕ⚪◯⚪ᑐᑕ⚪ᑎ⚪ᴥ⚪ᗯ⚪ᗩ⚪✤⚪ᑎ⚪ᴥ⚪ᗱᗴ⚪◯⚪ᔓᔕ⚪¤⚪ᑎ⚪ꖴ⚪ᴥ⚪ᑐᑕ⚪ᙁ⚪ᗱᗴ⚪◯⚪ᗱᗴ⚪ꕤ⚪ߦ⚪Ⓞ⚪ИN⚪ᗱᗴ⚪ИN⚪✤⚪ꖴ⚪ᗩ⚪ᙁ⚪◯⚪ᗩ⚪ߦ⚪ᴥ⚪Ⓞ⚪ꕤ⚪ꖴ⚪ᙏ⚪ᗩ⚪✤⚪ꖴ⚪Ⓞ⚪ИN⚪.PY
fed9a87b6f YP.ИNߦИNᗱᗴИNߦᗱᗴᗱᗴᑐᑕ¤ᔓᔕᗱᗴᑐᑕᔓᔕ𖡼𖡼𖡼𖡼𖡼𖡼ᔓᔕᑐᑕᗱᗴᔓᔕ¤ᑐᑕᗱᗴᗱᗴߦИNᗱᗴИNߦИN.PY
2023-11-16 22:21:23 +00:00

16 lines
4.3 KiB
Python
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import plotly.graph_objects as ⵙᔓᔕ𖧷ᑐᑕᗱᗴᒐ8O옷ߦᗩᴥᕤᕦⵙⵙᕤᕦᴥᗩߦ옷O8ᒐᗱᗴᑐᑕ𖧷ᔓᔕⵙ
import numpy as ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ
def ⵙᗱᗴ𖧷ᑎߦᙏOᑐᑕⵙⵙᑐᑕOᙏߦᑎ𖧷ᗱᗴⵙ(x):
return (1-((-((-1)**ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.floor(x/ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.pi*2)*(ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.exp(-1/((x/ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.pi*2)-ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.floor((x/ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.pi*2))))
/(ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.exp(-1/((x/ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.pi*2)-ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.floor((x/ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.pi*2))))+ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.exp(-1/(1-(x/ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.pi*2)+ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.floor((x/ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.pi*2))))))) +
((-1)**ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.floor((x/ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.pi*2)/1)*(ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.exp(-1/(1-(x/ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.pi*2)+ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.floor((x/ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.pi*2))))/(ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.exp(-1/((x/ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.pi*2)-
ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.floor((x/ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.pi*2))))+ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.exp(-1/(1-(x/ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.pi*2)+ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.floor((x/ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.pi*2))))))))/2 + .5))
ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ=ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.linspace(0,4*ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.pi,1000)
ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔᗩߦᗩ𐊌ⵙⵔⵙⵔⵙ𐊌ᗩߦᗩⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ=ⵙᗱᗴ𖧷ᑎߦᙏOᑐᑕⵙⵙᑐᑕOᙏߦᑎ𖧷ᗱᗴⵙ(ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ)
ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔᗩ𖧷ᗱᗴ옷𖧷ⵙⵔⵙⵔⵙ𖧷옷ᗱᗴ𖧷ᗩⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ=ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.cumsum(ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔᗩߦᗩ𐊌ⵙⵔⵙⵔⵙ𐊌ᗩߦᗩⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ)*(ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ[1]-ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ[0])
ⵙᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕꕤⵙⵙꕤᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵙ=ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.cumsum(ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.cos(ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔᗩ𖧷ᗱᗴ옷𖧷ⵙⵔⵙⵔⵙ𖧷옷ᗱᗴ𖧷ᗩⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ))*(ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ[1]-ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ[0])
ⵙᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕ人ⵙⵙ人ᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵙ=ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.cumsum(ⵙ人ߦᙏᑎИNⵙⵙИNᑎᙏߦ人ⵙ.sin(ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔᗩ𖧷ᗱᗴ옷𖧷ⵙⵔⵙⵔⵙ𖧷옷ᗱᗴ𖧷ᗩⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ))*(ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ[1]-ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ[0])
ⵙᗱᗴᴥᑎᕤᕦꖴꗳⵙⵔⵙⵔⵙꗳꖴᕤᕦᑎᴥᗱᗴⵙ=ⵙᔓᔕ𖧷ᑐᑕᗱᗴᒐ8O옷ߦᗩᴥᕤᕦⵙⵙᕤᕦᴥᗩߦ옷O8ᒐᗱᗴᑐᑕ𖧷ᔓᔕⵙ.Figure()
ⵙᗱᗴᴥᑎᕤᕦꖴꗳⵙⵔⵙⵔⵙꗳꖴᕤᕦᑎᴥᗱᗴⵙ.add_trace(ⵙᔓᔕ𖧷ᑐᑕᗱᗴᒐ8O옷ߦᗩᴥᕤᕦⵙⵙᕤᕦᴥᗩߦ옷O8ᒐᗱᗴᑐᑕ𖧷ᔓᔕⵙ.Scatter(x=ⵙᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕꕤⵙⵙꕤᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵙ,y=ⵙᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕ人ⵙⵙ人ᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵙ,mode='lines',name='Curve'))
ⵙᗱᗴᴥᑎᕤᕦꖴꗳⵙⵔⵙⵔⵙꗳꖴᕤᕦᑎᴥᗱᗴⵙ.update_layout(autosize=True,xaxis=dict(scaleanchor='y',scaleratio=1))
ⵙᗱᗴᴥᑎᕤᕦꖴꗳⵙⵔⵙⵔⵙꗳꖴᕤᕦᑎᴥᗱᗴⵙ.show()