1

Need to solve the system of nonlinear differential equations:

x1p = a1*u2*x1^1.3 + a2*u1 + a3*u3
x2p = (a4*u2 + a5)*x1^1.3 + a6*x2
x3p = (a7*u3 + (a8*u2-a9)*x1)/a10

x1p, x2p & x3p are time derivatives of x1, x2 & x3, i.e. dx1/dt, dx2/dt & dx3/dt.

we have descrete data of x1, x2 & x3 as well as of u1, u2 & u3. We need to solve the problem in order to get the unknown coefficients, a1, a2, …, a10.

Have checked many posts and can say the solution involves ODE45 (or other ODEX) and probably fsolve or fminsearch (Matlab), but have not managed to setup up the problem correctly, guess we don't understand the coding well. Please, suggestions.

Rok Petric
  • 75
  • 3
  • 9

1 Answers1

0

you should replace x1p, x2p ,and x3p by using definition of derivative: x1p = (x1(i+1) - x(i))/ dt , and like this for the others. then use folowing algorithm (it is not complete):

descrete data of x1, x2 & x3 as well as of u1, u2 & u3
dt = 0.01
myFun = @(a,x1,x2,x3,u1,u2,u3)
   [ (x1(i+1) - x1(i))/ dt = a(1)*u2(i)*x1(i)^1.3 + a(2)*u1(i) + a(3)*u3(i);   
     (x2(i+1) - x2(i))/ dt = (a(4)*u2(i) + a(5)*x1(i)^1.3 + a(6)*x2(i);
     (x3(i+1) - x3(i))/ dt = (a(7)*u3(i) + (a(8)*u2(i)-a(9))*x1(i))/a(10) ]
A=[];
a0 = [0; 0; 0 ;0 ;....   ]
for i= 1:1: lenngth(x1) 
a=fsolve(@(a)myFun(a,x1,x2,x3,u1,u2,u3),a0,options);
a0 = [ a(1,1) ; a(2,1); a(3,1) ; .......]
A = cat(1,A,a) ;
end 
a1 = mean(A(1,:))
a2 = mean(A(2,:))
.
.
a10 = mean(A(10,:))
ayhan
  • 1
  • 2