Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
ode45 help

Subject: ode45 help

From: mojtaBa malekpour

Date: 16 Oct, 2012 09:06:08

Message: 1 of 2

why matlab can't solve this?


function dy = ffffd(t,y)
dy = zeros(4,1); % a column vector
dy(1) =y(2);
dy(2) =-81276055.762*cos(atan((0.05*sin(523.5988*t)+0.12*sin(y(3)))/(-y(1)+0.05*cos(523.5988*t)+0.12*cos(y(3)))))*([[y(1)-0.05*cos(523.5988*t)-0.12*cos(y(3))]^2+[0.05*sin(523.5988*t)+0.12*sin(y(3))]^2]^0.5-0.0005)^1.5;
dy(3) =y(4);
dy(4) =171687.934*sin(y(3)-523.5988*t)+1357293887.572*sin(y(3)-atan((0.05*sin(523.5988*t)+0.12*sin(y(3)))/(-y(1)+0.05*cos(523.5988*t)+0.12*cos(y(3)))))*([[y(1)-0.05*cos(523.5988*t)-0.12*cos(y(3))]^2+[0.05*sin(523.5988*t)+0.12*sin(y(3))]^2]^0.5-0.0005)^1.5+122.868*cos(y(3));

[T,Y] = ode45(@ffffd,[0 2.784],[0.1705 0 0 0]);

Subject: ode45 help

From: Kristin

Date: 7 Dec, 2012 14:13:08

Message: 2 of 2

"mojtaBa malekpour" <mojy691129@yahoo.com> wrote in message <k5j820$iq6$1@newscl01ah.mathworks.com>...
> why matlab can't solve this?
>
>
> function dy = ffffd(t,y)
> dy = zeros(4,1); % a column vector
> dy(1) =y(2);
> dy(2) =-81276055.762*cos(atan((0.05*sin(523.5988*t)+0.12*sin(y(3)))/(-y(1)+0.05*cos(523.5988*t)+0.12*cos(y(3)))))*([[y(1)-0.05*cos(523.5988*t)-0.12*cos(y(3))]^2+[0.05*sin(523.5988*t)+0.12*sin(y(3))]^2]^0.5-0.0005)^1.5;
> dy(3) =y(4);
> dy(4) =171687.934*sin(y(3)-523.5988*t)+1357293887.572*sin(y(3)-atan((0.05*sin(523.5988*t)+0.12*sin(y(3)))/(-y(1)+0.05*cos(523.5988*t)+0.12*cos(y(3)))))*([[y(1)-0.05*cos(523.5988*t)-0.12*cos(y(3))]^2+[0.05*sin(523.5988*t)+0.12*sin(y(3))]^2]^0.5-0.0005)^1.5+122.868*cos(y(3));
>
> [T,Y] = ode45(@ffffd,[0 2.784],[0.1705 0 0 0]);

You have some large numbers in there... perhaps convergence/divergence issues?
It looks like it tries to solve it, just takes a long time.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us