Path: news.mathworks.com!not-for-mail
From: "Azrul " <azrul.afifi@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: problem on quad
Date: Sat, 10 Apr 2010 07:38:08 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 47
Message-ID: <hpp9t0$ikr$1@fred.mathworks.com>
Reply-To: "Azrul " <azrul.afifi@gmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1270885088 19099 172.30.248.38 (10 Apr 2010 07:38:08 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 10 Apr 2010 07:38:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2268440
Xref: news.mathworks.com comp.soft-sys.matlab:625293

hi all,

i am currently doing an analysis on suspension system but faces problem regarding the quad function ..

the main body is :

global m mw k kt c u s
m =250;              %kg
mw=37.5;             %kg
k =20000;            %N/m
kt=200000;           %N/m
c =1120;             %Ns/m
u=10;

Q=quad(@myfunacc,1, 25);
---------------------------------------------------------------------------------------------------------------------
the function is :

function y = myfunacc(x)

global m mw k kt c u s

jot = sqrt(-1);

omega=2*pi*x;

A= ((omega^4)*m*mw)-((omega^2)*(k*mw+k*m+kt*m))+(k*kt)-((omega^3)*
     (c*mw*jot+c*m*jot))+(c*kt*omega*jot) ;

x1=((k+(c*jot*omega))*kt)/A;

RMSacc=(omega^2)*x1;

y=((abs(RMSacc))^2).*(256E-6).*(0.1.^2).*(u./(x.^2));
------------------------------------------------------------------------------------------------------------------
i've also try y=((abs(RMSacc))^2)*(256E-6)*(0.1^2)*(u/(x^2));    

but both gives me an error :

??? Input argument "a" is undefined.

Error in ==> quad at 69
if ~isscalar(a) || ~isscalar(b)
-------------------------------------------------------------------------------------------------------------

the program should give me a scalar value. i am not sure what is wrong . i am new with matlab and hope someone can help me .. thanks