0
0
mirror of http://CODE.RHODECODE.COM/u/O/O/O synced 2024-11-22 03:56:17 -05:00
O/𖣠⚪ᕤᕦИNꖴᙏᗩᴥᕤᕦⓄᴥߦ⚪𔗢⚪🞋⚪𔗢⚪ߦᴥⓄᕤᕦᴥᗩᙏꖴИNᕤᕦ⚪𖣠/𖣠⚪ИNⓄ옷✤᨟ߦ⚪𔗢⚪🞋⚪𔗢⚪ߦ᨟✤옷ⓄИN⚪𖣠/𖣠⚪ᴥᗱᗴ✤᨟ߦᑎᒍᒐ⚪𔗢⚪🞋⚪𔗢⚪ᒍᒐᑎߦ᨟✤ᗱᗴᴥ⚪𖣠/YP.⚪ИN⚪Ⓞ⚪ꖴ⚪✤⚪ᗩ⚪ᙏ⚪ꖴ⚪ꕤ⚪Ⓞ⚪ᴥ⚪ߦ⚪ᗩ⚪◯⚪ᙁ⚪ᗩ⚪ꖴ⚪✤⚪ИN⚪ᗱᗴ⚪ИN⚪Ⓞ⚪ߦ⚪ꕤ⚪ᗱᗴ⚪◯⚪ᗱᗴ⚪ᙁ⚪ᑐᑕ⚪ᴥ⚪ꖴ⚪ᑎ⚪¤⚪ᔓᔕ⚪◯⚪ᗱᗴ⚪ᴥ⚪ᑎ⚪✤⚪ᗩ⚪ᗯ⚪ᴥ⚪ᑎ⚪ᑐᑕ⚪◯⚪ᔓᔕ⚪ᑎ⚪ꖴ⚪⚭⚪ᗩ⚪ꗳ⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪ꗳ⚪ᗩ⚪⚭⚪ꖴ⚪ᑎ⚪ᔓᔕ⚪◯⚪ᑐᑕ⚪ᑎ⚪ᴥ⚪ᗯ⚪ᗩ⚪✤⚪ᑎ⚪ᴥ⚪ᗱᗴ⚪◯⚪ᔓᔕ⚪¤⚪ᑎ⚪ꖴ⚪ᴥ⚪ᑐᑕ⚪ᙁ⚪ᗱᗴ⚪◯⚪ᗱᗴ⚪ꕤ⚪ߦ⚪Ⓞ⚪ИN⚪ᗱᗴ⚪ИN⚪✤⚪ꖴ⚪ᗩ⚪ᙁ⚪◯⚪ᗩ⚪ߦ⚪ᴥ⚪Ⓞ⚪ꕤ⚪ꖴ⚪ᙏ⚪ᗩ⚪✤⚪ꖴ⚪Ⓞ⚪ИN⚪.PY
2024-04-17 19:36:38 +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()