~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to man/fr/scicos/DERIV.htm

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
 
2
 
 
3
<!--Converted with LaTeX2HTML 2002-2-1 (1.70)
 
4
original version by:  Nikos Drakos, CBLU, University of Leeds
 
5
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
 
6
* with significant contributions from:
 
7
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
 
8
<HTML>
 
9
<HEAD>
 
10
<TITLE>Derivative </TITLE>
 
11
<META NAME="description" CONTENT="Derivative ">
 
12
<META NAME="keywords" CONTENT="main">
 
13
<META NAME="resource-type" CONTENT="document">
 
14
<META NAME="distribution" CONTENT="global">
 
15
 
 
16
<META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
 
17
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
 
18
 
 
19
<LINK REL="STYLESHEET" HREF="main.css">
 
20
 
 
21
</HEAD>
 
22
 
 
23
<BODY bgcolor="#FFFFFF">
 
24
 
 
25
<!--Table of Child-Links-->
 
26
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
 
27
 
 
28
<UL>
 
29
<LI><A NAME="tex2html5228"
 
30
  HREF="DERIV.htm#SECTION005816100000000000000">Library</A>
 
31
<LI><A NAME="tex2html5229"
 
32
  HREF="DERIV.htm#SECTION005816200000000000000">Description</A>
 
33
<LI><A NAME="tex2html5230"
 
34
  HREF="DERIV.htm#SECTION005816300000000000000">Default properties</A>
 
35
<LI><A NAME="tex2html5231"
 
36
  HREF="DERIV.htm#SECTION005816400000000000000">Interfacing function</A>
 
37
<LI><A NAME="tex2html5232"
 
38
  HREF="DERIV.htm#SECTION005816500000000000000">Computational function (type 4)</A>
 
39
</UL>
 
40
<!--End of Table of Child-Links-->
 
41
<HR>
 
42
 
 
43
<H2><A NAME="SECTION005816000000000000000"></A><A NAME="DERIV"></A>
 
44
<BR>
 
45
Derivative 
 
46
</H2>
 
47
<DIV ALIGN="CENTER">
 
48
<!-- MATH
 
49
 $\epsfig{file=DERIV.eps,width=90.00pt}$
 
50
 -->
 
51
<IMG
 
52
 WIDTH="143" HEIGHT="161" ALIGN="BOTTOM" BORDER="0"
 
53
 SRC="img164.gif"
 
54
 ALT="\epsfig{file=DERIV.eps,width=90.00pt}">
 
55
</DIV>
 
56
<H3><font color="blue"><A NAME="SECTION005816100000000000000">
 
57
Library</A>
 
58
</font></H3>
 
59
Linear
 
60
 
 
61
<H3><font color="blue"><A NAME="SECTION005816200000000000000">
 
62
Description</A>
 
63
</font></H3>
 
64
The Derivative block approximates the derivative of its input by computing:
 
65
<!-- MATH
 
66
 \begin{displaymath}
 
67
\frac{\Delta u}{\Delta t}
 
68
\end{displaymath}
 
69
 -->
 
70
<P></P>
 
71
<DIV ALIGN="CENTER">
 
72
<IMG
 
73
 WIDTH="33" HEIGHT="56" ALIGN="MIDDLE" BORDER="0"
 
74
 SRC="img165.gif"
 
75
 ALT="$\displaystyle \frac{\Delta u}{\Delta t}$">
 
76
</DIV><P></P> 
 
77
 
 
78
<H3><font color="blue"><A NAME="SECTION005816300000000000000">
 
79
Default properties</A>
 
80
</font></H3>
 
81
 
 
82
<UL>
 
83
<LI>always active: no
 
84
</LI>
 
85
<LI>direct-feedthrough: yes
 
86
</LI>
 
87
<LI>zero-crossing: no
 
88
</LI>
 
89
<LI>mode: no
 
90
</LI>
 
91
<LI>number/sizes of inputs: 1 / -1
 
92
</LI>
 
93
<LI>number/sizes of outputs: 1 / -1
 
94
</LI>
 
95
<LI>number/sizes of activation inputs: 0 / 
 
96
</LI>
 
97
<LI>number/sizes of activation outputs: 0 / 
 
98
</LI>
 
99
<LI>continuous-time state: no
 
100
</LI>
 
101
<LI>discrete-time state: no
 
102
</LI>
 
103
<LI>name of computational function: <EM>deriv</EM>
 
104
</LI>
 
105
</UL>
 
106
<H3><font color="blue"><A NAME="SECTION005816400000000000000">
 
107
Interfacing function</A>
 
108
</font></H3>
 
109
<TT>scilab/macros/scicos_blocks/linear/DERIV.sci</TT>
 
110
 
 
111
<H3><font color="blue"><A NAME="SECTION005816500000000000000">
 
112
Computational function (type 4)</A>
 
113
</font></H3>
 
114
<BR>
 
115
<PRE>
 
116
#include "scicos_block.h"
 
117
#include &lt;math.h&gt;
 
118
 
 
119
#if WIN32
 
120
#define NULL    0
 
121
#endif
 
122
 
 
123
void deriv(scicos_block *block,int flag)
 
124
 
125
  double* rw;
 
126
  double t,dt;
 
127
  int i;
 
128
  if (flag == 4){/* the workspace is used to store previous values */
 
129
    if ((*block-&gt;work=
 
130
         scicos_malloc(sizeof(double)*2*(1+block-&gt;insz[0])))== NULL ) {
 
131
      set_block_error(-16);
 
132
      return;
 
133
    }
 
134
    rw=*block-&gt;work; 
 
135
    t=get_scicos_time();
 
136
    rw[0]=t;
 
137
    rw[1]=t;
 
138
    for(i=0;i&lt;block-&gt;insz[0];++i){
 
139
      rw[2+2*i]=0;
 
140
      rw[3+2*i]=0;
 
141
    }
 
142
  }else  if (flag == 5){
 
143
    scicos_free(*block-&gt;work);
 
144
  }else  if (flag == 1) {
 
145
    rw=*block-&gt;work;
 
146
    t=get_scicos_time();
 
147
    if(t&gt;rw[1]) {
 
148
      rw[0]=rw[1];
 
149
      for(i=0;i&lt;block-&gt;insz[0];++i)  {rw[2+2*i]=rw[3+2*i];}
 
150
    }
 
151
    rw[1]=t;
 
152
    for(i=0;i&lt;block-&gt;insz[0];++i) {
 
153
      rw[3+2*i]=block-&gt;inptr[0][i];
 
154
    }
 
155
    dt=rw[1]-rw[0];
 
156
 
 
157
    if(dt!=0.0) {
 
158
      for(i=0;i&lt;block-&gt;insz[0];++i)
 
159
        block-&gt;outptr[0][i]=(rw[3+2*i]-rw[2+2*i])/dt;
 
160
    }
 
161
  }
 
162
}
 
163
  </PRE>
 
164
<BR><HR>
 
165
<ADDRESS>
 
166
Ramine Nikoukhah
 
167
2004-06-22
 
168
</ADDRESS>
 
169
</BODY>
 
170
</HTML>