Path: news.mathworks.com!newsfeed-00.mathworks.com!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: <HIDDEN> Newsgroups: comp.soft-sys.matlab Subject: Re: control system Date: Wed, 11 Sep 2013 18:31:08 -0500 Organization: Aioe.org NNTP Server Lines: 55 Message-ID: <l0qufv$qav$1@speranza.aioe.org> References: <l0koal$ql6$1@newscl01ah.mathworks.com> <l0mfv5$9g9$1@speranza.aioe.org> <l0n9fi$bs7$1@newscl01ah.mathworks.com> <l0nlbl$ps2$1@speranza.aioe.org> <l0q1nf$amc$1@newscl01ah.mathworks.com> Reply-To: <HIDDEN> NNTP-Posting-Host: Rww8NQxYv/2KP06omMLx8Q.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.mathworks.com comp.soft-sys.matlab:802256 On 9/11/2013 10:20 AM, ROHIT MISHRA wrote: >>>> >>>> ---------------------------- >>>> clear all >>>> A = [0 1;2 3]; B = [0 ; 1]; x0 = [1;0]; >>>> sys = ss(A,B,[0 1],[]); >>>> initial(sys,x0,16.4) >>>> ---------------------- > >> i hav solved the problem by solving the entire equation of x(t) which involves >integral and non integral terms.since the length of the solution became >huge so i was trying to find a shorter way...i hav seen the ode45 >command but didnt used it ...i will definitely try to solve the >state equation using it...thanks 4 d help.......................ROHIT I do not know what the difficulties you had. But the state equation can be easily used for ode45. From above, just write the odes, they are x1' = x2 x2' = 2*x1 + 3*x2 + 1*u(t) You can even backtrack the second order ODE from the above, like this: Let x2=y' and x1=y, then y''=3*y'+2*y+u(t) or y''-3*y'-2*y = u(t) This is a second order ODE. btw, one can see right away, this is not stable ode. So, your model is wrong if this is meant to be a real physical model. Stiffness term can't be negative in real system. You do not even need ode45 to solve this. You can solve it by hand depending how complicated the forcing function is. For siusodial, simply do (using syms, to get exact analytical solution) ------------------------ syms y(t) t dy=diff(y); sol=dsolve(diff(y,2)-3*diff(y)-2*y==sin(t), y(0)==1, dy(0)==0) ezplot(sol) ------------------------- This is your x1(t), which is y(t) --Nasser