Code covered by the BSD License  

Highlights from
Speeding Up Optimization Problems with Parallel Computing

image thumbnail

Speeding Up Optimization Problems with Parallel Computing

by

 

Files from the webinar: Speeding up optimization problems with parallel computing

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

runSimModel(x,simParms,ii)
function [Zdotdot,thetadotdot,rf,rr] = runSimModel(x,simParms,ii)

% Copyright 2010 The MathWorks, Inc.

%% Unpack simParms sturcutre for Simulink Use
struct2var(simParms)

%% Extract suspension variables
kf = x(1); cf = x(2);
kr = x(3); cr = x(4);

%% Change the model parameters due to mass distribution change
Iyy = mcIyy(ii);
Mb  = mcMb(ii);
Lf  = mcLf(ii);
Lr  = mcLr(ii);
rf  = mcrf(ii);
rr  = mcrr(ii);
rt  = mcrt(ii);

%% Initial Conditions for Simulink Model
theta0 = 0;                 % initial pitch (rad)
thetadot0 = 0;              % initial pitch rate (rad/s)
Z0 = -0.5*Mb*g/(kf+kr);     % initial equilibrium position, assumes full car (m)
Zdot0 = 0;                  % initial bounce rate (m/s)
simTime = [0 8];
sim('mldemo_suspnfast.mdl',simTime,simset('SrcWorkspace', 'current', 'DstWorkspace', 'current'));

Contact us