~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to demos/dae/pendule3d.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright INRIA
 
2
 
 
3
function c=gg(x)
 
4
c=x'*x-l*l;
 
5
 
 
6
function c=ggp(x,u)
 
7
c=2*x'*u;
 
8
 
 
9
function c=ggpp(x,u,lambda)
 
10
c=2*(u'*u+x'*(-2*lambda/m*x-[0;0;g]));
 
11
 
 
12
function [res,ires]=index2(t,y,ydot)
 
13
x=y(1:3); u=y(4:6); lambda=y(7);
 
14
xp=ydot(1:3); up=ydot(4:6); lambdap=ydot(7);
 
15
res(1:3)=xp-u;
 
16
res(4:6)=up+2*lambda/m*x+[0;0;g];
 
17
res(7)=ggp(x,u);
 
18
ires=0;
 
19
 
 
20
function [res,ires]=index1(t,y,ydot)
 
21
x=y(1:3); u=y(4:6); lambda=y(7);
 
22
xp=ydot(1:3); up=ydot(4:6); lambdap=ydot(7);
 
23
res(1:3)=xp-u;
 
24
res(4:6)=up+2*lambda/m*x+[0;0;g];
 
25
res(7)=ggpp(x,u,lambda);
 
26
ires=0;
 
27
 
 
28
function [res,ires]=index1s(t,y,ydot)
 
29
x=y(1:3); u=y(4:6); lambda=y(7);
 
30
xp=ydot(1:3); up=ydot(4:6); lambdap=ydot(7);
 
31
res(1:3)=xp-u;
 
32
res(4:6)=up+2*lambda/m*x+[0;0;g];
 
33
res(7)=beta*beta*gg(x)+2*alfa*ggp(x,u)+ggpp(x,u,lambda);
 
34
ires=0;