I’m simulating a multibody vehicle model. Within this model I’m using nonlinear dampers – damper subsystem reads the damper velocity vector and damper force vector from base workspace. Force and velocity vectors are defined via live script which uses base workspace variables for “low speed” compression damping, “high speed” compression damping, blow off velocity (damper velocity at which it “switches” to “high speed” damping curve etc.
fDeltab=fDbl(end)-fDbhi(1);
fDeltar=fDrl(1)-fDrhi(end);
F_vDamper=[fvr,fvb(2:end)]
F_fDamper=[fDrh,fDrl(2:end),fDbl(2:end),fDbh(2:end)]
Damper.NonLinear.Faxle.vDamper.Value=F_vDamper;
Damper.NonLinear.Faxle.fDamper.Value=F_fDamper;
In the Model Callbacks (InitFcn) I call this above-mentioned Live script to update damping force and velocity vectors according to current values (base workspace) of above-mentioned variables.
My problem is that I can’t figure out how I can do damping parameter sweeps… i.e. how can I set up the model so that it runs multiple simulations and changes damping related variables (base workspace) according to some predefined list. It works fine if I would be changing/sweeping any of model block parameters or variables that are mentioned within block. In this particular case it’s an array with values calculated via script. If I setup design study from multiple simulations panel – it doesn’t effect variables in base workspace that would effect the script that calculates required vectors.
I’ve tried to use matlab function that would use this script to create required vectors and assign it to base (or model) workspace but it doesn’t work or better say I don’t know how to do it properly.
Any suggestions would be very highly appreciated.
Thank you.
Ted