79547672

Date: 2025-04-01 03:34:19
Score: 1
Natty:
Report link

from graphviz import Digraph

# Criar o fluxograma da malha fechada de controle

dot = Digraph(format='png')

# Nós do sistema

dot.node('SP', 'Setpoint', shape='parallelogram', style='filled', fillcolor='lightblue')

dot.node('C', 'Controlador', shape='box', style='filled', fillcolor='lightgray')

dot.node('EFC', 'Elemento Final de Controle', shape='box', style='filled', fillcolor='lightgray')

dot.node('P', 'Processo', shape='ellipse', style='filled', fillcolor='lightgreen')

dot.node('S', 'Sensor/Transdutor', shape='parallelogram', style='filled', fillcolor='lightblue')

# Conexões do fluxo de controle

dot.edge('SP', 'C', label='Erro')

dot.edge('C', 'EFC', label='Sinal de Controle')

dot.edge('EFC', 'P', label='Ação no Processo')

dot.edge('P', 'S', label='Medição')

dot.edge('S', 'C', label='Feedback')

# Salvar e visualizar a imagem

fluxo_path = "/mnt/data/malha_fechada.png"

dot.render(fluxo_path, format="png", cleanup=True)

fluxo_path

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: guizin