Another Way to Use Lookup Table in Simscape Custom Models

5 次查看(过去 30 天)
Hello,
I am using a lookup table for one of my components. The thing is I want to have the ability to select a point from two parameters with set of values that I set as a parameter to be used later on in a lookup table function. I tried to do a lookup table to select the point, but I found out that lookup table requires a monometric parameter.
parameters
G_op = { 1e-7 , 'S' };
G_ct = {[0.5144e3,0.4629e3,0.3861e3,0.3636e3,0.31904e3,0.2899e3,0.2578e3,0.2012e3],'S'} %Cl Con
T_ra= {[0,25,50,75,100,125,150,175],'degC'} %Temp ref
Time_unitary = {(0:0.01:1),'1'};
Ton = {2e-6, 's'};
Toff = {1e-7, 's'};
end
variables
G = {1e4, 'S'};
G_closed = {1e4,'S'};
Opening_instant = {0,'s'};
end
equations
G_cl ==(tablelookup(T_rate,G_ctable,Temp, interpolation=linear, extrapolation=nearest));
G == (tablelookup(Time_unitary*Toff,(Switch_Dynamic.^log(G_op/G_cl))*G_cl/Con, time-Opening_instant, interpolation=linear, extrapolation=nearest)+1e-9)*Con;
end
These are some of the code that has the parameters related to the lookup table that I want to create.
I was thinking of using a polynomial approach for the G_cl value but in the end it was not working as it was also read as a parametric value by the lookup table of the variable G.
Is there any other way to have the data set for G_ct and T_ra to have one point to be use for the table lookup without detected as parametric?
Thank you beforehand.

回答(1 个)

Shreshth
Shreshth 2024-1-8
Hello Anugerah,
In the context of your code provided, I could see that you are trying to use two parametersG_ct and T_ra to determine a single point for use in a lookup table G_cl.Currently you are using the 1D lookup table function which will only allow you to have a single dimensional lookup. To solve your issue it is recommended to use a 2D Lookup table that maps combinations of G_ct and T_ra to G_cl values. You would then use a 2D interpolation method to find the value of G_cl for any given G_ct, T_ra pair.
To grab an understanding of the use of 2D lookup table, you can also refer to the documentation provided by MathWorks.
Additionally, if you do not want to use 2D lookup table, you can also create a mapping function if the relationship between G_ct, T_ra, and G_cl can be described by a mathematical function, you could define this function explicitly in your code. This function would take G_ct and T_ra as inputs and output the corresponding G_cl value.
Hope it helps.
Thank you,
Shubham Shreshth.

类别

Help CenterFile Exchange 中查找有关 Simscape Electrical 的更多信息

产品


版本

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by