[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Nonconforming Err
From: |
Ben Abbott |
Subject: |
Re: Nonconforming Err |
Date: |
Sat, 03 Dec 2011 21:05:28 -0500 |
On Dec 3, 2011, at 8:58 PM, syberraith wrote:
> Why is is this failing to work?
>
> n = 100000;
> G_rpm = 12000;
> X_rpm = 300;
> Gr = 0.025;
> Xr = 0.15;
> Gw = 2 .* pi .* G_rpm ./ 60;
> Xw = 2 .* pi .* X_rpm ./ 60;
> p = 60 ./ G_rpm;
> h = p ./ ( n - 1 );
> g = h ./ 2;
>
> function y = raw_vel( x )
> global Gw;
> y = sin( Gw .* x );
> endfunction
>
> t = linspace(0,p,n);
> f = raw_vel( t );
> s = sum(f(1:end) .* h)
There may be other problems (I haven't checked), but you'll make Gw global from
the command line. So you'll need to replace ....
> Gw = 2 .* pi .* G_rpm ./ 60;
... with ...
> global Gw = 2 .* pi .* G_rpm ./ 60;
Ben