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

« back to all changes in this revision

Viewing changes to macros/xdess/zgrid.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
function []=zgrid()
 
2
//
 
3
// Copyright INRIA
 
4
xselect();
 
5
square(-1.1,-1.1,1.1,1.1);
 
6
xtitle( ['loci with constant damping and constant frequencies';...
 
7
      'in discrete plane'],' ',' ');
 
8
//
 
9
xsi=0:0.1:1 //
 
10
//                           2                 2
 
11
//roots of                  s  + 2*xsi*w0*s +w0
 
12
//given by : w0*(-xsi+-%i*sqrt(1-sxi*xsi))
 
13
raci=((0:0.05:1)*%pi)'*(-xsi+%i*sqrt(ones(xsi)-xsi.*xsi))
 
14
// continuous --> discrete 
 
15
raci=exp(raci);[mr,nr]=size(raci);
 
16
for l=1:nr,
 
17
    xstring(real(raci(mr-10,l)),-imag(raci(mr-10,l)),' '+string(xsi(l)),0,0);
 
18
end;
 
19
  plot2d(real(raci),imag(raci),1*ones(1,nr),"001");
 
20
  plot2d(real(raci),-imag(raci),1*ones(1,nr),"001");
 
21
//
 
22
w0=(0:0.1:1)*%pi; //
 
23
e_itheta=exp(%i*(%pi/2:0.05:%pi)')
 
24
zw=exp(e_itheta*w0);[mz,nz]=size(zw)
 
25
for l=1:nz,
 
26
    xstring(real(zw(1,l)),imag(zw(1,l)),' '+string(w0(l)/(2*%pi)),0,0);
 
27
end;
 
28
//-- the curves 
 
29
   plot2d(real(zw),imag(zw),1*ones(1,nr),"001");
 
30
   plot2d(real(zw),-imag(zw),1*ones(1,nr),"001");
 
31
 
 
32