1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
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 -->
11
<META NAME="description" CONTENT="Ramp ">
12
<META NAME="keywords" CONTENT="main">
13
<META NAME="resource-type" CONTENT="document">
14
<META NAME="distribution" CONTENT="global">
16
<META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
17
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
19
<LINK REL="STYLESHEET" HREF="main.css">
23
<BODY bgcolor="#FFFFFF">
25
<!--Table of Child-Links-->
26
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
29
<LI><A NAME="tex2html2788"
30
HREF="RAMP.htm#SECTION00513100000000000000">Library</A>
31
<LI><A NAME="tex2html2789"
32
HREF="RAMP.htm#SECTION00513200000000000000">Description</A>
33
<LI><A NAME="tex2html2790"
34
HREF="RAMP.htm#SECTION00513300000000000000">Dialog Box</A>
35
<LI><A NAME="tex2html2791"
36
HREF="RAMP.htm#SECTION00513400000000000000">Default properties</A>
37
<LI><A NAME="tex2html2792"
38
HREF="RAMP.htm#SECTION00513500000000000000">Interfacing function</A>
39
<LI><A NAME="tex2html2793"
40
HREF="RAMP.htm#SECTION00513600000000000000">Computational function (type 4)</A>
42
<!--End of Table of Child-Links-->
45
<H2><A NAME="SECTION00513000000000000000"></A><A NAME="RAMP"></A>
51
$\epsfig{file=RAMP.eps,width=90.00pt}$
54
WIDTH="143" HEIGHT="161" ALIGN="BOTTOM" BORDER="0"
56
ALT="\epsfig{file=RAMP.eps,width=90.00pt}">
58
<H3><font color="blue"><A NAME="SECTION00513100000000000000">
63
<H3><font color="blue"><A NAME="SECTION00513200000000000000">
66
The Ramp block generates a signal that starts at a specified time and
67
value and changes by a specified rate. The block's <B>Slope , Start
68
time</B> and <B>Initial output</B> parameters determine the
69
characteristics of the output signal. All must have the consistent
70
dimensions after scalar expansion.
72
<H3><font color="blue"><A NAME="SECTION00513300000000000000">
76
<TABLE CELLPADDING=3 BORDER="1">
77
<TR><TD ALIGN="CENTER">Set ramp parameters</TD>
80
<TR><TD ALIGN="CENTER">Slope</TD>
81
<TD ALIGN="CENTER">0</TD>
83
<TR><TD ALIGN="CENTER">Start time</TD>
84
<TD ALIGN="CENTER">0</TD>
86
<TR><TD ALIGN="CENTER">Initial output</TD>
87
<TD ALIGN="CENTER">0</TD>
93
<LI>Slope: The rate of change of the generated signal.
95
<LI>Start time:The time at which the signal begins to be generated.
97
<LI>Initial output:The initial value of the signal.
101
<H3><font color="blue"><A NAME="SECTION00513400000000000000">
102
Default properties</A>
106
<LI>always active: yes
108
<LI>direct-feedthrough: no
110
<LI>zero-crossing: yes
114
<LI>number/sizes of inputs: 0 /
116
<LI>number/sizes of outputs: 1 / 1
118
<LI>number/sizes of activation inputs: 0 /
120
<LI>number/sizes of activation outputs: 0 /
122
<LI>continuous-time state: no
124
<LI>discrete-time state: no
126
<LI>name of computational function: <EM>ramp</EM>
129
<H3><font color="blue"><A NAME="SECTION00513500000000000000">
130
Interfacing function</A>
132
<TT>scilab/macros/scicos_blocks/sources/RAMP.sci</TT>
134
<H3><font color="blue"><A NAME="SECTION00513600000000000000">
135
Computational function (type 4)</A>
138
<PRE>#include "scicos_block.h"
139
#include <math.h>
141
void ramp(scicos_block *block,int flag)
144
dt=get_scicos_time()-block->rpar[1];
145
if (get_phase_simulation()==1) {
147
block->outptr[0][0]=block->rpar[2]+block->rpar[0]*dt;
149
block->outptr[0][0]=block->rpar[2];
152
if(block->mode[0]==1) {
153
block->outptr[0][0]=block->rpar[2]+block->rpar[0]*dt;
155
block->outptr[0][0]=block->rpar[2];
159
block->g[0]=get_scicos_time()-(block->rpar[1]);
160
if (get_phase_simulation()==1) {
161
if (block->g[0]>=0){