• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Adams
  3. How can i assign a matrix/several parameters to a state...

Following Cadence Design Systems’ acquisition of the Design & Engineering (D&E) business, the D&E Community Forum on the Nexus Community Center has been migrated in the Cadence Physical System Simulation Community. For more details and if you have any questions, please refer to the FAQ.

Stats

  • State Verified Answer
  • Replies 5
  • Subscribers 3
  • Views 16
  • Members are here 0
More Content

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

FS
FS over 7 years ago
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.
  • Sign in to reply
  • Cancel
  • Thomas Nygårds
    0 Thomas Nygårds over 7 years ago
    Hi Felix.
    Just a question to understand you better.
     
    Are you importing the Simulink model into Adams as a esl/control system/FMU, or are you running a co-simulation ?
     
    if you are doing an import then you might want to look into paramterized FMUs (available since Adams ~2017.2). If you create a such the parameters you expose appear under the created GSE as design variables.
    Regards
    Thomas
     
     
    Regards
    Thomas
     
     
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • FS
    0 FS over 7 years ago
    Hello Thomas,
     
    I am not quite sure since I am not familiar with english abbreviations but I think it is a FMU. I define my input & output vairable, do a Controls/plant export => get the .m file defining inputs/outputs. Build the simulink model as C-Code into an *.dll and "reconnect" it to Adams as Controls/Control Systems/Import (while redefining the input and output variables).
     
    Unfortunately I have to make use of Adams 2015 though the design variables seam to be exactly what I need (since they do not change no matter how time/inputs change). I know I can still build Design variables in Adams/Car via the Command Navigator even though they aren't shown in the model browser though that still deosn't seam to resolve the issue with having to creat 96 of them for each instance...
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Kent West
    0 Kent West over 7 years ago
    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
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • FS
    0 FS over 7 years ago
    Hi,
     
    I just tried Kents suggestion and adapted the explanation in the 2018version handbook. worked beautifully.
     
    Now I just have to learn how to write a macro loading a property file before the simulation runs and automatically splitting it up to the chosen GSE.
     
    Thank you Thomas and Kent!
    Felix
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • MK202610123211
    0 MK202610123211 over 7 years ago
    No macro needed. Use a simple command file with just one line:
    acar toolkit read property_files assembly = (EVAL(DB_DEFAULT(.system_defaults, "model") ))
     
    Prerequisite:
    Your assembly is the default model. That's the case if it's freshly opened, but it's not the case if you for example modified a subsystem parameter.
     
    If you want do make the command file model specific, then just enter the assembly name. But then you need to change the cmd-file whenever used with a different model.
     
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2026 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information