ejemplos de optimizacion matlab

4
DIEGO ALEJANDRO DIAZ – C.C. 1010188643 1). Vehiculo: function dx= vehiculo(t,x) mb=250; mw=50; k1=16000; k2=160000; cs=1500; Zr=0; fa=0.2; dx=zeros(4,1); dx(1)= x(2); dx(2)= - 1/mb*(k1*(x(1) - x(3)) + cs*(x(2) - x(4)) - fa); dx(3)= x(4); dx(4)=1/mw*(k1*(x(1) - x(3)) + cs*(x(2) - x(4)) - k2*(x(3) - Zr) - fa); -- clc close all clear all ti=0; tf=20; [t,x] = ode45('vehiculo',[ti tf],[0 0 0 0]); plot(t,x(:,1), t,x(:,3))

description

ejemplos de optimizacion en problemas. codigo de matlab.1 - simulacion del comportamiento de una suspension de un vehiculo2 - simulacion de un motor DC3 - simulacion de movimiento de un seguidor de linea

Transcript of ejemplos de optimizacion matlab

Page 1: ejemplos de optimizacion matlab

DIEGO ALEJANDRO DIAZ – C.C. 1010188643

1).

Vehiculo:

function dx= vehiculo(t,x)mb=250;mw=50;k1=16000;k2=160000;cs=1500;Zr=0;fa=0.2;dx=zeros(4,1);dx(1)= x(2);dx(2)= - 1/mb*(k1*(x(1) - x(3)) + cs*(x(2) - x(4)) - fa);dx(3)= x(4);dx(4)=1/mw*(k1*(x(1) - x(3)) + cs*(x(2) - x(4)) - k2*(x(3) - Zr) - fa);

--

clcclose allclear allti=0;tf=20;[t,x] = ode45('vehiculo',[ti tf],[0 0 0 0]);plot(t,x(:,1), t,x(:,3))

Page 2: ejemplos de optimizacion matlab

2).

Motor DC

function dx = motordc(t,x)Vi=5;Ii=16.2;Ri=0.6;li=0.0012;Kb=1.8;Kp=0.4;J=1;B=0.2287;dx=zeros(2,1);dx(1)=(Kp*x(2) - Ii - B*x(1))/J;dx(2)=(Vi - Kb*x(1)-Ri*x(2))/Ii;

--

clcclose allclear allti=0;tf=100;[t,x] = ode45('motordc',[ti tf],[0 0]);plot(t,x(:,2))

Page 3: ejemplos de optimizacion matlab

3).

VELOCISTA

function dx = velocista(t,x)L=0.15;K=0.05;R=0.05;ra=0.011;vm=5;J=10;U=1;B=0.95;dx=[0;0;0;0;0];dx(1)=(vm/L) + (U/L) - ((R*x(1))/L) - ((K*x(2))/L);dx(2)=((K*x(1))/J) - ((B*x(2))/J); dx(3)=(vm/L) - (U/L) - ((R*x(3))/L) - ((K*x(4))/L);dx(4)=((K*x(3))/J) - ((B*x(4))/J); dx(5)= (x(4)*(2*pi*ra)) - (x(2)*(2*pi*ra));

--

clcclose allclear allti=0;tf=200;[T,X] = ode45('velocista',[ti tf],[0 0 0 0 0]);plot(T,X(:,2),'-',T,X(:,4),'-')