{"id":189587,"date":"2025-02-10T05:28:02","date_gmt":"2025-02-10T05:28:02","guid":{"rendered":"https:\/\/learnexams.com\/blog\/?p=189587"},"modified":"2025-02-10T05:28:05","modified_gmt":"2025-02-10T05:28:05","slug":"use-the-matlab-code-of-lsim-to-compute-the-relative-displacement-through-this-linearized-model-with-keff-and-%ce%b6eff","status":"publish","type":"post","link":"https:\/\/www.learnexams.com\/blog\/2025\/02\/10\/use-the-matlab-code-of-lsim-to-compute-the-relative-displacement-through-this-linearized-model-with-keff-and-%ce%b6eff\/","title":{"rendered":"Use the MATLAB code of \u201clsim\u201d to compute the relative displacement through this linearized model with keff and \u03b6eff"},"content":{"rendered":"\n<p>Use the MATLAB code of \u201clsim\u201d to compute the relative displacement through this linearized model with keff and \u03b6eff, with the El Centro ground acceleration (E-W) as the excitation. The unit of the mass, damping, and stiffness is kg, N\/m s, and N\/m, respectively.<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-ast-global-color-6-color\"><strong>The Correct Answer and Explanation is :<\/strong><\/mark><\/p>\n\n\n\n<p>To compute the relative displacement using the MATLAB <code>lsim<\/code> function for a linearized model with effective stiffness (<code>keff<\/code>) and effective damping (<code>\u03b6eff<\/code>), where the excitation is the El Centro ground acceleration (E-W), follow these steps:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">MATLAB Code Implementation<\/h3>\n\n\n\n<p>Here is an example of how to implement the code using the <code>lsim<\/code> function:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>% Given Parameters\nm = 1000;             % mass in kg\nkeff = 50000;         % effective stiffness in N\/m\nzeta_eff = 0.02;      % effective damping ratio\nground_acc = load('elcentro.txt');  % Ground acceleration (El Centro E-W)\ntime = ground_acc(:, 1);           % Time vector from El Centro data\nacceleration = ground_acc(:, 2);   % Ground acceleration (E-W)\n\n% Compute the undamped natural frequency (wn) and damping coefficient (c)\nwn = sqrt(keff \/ m);               % Natural frequency (rad\/s)\nc = 2 * zeta_eff * wn * m;         % Damping coefficient (N*s\/m)\n\n% Define the system (mass-spring-damper)\nA = &#91;0 1; -keff\/m -c\/m];\nB = &#91;0; 1\/m];\nC = &#91;1 0];\nD = 0;\n\n% Use the lsim function to compute the relative displacement\n&#91;y, t, x] = lsim(A, B, C, D, acceleration, time);\n\n% Plot the relative displacement\nplot(t, y)\ntitle('Relative Displacement Response to El Centro E-W Ground Motion')\nxlabel('Time (s)')\nylabel('Relative Displacement (m)')<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Explanation:<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Mass, Stiffness, and Damping:<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>m<\/code> is the mass in kilograms (kg).<\/li>\n\n\n\n<li><code>keff<\/code> is the effective stiffness in Newtons per meter (N\/m).<\/li>\n\n\n\n<li><code>\u03b6eff<\/code> is the effective damping ratio, a dimensionless quantity representing energy dissipation in the system.<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Ground Acceleration Input:<\/strong><br>The El Centro ground acceleration (E-W direction) is stored in a file (e.g., <code>elcentro.txt<\/code>). This file should contain time and ground acceleration data, where the second column represents the ground acceleration at each time step.<\/li>\n\n\n\n<li><strong>System Representation:<\/strong><br>The system is modeled as a mass-spring-damper system. The state-space matrices <code>A<\/code>, <code>B<\/code>, <code>C<\/code>, and <code>D<\/code> represent the state-space form of the system, which is used in the <code>lsim<\/code> function.<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The matrix <code>A<\/code> contains the dynamics of the system (mass and damping).<\/li>\n\n\n\n<li>The matrix <code>B<\/code> describes how the input (ground acceleration) affects the system.<\/li>\n\n\n\n<li>The matrix <code>C<\/code> is used to output the relative displacement, and <code>D<\/code> is the direct transmission term (set to 0 in this case).<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Solving the Equation:<\/strong><br>The <code>lsim<\/code> function simulates the time response of the system (<code>y<\/code>, relative displacement) to the El Centro ground acceleration. The <code>t<\/code> variable holds the time vector, and <code>x<\/code> contains the system&#8217;s state variables (e.g., velocity and displacement).<\/li>\n\n\n\n<li><strong>Plotting the Results:<\/strong><br>The relative displacement is plotted over time, showing how the structure responds to the seismic excitation.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion:<\/h3>\n\n\n\n<p>The <code>lsim<\/code> function in MATLAB provides an effective way to simulate the response of a mass-spring-damper system subjected to ground excitation. By defining the system parameters (mass, stiffness, and damping), the ground motion, and the appropriate system matrices, you can calculate the relative displacement of the structure during an earthquake event. This method is particularly useful in engineering to assess how buildings or structures react to seismic activities.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Use the MATLAB code of \u201clsim\u201d to compute the relative displacement through this linearized model with keff and \u03b6eff, with the El Centro ground acceleration (E-W) as the excitation. The unit of the mass, damping, and stiffness is kg, N\/m s, and N\/m, respectively. The Correct Answer and Explanation is : To compute the relative [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[25],"tags":[],"class_list":["post-189587","post","type-post","status-publish","format-standard","hentry","category-exams-certification"],"_links":{"self":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts\/189587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/comments?post=189587"}],"version-history":[{"count":0,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts\/189587\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/media?parent=189587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/categories?post=189587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/tags?post=189587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}