Code covered by the BSD License  

Highlights from
SDamala Toolbox

image thumbnail

SDamala Toolbox

by

 

Dynamical systems Toolbox, for simulation and analysis dynamical systems deterministic

[T,Res]=tc_explyapunov(f,to,dt,tf,ystart,ioutp)
function [T,Res]=tc_explyapunov(f,to,dt,tf,ystart,ioutp)

syms x t
ja=jacobian(sym(f),x);    % Hallando la matrix jacobiana del sistema
% fila 1
p1=char(ja(1,1));
m11=p1;
matrizj=strcat('Jac=[',m11,'];\n' );    
fid = fopen('funcion_ext.m', 'w');   
fprintf(fid,'function f=funcion_ext(t,X)\n');
fprintf(fid,'x=X(1);\n');             
fprintf(fid,'Y=X(2); \n');
fprintf(fid,'f=zeros(2,1);\n');
f1=strcat('f(1)=',char(f),';\n');
fprintf(fid,f1); 
fprintf(fid,matrizj);
fprintf(fid,'f(2)=Jac*Y;');
fclose(fid); 
n=1;
[T,Res]=lyapunov(n,@funcion_ext,@ode45,to,dt,tf,ystart,ioutp);

Contact us