Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
3.1 kB
9
Indexable
Never
from math import e

def cells(T,Te_2):
  exp = e
  Tk = T*exp
  Te_3 = Te_2 + 2*Tk
  T_1 = Te_2 - Tk
  Xk = ((2*exp)/(exp-1))*Tk
  T_0 = Te_3 - Xk
  Te = exp*(T_1-T_0)+T_0
  Te_e = exp**exp*(T_1-T_0)+T_0
  Te_32 = (exp**3)*(T_1-T_0)/2+T_0
  return (T_0,T_1,Te,Te_2,Te_3,Te_e,Te_32,Tk)

def cells1(T,Te_2):
  exp = e
  Tk = T*exp
  Tk_1=T
  T_1 = Te_2 - Tk
  Xk_1 = ((2*exp)/(exp-1))*Tk_1
  T_0 = Te_2 - Xk_1
  Te = exp*(T_1-T_0)+T_0
  Te_e = exp**exp*(T_1-T_0)+T_0
  Te_32 = (exp**3)*(T_1-T_0)/2+T_0
  Te_3 = (exp**3)*(T_1-T_0)+T_0
  T
  return (T_0,T_1,Te,Te_2,Te_3,Te_e,Te_32)

fig = go.Figure()
fig.update_layout(
    autosize=False,
    title='Ячейка развития',
    yaxis_title='ln(y)',
    xaxis_title='t',
    width=1200,
    height=650,
    paper_bgcolor="white")
fig.update_yaxes(range=[-0.5, 4], constrain='domain')
fig.update_xaxes(range=[0, 10502], constrain='domain')
fig.add_trace(go.Scatter(x=dates, y=y_log, line=dict(color='darkblue', width=1.5)))
T = 1008
Te_2 = 3739
T_0,T_1,Te,Te_2,Te_3,Te_e,Te_32,Tk = cells(T,Te_2)

print(T_0,T_1,Te,Te_2,Te_3,Te_e,Te_32,Tk)

fig.add_trace(go.Scatter(name="T(e^e)",y=[3.8, 3.8, 3.8, 3.8],x=[T_1,Te_2,Te_2+Tk,Te_3],marker_line_width=2,marker_line_color="black",
                         marker_color="black",marker_size=15,marker=dict(symbol=42),line=dict(color='black', width=2, dash='solid')))

fig.add_annotation(x=T_1+200, y=3.6, text="Xk-3", showarrow=False)
fig.add_annotation(x=Te_2+200, y=3.6, text="Xk-2", showarrow=False)
fig.add_annotation(x=Te_2+Tk+200, y=3.6, text="Xk-1", showarrow=False)
fig.add_annotation(x=Te_3+150, y=3.6, text="Xk", showarrow=False)

fig.add_trace(go.Scatter(name="0",y=[-0.25, 3.8],x=[T_0,T_0],line=dict(color='red', width=2, dash='dot')))
fig.add_annotation(x=T_0+90, y=0,
            text="0",
            showarrow=False)
fig.add_trace(go.Scatter(name="1",y=[-0.25, 3.8],x=[T_1,T_1],line=dict(color='red', width=2, dash='dot')))
fig.add_annotation(x=T_1+90, y=0,
            text="1",
            showarrow=False)
fig.add_trace(go.Scatter(name="T(e)",y=[-0.25, 3.8],x=[Te,Te],line=dict(color='black', width=2, dash='dot')))
fig.add_annotation(x=Te+90, y=0,
            text="e",
            showarrow=False)
fig.add_trace(go.Scatter(name="T(e^2)",y=[-0.25, 3.8],x=[Te_2,Te_2],line=dict(color='black', width=2, dash='dot')))
fig.add_annotation(x=Te_2+190, y=0,
            text="e^2",
            showarrow=False)
fig.add_trace(go.Scatter(name="T(e^3)",y=[-0.25, 3.8],x=[Te_3,Te_3],line=dict(color='black', width=2, dash='dot')))
fig.add_annotation(x=Te_3+190, y=0,
            text="e^3",
            showarrow=False)
fig.add_trace(go.Scatter(name="T(e^3/2)",y=[-0.25, 3.8],x=[Te_32,Te_32],line=dict(color='black', width=2, dash='dot')))
fig.add_annotation(x=Te_32+290, y=0,
            text="e^3/2",
            showarrow=False)
fig.add_trace(go.Scatter(name="T(e^e)",y=[-0.25, 3.8],x=[Te_e,Te_e],line=dict(color='black', width=2, dash='dot')))
fig.add_annotation(x=Te_e+190, y=0,
            text="e^e",
            showarrow=False)
fig.show()