#*--------------------------------------------------------------------- * This file is property of the author and cannot be used, copyed * or modified without permission. * * Copyright (C) 2002-2004 the author *---------------------------------------------------------------------- * Author: Rafael de Pelegrini Soares * $Id: sample_pend.mso 48 2006-11-10 13:09:07Z rafael $ *---------------------------------------------------------------------- * * EMSO sample file. * * FlowSheet with the Model for the index three pendulum * in Cartesian coordinates. * *--------------------------------------------------------------------*# using "types.mso"; FlowSheet pend PARAMETERS g as acceleration (Brief = "Gravity acceleration"); L as length (Brief = "Pendulum cable length"); VARIABLES x as length_delta(Brief="Position x"); y as length_delta(Brief="Position y"); w as velocity(Brief = "Velocity for x"); z as velocity(Brief = "Velocity for y"); T as Real(Brief = "Tension on cable",Default=10,Unit="1/s^2"); EQUATIONS "Velocity on x" diff(x)=w; "Velocity on y" diff(y)=z; "Tension on x" diff(w)=T*x; "Tension on y" diff(z)=T*y-g; "Position Constraint" x^2+y^2=L^2; SET g = 9.8 * "m/s^2"; L = 1 * "m"; INITIAL "Initial Position x" x = -1 * "m"; "Initial x Velocity" w = 0 * "m/s"; #"Initial Position y" y = 0 * "m"; #"Initial y Velocity" z = 0 * "m/s"; OPTIONS time = [0:0.1:30]; integration = "index0"; # original, index0 or index1 relativeAccuracy = 1e-8; absoluteAccuracy = 1e-9; indVarAccuracy = 1e-3; LASolver = "dense"; # dense or sparse DAESolver = "dassl"; # mebdf, dasslc, dassl, or sundials end