All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
error: without the hold off in line 33 we can\'t get the animation clearly https://www.youtube.com/watch?v=JbXtB-WIv38 clear all close all clc %input Parameters b = 0.2; g = 9.81; l = 1; m = 1; x0 = 0; y0 = 0; % initial condition theta_0 = [1 0]; %time points t_span = linspace(0,20,900); % solve ODE [t, results] = ode45(@(t,theta)…
Gokulkumar M
updated on 27 Dec 2019
error: without the hold off in line 33 we can\'t get the animation clearly
https://www.youtube.com/watch?v=JbXtB-WIv38
clear all
close all
clc
%input Parameters
b = 0.2;
g = 9.81;
l = 1;
m = 1;
x0 = 0;
y0 = 0;
% initial condition
theta_0 = [1 0];
%time points
t_span = linspace(0,20,900);
% solve ODE
[t, results] = ode45(@(t,theta) ode_func(theta,b,g,l,m), t_span, theta_0);
hold on
plot(t,[results(:,1) results(:,2)])
ylabel(\'plot\')
xlabel(\'time\')
theta = results(:,1);
ct = 1;
for i = 1:length(theta)
x = theta(i);
y1 = -l.*cos(x);
x1 = l*sin(x);
plot([x0 x1],[y0 y1],\'color\', \'b\');
hold on
hold off
axis([-1 1 -1 1]);
pause(0.01);
M(ct)= getframe(gcf);
ct=ct+1;
end
movie(M)
videofile = VideoWriter(\'two_arm_robot.avi\',\'Uncompressed AVI\');
open(videofile)
writeVideo(videofile,M)
close(videofile)function [dtheta_dt] = ode_func(theta,b,g,l,m)
theta1 =theta(1);
theta2 =theta(2);
dtheta1_dt = theta2;
dtheta2_dt = -(b/m)*theta2 -(g/l*sin(theta1));
dtheta_dt = [dtheta1_dt; dtheta2_dt];
end
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...
Week 3 - Adiabatic Flame Temperature calculation
Objective: To calculate Adiabatic Flame Temperature for combustion with variation in equivalence ratio, type of fuel, with heat loss using the Newton-Raphson method and Cantera. Theory: Adiabatic flame temperature(AFT): The final temperature of the product, When the combustion takes place…
23 Mar 2021 05:17 AM IST
Week 10 - Simulating Combustion of Natural Gas.
Objective: To simulate the combustion in Ansys fluent with the parametric study. Theory: Combustion is a chemical process during which heat energy is generated. During combustion, the Hydro-carbon and Oxygen combined when a spark is introduced chemical reaction takes…
03 Mar 2021 10:35 AM IST
Week 9 - Parametric study on Gate valve.
Objective: To simulate the Gate valve with different opening positions using parametric study in Ansys fluent. Theory: Flow coefficient: Cv=Q√(SG∇P) where, Q is the rate of flow (expressed in US gallons per minute),…
26 Feb 2021 03:46 PM IST
Week 8 - Simulating Cyclone separator with Discrete Phase Modelling
Objective: To simulate cyclone separator with Discrete Phase Modelling in Ansys fluent. Theory: Empirical models used to calculate the cyclone separator efficiency: 1.Iozia and Leith Model Iozia and Leith logistic model is a modified version of…
24 Feb 2021 02:43 PM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.