Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: control system
Replies: 5   Last Post: Sep 11, 2013 7:31 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Nasser Abbasi

Posts: 5,674
Registered: 2/7/05
Re: control system
Posted: Sep 11, 2013 7:31 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.