New Microsoft Word Document.docx

  • Uploaded by: sri hari raju
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View New Microsoft Word Document.docx as PDF for free.

More details

  • Words: 132
  • Pages: 3
list = {'Undamped Condition','Underdamped Condition','Critically Damped Condition','Overdamped Condition'}; [indx,tf] = listdlg('ListString',list,'SelectionMode','single'); Code=indx; if eq(Code,1) prompt={'Enter Initial Displacement','Zeta','Spring Cosntant','Mass','Initial Velocity'}; title='Please Input the Following Values'; dims=[1 30]; definput={'5','0.01','500','5','10'}; answer=inputdlg(prompt,title,dims,definput) Initial_Displacement=str2double(answer{1}); Zeta=str2double(answer{2}); Spring_Constant=str2double(answer{3}); Mass=str2double(answer{4}); Initial_Velocity=str2double(answer{5}); Natural_Frequency=sqrt(Spring_Constant/Mass); Time=(0:0.05:6); Disp_Eqn=Initial_Displacement.*cos(Natural_Frequency.*Time) +(Initial_Velocity./Natural_Frequency).*sin(Natural_Frequen cy.*Time); plot(Time,Disp_Eqn) elseif eq(Code,2) prompt={'Enter Initial Displacement','Zeta','Spring Cosntant','Mass','Initial Velocity'}; Title='Please Input the Following Values'; dims=[1 30]; definput={'5','0.01','500','5','10'}; answer=inputdlg(prompt,title,dims,definput) Initial_Displacement=str2double(answer{1}); Zeta=str2double(answer{2}); Spring_Constant=str2double(answer{3}); Mass=str2double(answer{4}); Initial_Velocity=str2double(answer{5}); Natural_Frequency=sqrt(Spring_Constant/Mass); Time=(0:0.5:60); A=Initial_Displacement.*cos(sqrt(1Zeta.*Zeta).*Natural_Frequency.*Time); B=(Initial_Velocity+Zeta.*Natural_Frequency.*Initial_Displa cement)./(sqrt(1-Zeta.*Zeta).*Natural_Frequency);

Disp_Eqn=exp(Zeta.*Natural_Frequency.*Time).*(A+B.*sin(sqrt(1Zeta.*Zeta).*Natural_Frequency.*Time)); plot(Time,Disp_Eqn) elseif eq(Code,3) prompt={'Enter Initial Displacement','Zeta','Spring Cosntant','Mass','Initial Velocity'}; Title='Please Input the Following Values'; dims=[1 30]; definput={'5','0.01','500','5','10'}; answer=inputdlg(prompt,title,dims,definput) Initial_Displacement=str2double(answer{1}); Zeta=str2double(answer{2}); Spring_Constant=str2double(answer{3}); Mass=str2double(answer{4}); Initial_Velocity=str2double(answer{5}); Natural_Frequency=sqrt(Spring_Constant/Mass); Time=(0:0.05:6); Disp_Eqn=(Initial_Displacement+(Initial_Velocity+Natural_Fr equency.*Initial_Displacement).*Time).*exp(Natural_Frequency.*Time); plot(Time,Disp_Eqn) elseif eq(Code,4) prompt={'Enter Initial Displacement','Zeta','Spring Cosntant','Mass','Initial Velocity'}; Title='Please Input the Following Values'; dims=[1 30]; definput={'5','0.01','500','5','10'}; answer=inputdlg(prompt,title,dims,definput); Initial_Displacement=str2double(answer{1}); Zeta=str2double(answer{2}); Spring_Constant=str2double(answer{3}); Mass=str2double(answer{4}); Initial_Velocity=str2double(answer{5}); Natural_Frequency=sqrt(Spring_Constant/Mass); Time=(0:0.5:60); C1=(Initial_Displacement.*Natural_Frequency.*(Zeta+sqrt(Zet a.*Zeta1))+Initial_Velocity)./(2.*Natural_Frequency.*sqrt(Zeta.*Ze ta-1)); C2=(Initial_Displacement.*Natural_Frequency.*(Zeta+sqrt(Zeta.*Z

eta-1))Initial_Velocity)./(2.*Natural_Frequency.*sqrt(Zeta.*Zeta1)); B1=-Zeta+sqrt(Zeta.*Zeta-1); B2=-Zeta-sqrt(Zeta.*Zeta-1); Disp_Eqn=C1.*exp(B1.*Natural_Frequency.*Time)+C2.*exp(B2.*N atural_Frequency.*Time); plot(Time,Disp_Eqn) else f=msgbox('Please Select Any Option'); end

Related Documents


More Documents from "AlexaAndra"

Kl_rahul Html.docx
May 2020 3
Lane Dane
November 2019 41
Fcn Format.docx
October 2019 39