Section 1 The genetic algorithm is a method (function in MATLAB) for solving both constrained and unconstrained optimization problems that is based on Charles Darwin\'s Theory of Natural Selection, which says the fittest among the group survives. GA generates a number of points at each iteration. The best point in the…
Venkatesan Krishnamurthy
updated on 02 Jun 2018
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 Venkatesan Krishnamurthy (12)
Data Analysis using Python
Code for data analysis import matplotlib.pyplot as plt import math import numpy as np try: #Try-Except Syntax. If an error is found in TRY it runs the EXCEPT command file = open(\'engine_data.out\',\'r\') except: print(\' >>> File cannot be recognized. Please check again <<< \') value=[] for line in file:…
02 Aug 2018 03:23 AM IST
Curve fitting using Python
1: Popt gives the optimal values of the co-efficients present in the polynomial Pcov gives the the estimated covariance of the corresponding popt 2: np.array(temperature) is used to convert the temperature into an array therefore able to be multiplied with the coefficients…
20 Jul 2018 09:39 AM IST
Air standard cycle Otto Cycle in Python
Python program to display PV diagram of OTTO CYCLE/ Air Standard Cycle # Otto Cycle import matplotlib.pyplot as plt import math as m import numpy as np # Inputs gamma = 1.4 t3 = 2250 # State variables at Stage 1 p1 = 101325 t1 = 600 # Engine geometric parameters bore = 0.25 stroke = 0.25 con_rod = 0.2 cr = 12 def engine_kinematics(bore,stroke,con_rod,cr,start_crank,end_crank):…
28 Jun 2018 03:25 AM IST
2R Robotic Arm Simulator using Python
Youtube link: https://youtu.be/b9Jhyk6Zqbw # forward kinematics animation import matplotlib.pyplot as plt import math as m import numpy as np import os # Inputs l1 = 2 l2 = 1 x0 = 0 y0 = 0 theta1 = np.linspace(0,(m.pi/2),10) theta2 = np.linspace(0,(m.pi/2),10) count =1 os.makedirs(\'2r_robot_images\') os.chdir(\'C:/Users/Venki_LFC/Documents/Study/Python/2r_robot_images\')…
22 Jun 2018 03:15 AM IST
Drag Force Python
This program results in two graph outputs. 1.Drag force vs Velocity ( Co-efficient is constant, velocity varies) 2.Drag Force vs Drag Coefficient (Velocity is constant, Drag Coefficient varies) The Drag force vs Velocity Graph shows that for increasing velocity the force increases exponentially since velocity^2 is…
20 Jun 2018 03:37 AM IST
Simulation of 2R Robotic Arm
The following code is used to simulate the forward kinematics of a 2R Robotic arm. I used Gif online maker to animate. Youtube Link: https://youtu.be/NHFgr_p3Ims % forward kinematics clc close all clear all l1 = 2; l2 = 1; x0 = 0; y0 = 0; theta1 = linspace(0,90,10); theta2 = linspace(0,90,10); count =1; for i= 1:length(theta1)…
19 Jun 2018 01:11 AM IST
Parsing NASA thermodynamic data
NASA FILE PARSING The following codes are used to parse the thermo30.dat file and extract the values used for calculating the entropt, enthalpy, specific heat and molecular weights of several compounds. Then they are plotted vs temperature. Main program clear all close all clc file = fopen(\'thermo30.dat\',\'r\'); head1…
12 Jun 2018 04:58 AM IST
Genetic Algorithm
Section 1 The genetic algorithm is a method (function in MATLAB) for solving both constrained and unconstrained optimization problems that is based on Charles Darwin\'s Theory of Natural Selection, which says the fittest among the group survives. GA generates a number of points at each iteration. The best point in the…
02 Jun 2018 03:18 AM IST
Code for Curve Fitting - Linear and Cubic
Code for Curve Fitting - Linear and Cubic clear all close all clc % Data Preparation cp_data = load(\'data_hw\'); temp = cp_data(:,1); cp = cp_data(:,2); % Curve fit co_eff_linear = polyfit(temp,cp,1); co_eff_cubic = polyfit(temp,cp,3); predicted_cp_linear = polyval(co_eff_linear,temp); predicted_cp_cubic = polyval(co_eff_cubic,temp);…
30 May 2018 04:31 AM IST
Simple Pendulum simulation using second order ODE
Simple Pendulum Problem Youtube Link: https://youtu.be/ADz-aGrM5Gk clear all close all clc b = 0.5; g = 9.81; l = 1; m = 1; % Initial Condition theta_0 = [0;3]; % Time points t_span = linspace(0,20,500); % Solve ODE [t,results] = ode45(@(t,theta) ode_func(t,theta,b,g,l,m),t_span,theta_0); figure(1) plot(t,results(:,1))…
29 May 2018 05:35 AM IST
Otto Cycle - PV diagram and Cycle efficiency calculator
OTTO CYCLE (PV and efficiency) clc close all clear all % Inputs gamma = 1.4; t3 = 2250; % State variables at Stage 1 p1 = 101325; t1 = 600; % Engine geometric parameters bore = 0.25; stroke = 0.25; con_rod = 0.2; cr = 12; % Swept volume and clearance volume v_swept = (pi/4)*bore^2*stroke; v_clear = v_swept/(cr-1); v1 =…
25 May 2018 12:25 AM IST
Drag Force for multiple velocity inputs and multiple drag coefficient inputs
1. Code for Drag Force vs Velocity Graph (Drag coefficient being constant) % Calculation of Drag Force clear all close all clc % Inputs density = 1.35; % the value of density (kg/m^3) area = 5; % the value of frontal area (m^2) vel = [20:45]; % the value of velocity (m/s) cd = 0.5; % Constant drag coefficient % Drag Force…
21 May 2018 12:59 AM IST