File: pend3d1s.sce

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (36 lines) | stat: -rw-r--r-- 607 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright INRIA

mode(1)

getf("SCI/demos/dae/pendule3d.sci")

m=1; g=10; l=1;

theta0=0.2; phi0=%pi/4;
x0=l*[sin(phi0)*cos(theta0);..
      cos(phi0)*cos(theta0);sin(theta0)];

// index 1 with stabilization

u0=[1;-1;0];
deff("r=ff(l)","r=ggpp(x0,u0,l)");
lambda0=fsolve(0,ff);
ud0=-2*lambda0/m*x0-[0;0;g];
y0=[x0;u0;lambda0];
yd0=[u0;ud0;0];
t0=0; T=t0:0.01:15;

info=list([],0,[],[],[],0,0);
atol=[0.0001;0.0001;0.0001;0.001;0.001;0.001;1];
rtol=atol;

alfa=20; beta=20;

y1s=dassl([y0,yd0],t0,T,rtol,atol,index1s,info);

x1s=y1s(2:4,:);

norm(x1s(:,$),2)

xbasc()
param3d(x1s(1,:),x1s(2,:),x1s(3,:))