Mega Search
23.2 Million


Sign Up

Make a donation  
ODE for Solving Switched State Space Equations  
News Group: comp.soft-sys.matlab

Hello,
I have a system: Xdot = A*X + B*u; A variable 'sw' decides whether to use A1 or A0 for A. Likewise  B1 or B0;
The initial conditions of X are:[0 0 0 0]' and sw = 0.
I have to solve the ode for 1 milisecond with a time step of 1e-9.
Since X is all zeros and sw = 0, i begin with Xdot = A0*X + B0*u.
After each iteration, X and sw have to be checked. Based on a particular value of any of the components of X and the value of sw in the previous iteration, the sw for the next iteration is set to sw=1 and the ode Xdot = A1*X + B0*u is to be solved.

I wanted to use ode23tb ( since the system is stiff).

How do i  proceed?


Thanks.

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 28-Aug-2016, at 2:59 PM EST
From: Hadhiq Khan
 
Re: ODE for Solving Switched State Space Equations  
News Group: comp.soft-sys.matlab
"Hadhiq Khan"  wrote in message ...
> Hello,
> I have a system: Xdot = A*X + B*u; A variable 'sw' decides whether to use A1 or A0 for A. Likewise  B1 or B0;
> The initial conditions of X are:[0 0 0 0]' and sw = 0.
> I have to solve the ode for 1 milisecond with a time step of 1e-9.
> Since X is all zeros and sw = 0, i begin with Xdot = A0*X + B0*u.
> After each iteration, X and sw have to be checked. Based on a particular value of any of the components of X and the value of sw in the previous iteration, the sw for the next iteration is set to sw=1 and the ode Xdot = A1*X + B0*u is to be solved.
> 
> I wanted to use ode23tb ( since the system is stiff).
> 
> How do i  proceed?
> 
> 
> Thanks.

Look at the "Events" facility in the options structure.

Best wishes
Torsten.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 29-Aug-2016, at 6:28 AM EST
From: Torsten