I have a pipe with different insulation sections and a fluid flowing through. I need to calculate the fluid Temperature at the end of every section, to estimate the temperature for the next section. I build my Model with Modules, the equations stay quite the same, but the characteristics (variables) for my insulation varies.
For example the Thermal Diffusivity α=λ/(ρ *cp)
, changes per section. So i dont want to rewrite a Module for every single section. I just want a single Module to call up a Table for the specific section (for simplicitiy and preventing errors). My issue is that the variables i set, are global and hence i have to build many modules and rename my variables. Is there a possibiliy to set same variables, but different value?
Is it also possible to set a single Matrix with rows i call up, which represent each section?
For example:
m=Matrix[Section1{λ=1,cp=2,ρ=3},Section2{λ=4,cp=5,ρ=6},Section3{λ=7,cp=8,ρ=9}]
S1[i1_, m_] := Module[{ α=λ/(ρ *cp)}]
S2[i2_, m_] := Module[{ α=λ/(ρ *cp)}]
Thank you in advance
MatrixForm
rang some alarm bells with me. This tells me that you got something fundamentally wrong about its purpose: It is for displaying only. It is not meant as a datatype. $\endgroup$