nonlinear system of differential algebraic equations

조회 수: 7 (최근 30일)
Mona
Mona 2011년 4월 12일
Hi,
I have a system of coupled nonlinear equations ( 10 differential equations and three algebraics). I used ode15s for integration.I want to study the behavaior of the system to step change in one parameter defined in my code. So, I considered that the system at t=0 is in the state before step change (vector of initial condition) and at exactly t=0 the parameter changes to the new value. ODE15s does the integration with no problem, but the values at t=0 is not the one defined in the code( initial condition vector). The values for the three variables defined by algeraic equations will change.
So, I thought that I should apply this step change at sometime after t=0 and using If statement in my code. like, if t<100 param=5; else; param=6; But, this time I got this error Warning: Failure at t=1.000000e+002. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (2.273737e-013) at time t.
  댓글 수: 1
Hooman
Hooman 2012년 6월 14일
Hi, I was just had a general question. I am trying to solve a system of coupled nonlinear equations. Did u need to decouple the equations to be able to use the ode solvers? Also did u need to linearize the terms. I didn't do any of that, just wrote my equations in the form the ode accepts and solved them and got the same error you have.
Thanks!

댓글을 달려면 로그인하십시오.

채택된 답변

Andrew Newell
Andrew Newell 2011년 4월 12일
I think ode15s is trying to estimate the derivative at the step change. You should run the integration with the first parameter to the time of your step change and then use the output as the initial condition for a new run using the second parameter.
EDIT: Suppose your function is f(x,param) and x has length 2. You could do something like this:
param = 5;
odefun = @(x) f(x,param);
tspan = [0 100];
x0 = [0; 0];
[t1,x1] = ode15s(odefun,tspan,x0);
param = 6;
odefun = @(x) f(x,param);
tspan = [100 200];
x0 = x1(:,end);
[t2,x2] = ode15s(odefun,tspan,x0);
t = [t1 t2];
x = [x1 x2];
  댓글 수: 4
Mona
Mona 2011년 4월 13일
Thanks Andrew. For some parameter values, this method works, but still for some parameters I get this error
Unable to meet integration tolerances without reducing the step size below the smallest value allowed
Do you know how can I fix that?
Andrew Newell
Andrew Newell 2011년 4월 13일
Maybe this solution will help: http://www.mathworks.com/support/solutions/en/data/1-192Z0/index.html?product=ML&solution=1-192Z0

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Mona
Mona 2011년 4월 12일
Hi Andrew,
Thanks for your response. I think I am doing the same thing. But, still the variables corresponding to algebraic equations are changing. The only thing I thought is just adding the vector of initial conditions to the first row of the matrix of state variables (final result of integrarion) to study the system behavior. I am curious to know why if I use "if" statement( to implement the step change), the integarator stops?
Is there anyway to fix that?
  댓글 수: 1
Andrew Newell
Andrew Newell 2011년 4월 12일
My guess is that if you're using an if statement, you're not doing what I suggest. I have edited the above answer.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by