
How can I add a constant to a variable during a simulation in Simulink?
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I want to make the percentage of one variable. The operation is (initial value - final value)/ initial value. The initial value is a constant (2.646) and the final value is changing over time. I have performed the calculation with blocks shown below, but it cannot be solved because initial value is a constannt and final value changes over time.
So my question is, how can I make this operation in Simulink?

Thanks
0 comentarios
Respuestas (1)
Mathieu NOE
el 23 de Mzo. de 2022
hello
I had no particular problem doing the same simulink model and running it . what is your issue ??
NB : you post that the initial value is a constant (2.646) and in your simulink model is 0.2646.
attached my model fyi
the variable (final) value is a sinus of amplitude 1
the plot shows that this generates a variation of +/- 40 % around 100%

2 comentarios
Mathieu NOE
el 8 de Abr. de 2022
hello
I don't think we have a problem with out.TOCb because this is a "To Worspace" block
your error message deals with a "From Worspace" block.
'DosageAllCodesnewklak6k8/[Ci]0 Initial concentration of component i inside the reactor, mmol//L/From Workspace3'.
This block needs to be initialized with a 2 column array (time and data)
The faulty block should be highlighted in yellow in you simulink file
Ver también
Categorías
Más información sobre General Applications en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
