Attribution Non-Commercial (BY-NC)

38 views

Attribution Non-Commercial (BY-NC)

- Business21 Instantaneous Rate of Change
- 0625_y14_sq_191114
- Chapter 2 Force and Motion TEACHER's GUIDE
- 0580_w05_qp_2
- GCE Examinations
- Newton's Second Law
- Chapter 2 Force and Motion TEACHER's GUIDE
- Jsu Physics Mid Year Exam Form 4 2013
- P3 Upper Six
- HW10S
- stoichometry
- Mot in 1 D
- M2_ALL_SOLOMON_PAPERS
- Fuel_Plan
- Chapter3 Linear Motion
- Lab Manual: Air Track Newton 2nd Law (Uniform Acceleration in Linear Motion)
- Ch.3 Linear Motion (Daily Test)1
- Final Report Group 1
- Motion
- 15~chapter_13_engineering_kinematics

You are on page 1of 10

function dXdt=mass_spring(t,X) M=705; % (Kg) B=30; % (Nsec/m) Fa=300; % (N) K=15; % (N/m) r=1; % dX/dt dXdt(1,1)=X(2); % Speed dXdt(2,1)=-B/M*X(2)-K/M*X(1)^r+Fa/M; % Displacement % Program code clear all close all clc X0=[0;0];% (Initial speed and position) [t,X]=ode45('mass_spring',[0 200],X0); figure; plot(t,X(:,1)); xlabel('Time(t)'); ylabel('Speed'); title('Mass spring system'); legend('Speed'); grid; figure; plot(t,X(:,2),'r'); xlabel('Time(t)'); ylabel('Position'); title('Mass spring system'); legend('Position'); grid on;

Question # 2: Plot the position and the speed in separate graphs when value of r = 2 & 3.

Source code same as previous with value of r = 2 & 3 When r = 2,

When r = 3,

Question # 3:

Superpose the results and compare with the linear case r=1 and plot all three cases in the same plot window.

Source code: Function 1:

function dXdt=mass_spring(t,X) M=705; % (Kg) B=30; % (Nsec/m) Fa=300; % (N) K=15; % (N/m) r=1; % dX/dt dXdt(1,1)=X(2); % Speed dXdt(2,1)=-B/M*X(2)-K/M*X(1)^r+Fa/M; % Displacement

Function 2:

function dXdt=mass_spring2(t,X) M=705; % (Kg) B=30; % (Nsec/m) Fa=300; % (N) K=15; % (N/m) r=2; % dX/dt dXdt(1,1)=X(2); % Speed dXdt(2,1)=-B/M*X(2)-K/M*X(1)^r+Fa/M; % Displacement

Function 3:

function dXdt=mass_spring3(t,X) M=705; % (Kg) B=30; % (Nsec/m) Fa=300; % (N) K=15; % (N/m) r=3; % dX/dt dXdt(1,1)=X(2); % Speed dXdt(2,1)=-B/M*X(2)-K/M*X(1)^r+Fa/M; % Displacement %program coding clear all close all clc X0=[0;0];% (Initial speed and position) [t,X]=ode45('mass_spring',[0 200],X0); plot(t,X(:,1)); xlabel('Time(t)'); ylabel('Speed'); title('Mass spring system'); hold; X0=[0;0];% (Initial speed and position) [t,X]=ode45('mass_spring2',[0 200],X0); plot(t,X(:,1),'g'); hold on; X0=[0;0];% (Initial speed and position) [t,X]=ode45('mass_spring3',[0 200],X0); plot(t,X(:,1),'r'); legend('r = 1','r = 2','r = 3');

grid on; figure; X0=[0;0];% (Initial speed and position) [t,X]=ode45('mass_spring',[0 200],X0); plot(t,X(:,2),'-'); xlabel('Time(t)'); ylabel('Position'); title('Mass spring system'); hold on; X0=[0;0];% (Initial speed and position) [t,X]=ode45('mass_spring2',[0 200],X0); plot(t,X(:,2),'g'); hold on; X0=[0;0];% (Initial speed and position) [t,X]=ode45('mass_spring3',[0 200],X0); plot(t,X(:,2),'r'); grid on; legend('r = 1','r = 2','r = 3'); title('Mass spring system');

Compare the results and describe the effects. Answer: Source code and functions are same as question just values are changed. Changing the value of mass M,

