ode - solve system of differential equation in matlab -


i trying solve system of differential equations in matlab.

enter image description here

dn/du=(-2*u*n-k*(n*u-(1+g)))/(1+u^2+k*u*(u-(1+g)/n))  dxi/du=(1-u^2)/(1+u^2+k*u*(u-(1+g)/n))  df/du=(2*u+k*u^2*(u-(1+g)/n))/(1+u^2+k*u*(u-(1+g)/n)) 

k , gamma constants. have initial conditions so:

n(0)=1, xi(0)=0, f(0)=0 

first tried use 'dsolve'.

g=0.1; k=3;  syms n(u) u  n(u)=dsolve(diff(n,u)== (-2*u*n-k*(n*u-(1+g)))/(1+u^2+k*u*(u-(1+g)/n)),n(0)==1)  syms x(u) u n x(u)= dsolve(diff(x,u)== (1-u^2)/(1+u^2+k*u*(u-(1+g)/n)),x(0)==0)  syms f(u) u n f(u)=dsolve(diff(f,u)== (2*u+k*u^2*(u-(1+g)/n))/(1+u^2+k*u*(u-(1+g)/n)),f(0)==0) 

from there not explicit solution first equation , returned [empty sym] shown below.

warning: explicit solution not found.

in dsolve (line 201)

in untitled (line 37)

n(u) = [ empty sym ]

x(u) = (1089*atan(33/(1600*n^2 - 1089)^(1/2) - (80*n*u)/(1600*n^2 - 1089)^(1/2)))/(160*n*(1600*n^2 - 1089)^(1/2)) - (35937*log(40*n*u^2 - 33*u + 10*n))/(2*(- 256000*n^3 + 174240*n)) - u/4 + (33*log(10*n)*(1600*n^2 - 1089)^(1/2) - 2178*atan(33/(1600*n^2 - 1089)^(1/2)) + 8000*n^2*atan(33/(1600*n^2 - 1089)^(1/2)))/(320*n*(1600*n^2 - 1089)^(1/2)) - (25*n*atan(33/(1600*n^2 - 1089)^(1/2) - (80*n*u)/(1600*n^2 - 1089)^(1/2)))/(1600*n^2 - 1089)^(1/2) + (26400*n^2*log(40*n*u^2 - 33*u + 10*n))/(- 256000*n^3 + 174240*n)

f(u) = (3*u^2)/8 - (33*u)/(160*n) - (log(40*n*u^2 - 33*u + 10*n)*(3200000*n^4 - 3920400*n^2 + 1185921))/(2*(- 10240000*n^4 + 6969600*n^2)) + (log(10*n)*(3200000*n^4 - 3920400*n^2 + 1185921))/(2*(- 10240000*n^4 + 6969600*n^2)) + (33*atan((1089*(2800*n^2 - 1089))/((1600*n^2 - 1089)^(1/2)*(92400*n^2 - 35937)))*(2800*n^2 - 1089))/(6400*n^2*(1600*n^2 - 1089)^(1/2)) - (33*atan((1089*(2800*n^2 - 1089))/((1600*n^2 - 1089)^(1/2)*(92400*n^2 - 35937)) - (2640*nu(2800*n^2 - 1089))/((1600*n^2 - 1089)^(1/2)*(92400*n^2 - 35937)))*(2800*n^2 - 1089))/(6400*n^2*(1600*n^2 - 1089)^(1/2))

then tried use 'ode45'.

u=0:0.1:1; k=3; g=0.1; dndu=@(u,n) (-2*u*n-k*(n*u-(1+g)))/(1+u^2+k*u*(u-(1+g)/n)); [u,n]=ode45(dndu, u, 1) % initial n=1  dxidu=@(u,xi) (1-u^2)/(1+u^2+k*u*(u-(1+g)/n)); [u,xi]=ode45(dxidu, u, 0); %initial xi=0  dfdu=@(u,f) (2*u+k*u^2*(u-(1+g)/n))/(1+u^2+k*u*(u-(1+g)/n)); [u,f]=ode45(dfdu, u, 0) %initial f=0 

k , g constants , u gets values 0 1. when run first equation solved , got answer u , n error second equation matrix dimension must agree shown below.

u = 0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 1.0000

n = 1.0000 1.3409 1.6243 1.7746 1.7945 1.7263 1.6119 1.4800 1.3470 1.2208 1.1048

error using /
matrix dimensions must agree.

error in @(u,xi)(1-u^2)/(1+u^2+ku(u-(1+g)/n))

error in odearguments (line 87)
f0 = feval(ode,t0,y0,args{:}); % ode15i sets args{1} yp0.

error in ode45 (line 113)
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeargs, odefcn, ...

error in ode45method (line 24)
[u,xi]=ode45(dxidu, u, 0); %initial xi=0

can me how approach type of problem? in advance!

you have system of coupled differential equations, need solve coupled system. 1 ode function vector valued function 3 components.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -