hexagon logo

How can i assign a matrix/several parameters to a state variable?

I want to connect Adams/Car with a Matlab Simulink model. This does work for me when I set the necessary model/block parameters in Simulink and then build it as C-Code into a *dll which I can import via the plant export feature.
 
Now I'd like to simplify changing the model parameters by feeding them from Adams instead of having to rebuild the dll everytime. The model has 96 parameters so having a state variable for each of them isn't really an option (especially since there can be several instances of them in a template).
 
I'd like to feed a matrix from file which is then applied to a variable and "plant exported". It seams however that state variables aren't allowed to have more than one "channel".
 
Does anybody have some hints on how to achieve my goal?
 
A "dirty" method might be to get a string over to the >Simulinkpart and split it apart there though I'd prefer a cleaner version.
 
Thank you in advance.
Parents
  • Hi Felix,
     
    You can define 'tunable parameters' when you build the code in Matlab. Our Adams Controls documentation has this kind of description, for reference, (v2018, but should work in 2015) about where you find this in the Matlab build procedure:
     
    ===================
    In the Configuration Parameters window that opens, select Optimization Tab.
    3. Under Signals and Parameters, select Inline parameters.
    4. Select Configure.
    5. Highlight Kp and Kv and select Add to Table.
    6. Verify that Storage class is set to SimulinkGlobal(Auto).
    ====================
     
    As Thomas notes: these 'tunable parameters' should show up automatically as Design Variables under the GSE element in Adams.
     
    Hope that works for you!
    Kent
Reply
  • Hi Felix,
     
    You can define 'tunable parameters' when you build the code in Matlab. Our Adams Controls documentation has this kind of description, for reference, (v2018, but should work in 2015) about where you find this in the Matlab build procedure:
     
    ===================
    In the Configuration Parameters window that opens, select Optimization Tab.
    3. Under Signals and Parameters, select Inline parameters.
    4. Select Configure.
    5. Highlight Kp and Kv and select Add to Table.
    6. Verify that Storage class is set to SimulinkGlobal(Auto).
    ====================
     
    As Thomas notes: these 'tunable parameters' should show up automatically as Design Variables under the GSE element in Adams.
     
    Hope that works for you!
    Kent
Children
No Data