Main code: %Program to simulate behaviour of a simple pendulum clear all close all clc %inputs b = 0.05; g = 9.81; l = 1; m = 0.1; theta_0 = [0;3]; t_span = linspace(0,20,500); %Using ODE solver ode45 [t,results] = ode45(@(t,theta) ode_func(theta,t,b,g,l,m),t_span,theta_0); %Plotting for i=1:500 thetai = results(i,1) x_cord…
ROHIT SHARMA
updated on 03 Jul 2019
Project Details
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Read more Projects by ROHIT SHARMA (4)
Optimizing the Stalagmite function using Genetic algorithm
Code for optimizing a function to give a global maximum using genetic algorithm. %Stalagmite Mathematical Model clc clear all close all %Setting up the search space x=linspace(0,0.6,150); y=linspace(0,0.6,150); %creating a 2D mesh [xx yy]=meshgrid(x,y); %Calling the stalagmite function for i=1:length(xx) for j=1:length(yy)…
31 Jul 2019 02:51 AM IST
Simulating the transient behaviour of a simple pendulum
Main code: %Program to simulate behaviour of a simple pendulum clear all close all clc %inputs b = 0.05; g = 9.81; l = 1; m = 0.1; theta_0 = [0;3]; t_span = linspace(0,20,500); %Using ODE solver ode45 [t,results] = ode45(@(t,theta) ode_func(theta,t,b,g,l,m),t_span,theta_0); %Plotting for i=1:500 thetai = results(i,1) x_cord…
03 Jul 2019 10:48 AM IST
Air standard cycle
Code : %Plotting PV diagram of Otto cycle and Calculating thermal efficiency %Inputs: t1 = 400; p1 = 101325; gamma = 1.4; t3 = 2200; %Engine dimesions bore = 0.1; stroke = 0.15; con_rod = 0.2; cr = 8; %Swept and Clearance volume v_swept = pi/4*bore^2*stroke; v_clearance = v_swept/(cr-1); v1= v_swept+v_clearance;…
28 Jun 2019 09:16 AM IST
Forward Kinematics of a 2R Robotic Arm
Code: %Forward kinematics of a 2R robotic arm close all clear all clc % Input parameters l1=1.5; l2=0.75; x0=0; y0=0; % Angles theta1= linspace(0,90,10); theta2= linspace(0,90,10); %counter ct = 1; %for loop for i= 1:length(theta1) theta_1 = theta1(i); for j=1:length(theta2) theta_2 = theta2(j); x1_cord = l1.*cosd(theta_1);…
16 Jun 2019 02:55 AM IST