You are on page 1of 1

clc

clear all
close all
% Define the system in Figure 2.1
Sys_eqn = "DV = (r/(A+m*r^2))*(Tin-r*c*V)"
%solve the equation without initial condition
V = dsolve(Sys_eqn, "t")-------Primer codigo.
% Include the initial condition V(0) = 0
V = dsolve(Sys_eqn, "v(0)=0", "t")
%Defining the numerical values
r = 0.1; m = 0.75; Tin = 1.25;
c = 0.65; A = 0.5*m*r^2;
%Creating the numerical solution for math calculations
V = subs(V)
%Define the t vector, 0 to 10 sec
t = linspace (0,10,200);
%Making V suitable for plot
V_plot = eval(vectorize(V));
%finally plot it
figure
hold on
plot(t, V_plot)
grid on
xlabel("time [sec]")
Xlabel("rack velocity [m/s])
hold off

You might also like