# Describing the motion of a composite body using system of differential equations

1 visualización (últimos 30 días)
Aleem Andrew el 19 de Mzo. de 2020
Comentada: Aleem Andrew el 19 de Mzo. de 2020
I am trying to solve a system of differential equations analytically using the following code, but although they correctly describe the motion of a body Matlab returns a message stating it is unable to find an explicit solution. Is there a way to fix this problem or an alternate method I can use to solve the system of differential equations?
syms y(t) z(t)
Dy = diff(y,t); Dz = diff(z,t);
eqns = [diff(y,t,2) == (29.4*cos(z)+4*Dz*Dz)*sin(z)/(1+3*sin(z)*sin(z)), diff(z,t,2) == -3*(19.62+2*Dz*Dz*cos(z))*sin(z)/(2*(1+3*sin(z)*sin(z)))];
[ySol(t),zSol(t)] = dsolve(eqns)
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

Stephan el 19 de Mzo. de 2020
Solve numeric:
syms y(t) z(t)
Dy = diff(y,t);
Dz = diff(z,t);
eqns = [diff(y,t,2) == (29.4*cos(z)+4*Dz*Dz)*sin(z)/(1+3*sin(z)*sin(z)),...
diff(z,t,2) == -3*(19.62+2*Dz*Dz*cos(z))*sin(z)/(2*(1+3*sin(z)*sin(z)))];
fun = matlabFunction(odeToVectorField(eqns),'Vars',{'t','Y'});
tspan = [0 10]; % Time interval for integration
y0 = [0 1 0 1]; % initial conditions
[t,y] = ode45(fun,tspan,y0);
plot(t,y)
##### 1 comentarioMostrar -1 comentarios más antiguosOcultar -1 comentarios más antiguos
Aleem Andrew el 19 de Mzo. de 2020

Iniciar sesión para comentar.

### Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

### Community Treasure Hunt

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

Start Hunting!

Translated by