From: Franziska on
Hi,

I have a problem which is a hard nut to crack.

Basically I have to coupled differential equations and I want to determine displacements (x and y), velocities (xp, yp) and acceleration (xpp, ypp) related to time. r is a function of displacement (x or y). capital letters are material constants.

2 coupeled differential equations (nonlinear, 2nd order):
Q = xp*r(x)^2 + yp*r(y)^2
and
-A/r(x) + B/r(x)^2*x*xp + C*(x*xpp+xp^2) + D*x = -E/r(y) + F/r(y)^2*y*yp + G*(y*ypp+yp^2) + H*y

I want to use ode15s to solve the system.
Can anyone give me a hint how to prepare the equations for this solver?

Thanks.
Franziska
From: Franziska on
"Franziska " wrote
> Hi,
>
> I have a problem which is a hard nut to crack.
>
> Basically I have to coupled differential equations and I want to determine displacements (x and y), velocities (xp, yp) and acceleration (xpp, ypp) related to time. r is a function of displacement (x or y). capital letters are material constants.
>
> 2 coupeled differential equations (nonlinear, 2nd order):
> Q = xp*r(x)^2 + yp*r(y)^2
> and
> -A/r(x) + B/r(x)^2*x*xp + C*(x*xpp+xp^2) + D*x = -E/r(y) + F/r(y)^2*y*yp + G*(y*ypp+yp^2) + H*y
>
> I want to use ode15s to solve the system.
> Can anyone give me a hint how to prepare the equations for this solver?
>
> Thanks.
> Franziska

I converted the problem to Mx=f . So it looks like:
M= [1 0 0 0;
0 1 0 0;
r(x)^2 r(x)^2 0 0;
0 0 C*x C*y];
x= [u; v; up; vp];
f= [xp; yp; Q; +A/r(x) -E/r(y) -B/r(x)^2*x*xp +F/r(y)^2*y*yp -C*xp^2 +G*yp^2 -D*x +H*y];
I used ode15s to solve. I inserted x,y,xp,yp,xpp,and ypp in my second differential equation and have seen left hand side is not equal to right handside. The error is very large (so, no numerical error).
What is wrong here? Can anyone help me?
From: Torsten Hennig on
> "Franziska " wrote
> > Hi,
> >
> > I have a problem which is a hard nut to crack.
> >
> > Basically I have to coupled differential equations
> and I want to determine displacements (x and y),
> velocities (xp, yp) and acceleration (xpp, ypp)
> related to time. r is a function of displacement (x
> or y). capital letters are material constants.
> >
> > 2 coupeled differential equations (nonlinear, 2nd
> order):
> > Q = xp*r(x)^2 + yp*r(y)^2
> > and
> > -A/r(x) + B/r(x)^2*x*xp + C*(x*xpp+xp^2) + D*x =
> -E/r(y) + F/r(y)^2*y*yp + G*(y*ypp+yp^2) + H*y
> >
> > I want to use ode15s to solve the system.
> > Can anyone give me a hint how to prepare the
> equations for this solver?
> >
> > Thanks.
> > Franziska
>

(1) a1' = a2
(2) b1' = b2
(3) r(a1)^2*a1' + r(b1)^2*b1' = Q
(4) C*a1*a2' - G*b1*b2' =
A/r(a1) - B/r(a1)^2*a1*a2 - C*a2^2 - D*a1-
E/r(b1) + F/r(b1)^2*b1*b2 + G*b2^2 + H*b1
with
[a1,a2,b1,b2] = [x,xp,y,yp]

Best wishes
Torsten.