clear all close all clc b=0.05; g=9.81; l=1; m=1; %initial_con th_0=[0;3]; %time plot tspan=linspace(0,20,500); %solve ode [t,results]= ode45(@(time,theta) ode_func(t,th,b,g,l,m),tspan,th_0); subplot(5,4,[13,14,17,18]); plot(t,results(:,1)) hold on; plot(t,results(:,2)) hold off subplot(5,4,[15,16,19,20]); plot(t,results(:,2));…
Shritej Zemsay
updated on 03 Sep 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 Shritej Zemsay (8)
File parsing project
The objective for this program is to write a function a function that extracts the 14 co-efficients and calculates the enthalpy, entropy and specific heats for all the species in the data file. NASA came up with polynomials that can be used to evaluate thermodynamic properties such as Cp, H and S. They have…
27 Sep 2018 12:50 PM IST
Genetic Algorithm
clear all close all clc x=linspace(0,0.6,150); y=linspace(0,0.6,150); [xx yy]= meshgrid(x,y); for i=1:length(xx) for j=1:length(yy) input(1)=xx(i,j); input(2)=yy(i,j); f(i,j)=stalagmit(input); end end surfc(xx,yy,f) shading interp [inputs, fval]=ga(@stalagmit,2) This program is about solving a global optimization problem.…
17 Sep 2018 12:27 PM IST
Fitting of curve
clear all close all clc %loading data file cp_data= load(\'data1\'); temp= cp_data(:,1); cp=cp_data(:,2); %cp= a*T^2 + b*T +c and a*T^3 + b*T^2 +c*T+d coeff = polyfit(temp,cp,2); predcp= polyval(coeff, temp); coeff1 = polyfit(temp,cp,3); predcp1=polyval(coeff1,temp); %plotting subplot(2,1,[1]); plot(temp, cp,\'linewidth\',3);…
08 Sep 2018 02:15 AM IST
Pendulum ODE
clear all close all clc b=0.05; g=9.81; l=1; m=1; %initial_con th_0=[0;3]; %time plot tspan=linspace(0,20,500); %solve ode [t,results]= ode45(@(time,theta) ode_func(t,th,b,g,l,m),tspan,th_0); subplot(5,4,[13,14,17,18]); plot(t,results(:,1)) hold on; plot(t,results(:,2)) hold off subplot(5,4,[15,16,19,20]); plot(t,results(:,2));…
03 Sep 2018 12:36 PM IST
Air standard cycle
clear all close all clc %inputs g=1.4; t3=2300; %state variables p1=101325; t1=500; %egnine geometry bore=0.1; strk=0.1; cnrod=0.15; cr=12; %swept volume and clearance volume vswept=(pi/4)*bore^2*strk; vclear=vswept/(cr-1); v1=vswept+vclear; v2=vclear; %state 2 p2=p1*cr^g; t2=p2*v2*t1/(p1*v1); cons=p1*v1^g; vcomp=engine_kin(bore,strk,cnrod,cr,180,0);…
01 Sep 2018 11:34 AM IST
Drag force calculations
In fluid mechanics the drag force exerted by the surrounding medium( fluid) plays an important role in motion study. The drag force is calculated by the formula, dragforce=0.5*(density of fluid)*(frontal area)*(velocity)^2*(drag coefficient) 1. Drag force vs velocity function [dragforce]=myf(a,v,rho,cd) dragforce=0.5*a*rho*v.*v.*cd;…
25 Aug 2018 12:11 PM IST
Forward kinematics of a 2R robotic arm
clear all close all clc %inputs l1=1; l2=0.5; th1=linspace(0,90,10); th2=linspace(0,90,10); ct=1; for i=1:length(th1) TH1=th1(i); for j=1:length(th2) TH2=th2(j); x0=0; y0=0; x1=l1*cosd(TH1); y1=l1*sind(TH1); x2=x1+l2*cosd(TH2); y2=y1+l2*sind(TH2); plot([x0 x1],[y0 y1],[x1 x2],[y1 y2],\'linewidth\',3) axis([-0.1…
25 Aug 2018 12:30 AM IST
Creating row and column vectors in MATLAB
%column vector a=[1 2 3 4 5] %row vector a=[1 2 3 4 5]
24 Aug 2018 12:02 PM IST