function model = beam_model_demo(q, voltage, Delta_t); % % function model = beam_model_demo(q, voltage, Delta_t); % % Runs the beam model for the voltage excited rod in the CRSC lab, % and returns the model response at the point where the sensor % is located. The inputs are optional, that is the function may % be called as % model = beam_model_demo; % model = beam_model_demo(q); % model = beam_model_demo(q, voltage, Delta_t); % In the first case, the default data set is loaded from the file % input.mat, and default parameters are used. In the second case, % the default data is loaded, but the user supplied parameters are % used in place of the defaults. In the third case, user supplied % parameters and data are used. % % Input Arguments (optional, see above): % q -- vector of parameters, in the following order. The values % given next to the parameter names are their default values, % which are used when a value is not given. % YI_beam -- the young's modulus time moment of inertia for the beam % CI_beam -- the internal damping parameter for the beam. % gamma -- coefficient of air damping % Kp -- coefficient for the voltage input % rho_patch -- linear density for the patch % YI_patch -- Young's modulus times moment of inertia for the patch % CI_patch -- the internal damping parameter for the patch % % Output Argument % model -- model response for the given parameters and voltage input. % % NOTES: % No rho_beam parameter is present in q. Analysis shows that one of the % parameters is redundant. Thus, any one parameter may be fixed with no % loss in generality. rho_beam was chosen, since it is easy to estimate % from known material properties, which helps the other parameters be more % reasonable. % The effects of the patch can be ignored by only giving a four element vector % for q. The patch components will be initialized to 0, which ignores their % contributition. % All units for the parameters are assumed to be base metric, that is % meters, kilograms, Netwons, etc. % % Tom Braun % North Carolina State University % Department of Mathematics/Center for Research in Scientific Computing % May 2005 % if nargin < 1 q = []; end if nargin < 3 load input.mat; end % disallow bad parameters, and fill in missing ones q(q < 0) = 0; if length(q) < 1 q(1) = 0.2; % YI_beam elseif q(1) < 1e-8 q(1) = 1e-8; end if length(q) < 2 q(2) = 7e-6; % CI_beam end if length(q) < 3 q(3) = 1e-3; % gamma end if length(q) < 4 q(4) = 2e-4; % Kp end if length(q) < 7 q(length(q)+1:7) = 0; end rho = [0.072184; q(5); 0]; YI = [q(1); q(6); 0]; CI = [q(2); q(7); 0]; gamma = q(3); Kp = q(4); beamlen = 0.393; patch_loc = [0.041, 0.092]; observe = 0.128; N = 16; model = beam_model(beamlen, rho, YI, CI, gamma, Kp, patch_loc, N, Delta_t, observe, voltage);