- Business21 Instantaneous Rate of ChangeUploaded bymarchelo_chelo
- 0625_y14_sq_191114Uploaded bymydadawalfn
- Chapter 2 Force and Motion TEACHER's GUIDEUploaded byhermanwong
- 0580_w05_qp_2Uploaded byMohammedKamel
- GCE ExaminationsUploaded byJimlon0
- Newton's Second LawUploaded bySarah Zack
- Chapter 2 Force and Motion TEACHER's GUIDEUploaded byhermanwong
- Jsu Physics Mid Year Exam Form 4 2013Uploaded bySiti Nur Dalila
- P3 Upper SixUploaded bysagarnitishpirthee
- HW10SUploaded byMarco Conopio
- stoichometryUploaded bykarandeep Singh
- Mot in 1 DUploaded bySrikar Varadaraj
- M2_ALL_SOLOMON_PAPERSUploaded byprofitmaker_2
- Fuel_PlanUploaded bySalazar Santiago
- Chapter3 Linear MotionUploaded bysharma balwant
- Lab Manual: Air Track Newton 2nd Law (Uniform Acceleration in Linear Motion)Uploaded byNorline Petin
- Ch.3 Linear Motion (Daily Test)1Uploaded byTreeicicles
- Final Report Group 1Uploaded byrayquaza_hyperbeam6916
- MotionUploaded byRajeev Gangwar
- 15~chapter_13_engineering_kinematicsUploaded byAhmedMahir
- lp3Uploaded byGina More Dee
- Ratio, ProportionsUploaded byChethan Acharya
- Chapter 5 - In Review (5 Out of 15)Uploaded byRuel Cedeño
- reference sheet physical scienceUploaded byapi-331322403
- M1Jan07QUploaded byDikran Malatjalian
- Admit CardUploaded byTalha Siddiqui
- 8-5 josh ryan cheryl monster truck explosionUploaded byapi-395383792
- 5054_w09_qp_2Uploaded byG M Ali Kawsar
- Nuevo Documento de Microsoft WordUploaded byEder Ch G

- EXPERIMENT at NIT, RaipurUploaded byPalashCollege
- Tarea de Ciclo de Refrigeracion y Maquinas Termicas (2)Uploaded byRenzo Alexander Restrepo
- Computational Neuroscience CW1 (Bristol)Uploaded bylibannf
- Basic Surgical Skills Pauline 1Uploaded bypauline
- 0625_w11_qp_61Uploaded byHaider Ali
- AssignmentUploaded byChinnadurai Lakshmanan
- Keyboard Shortcuts in Word for Mac - Word for MacUploaded byAnonymous FXsb2M
- Pankaj SeminarUploaded bymahesh kale
- grade 6 unit 5 mini touchstone - g 4Uploaded byapi-302577842
- Optical system for hydrogenerator monitoringUploaded byPit Sampras
- finalpractice-f15Uploaded byUpeksha Perera
- MELJUN_CORTES_2005_csci20_algorithm Analysis and DesignUploaded byMELJUN CORTES, MBA,MPA
- Saito_EKT 241 3 ELECTROSTATICS(Dielectrics CapacitancUploaded byHFdzAl
- UT Dallas Syllabus for math3305.502 06f taught by Thomas Butts (tbutts)Uploaded byUT Dallas Provost's Technology Group
- Knowledge Base Syndication WidgetUploaded byapi-14433492
- Copper Nanoparticles Mediated by ChitosanUploaded byKaskus Fourus
- Fluid Mechanics LabUploaded bybeenilicious
- Rotation of PlatformsUploaded byNikita Yadav
- Power Team Predator Air Pumps - CatalogUploaded byTitanply
- 5-PDAUploaded byKedarnath Jakka
- Principles of Mode S Operation and Interrogator Codes 2Uploaded bySameh Elnemais
- Papper2Uploaded byVarghese Mathew
- California Tax Board: CA568 BE efile BusRules2006v3Uploaded byTaxman
- Influence of Ultrasonic Stress Relief on Stainless Steel 316 Specimens_ a Comparison With Thermal Stress ReliefUploaded byFatih Hayati Çakır
- Swelling Pressure and Uplift of PilesUploaded byTuroy
- Elecon PlanetoryGearBox-BucketWheelDriveUploaded bymayur
- Ground Enhancement Material Earthing Compound Backfill CompoundUploaded byAmiableimpex
- Bha ComponentsUploaded byMEUBRO
- DiNi User Guide 57345002 Ver4 ENGUploaded bycristianmicha2
- EQLGuideUploaded bySrinivas Kankanampati