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:
How to solve a final value problem?

Subject: How to solve a final value problem?

From: workaholic

Date: 20 Oct, 2008 07:33:28

Message: 1 of 6

I wish to solve a final value problem of a nonlinear ordinary equation
group, how can I use the the Matlab to do that? It seems that there is
only functions solving the initial value problem. Please help me.
Thanks in advance!

Subject: How to solve a final value problem?

From: Bruno Luong

Date: 20 Oct, 2008 07:42:02

Message: 2 of 6

workaholic <liuauto@gmail.com> wrote in message <ca59f236-1d0e-4b96-93c1-8651f697c55d@v13g2000pro.googlegroups.com>...
> I wish to solve a final value problem of a nonlinear ordinary equation
> group, how can I use the the Matlab to do that? It seems that there is
> only functions solving the initial value problem. Please help me.
> Thanks in advance!

If your ode is backward equation with finale condition, you need to replace a time variable by its reverse to transform to forward problem.

If you have both initial and final condition, check out BVP5C.

Bruno

Subject: How to solve a final value problem?

From: workaholic

Date: 20 Oct, 2008 09:01:08

Message: 3 of 6

On 10=D4=C220=C8=D5, =CF=C2=CE=E73=CA=B142=B7=D6, "Bruno Luong" <b.lu...@fo=
gale.findmycountry>
wrote:
> workaholic <liua...@gmail.com> wrote in message <ca59f236-1d0e-4b96-93c1-=
8651f697c...@v13g2000pro.googlegroups.com>...
> > I wish to solve a final value problem of a nonlinear ordinary equation
> > group, how can I use the the Matlab to do that? It seems that there is
> > only functions solving the initial value problem. Please help me.
> > Thanks in advance!
>
> If your ode is backward equation with finale condition, you need to repla=
ce a time variable by its reverse to transform to forward problem.
>
> If you have both initial and final condition, check out BVP5C.
>
> Bruno

Thanks!

Subject: How to solve a final value problem?

From: workaholic

Date: 27 Oct, 2008 14:18:57

Message: 4 of 6

On 10=D4=C220=C8=D5, =CF=C2=CE=E73=CA=B142=B7=D6, "Bruno Luong" <b.lu...@fo=
gale.findmycountry>
wrote:
> workaholic <liua...@gmail.com> wrote in message <ca59f236-1d0e-4b96-93c1-=
8651f697c...@v13g2000pro.googlegroups.com>...
> > I wish to solve afinalvalueproblem of a nonlinear ordinary equation
> > group, how can I use the the Matlab to do that? It seems that there is
> > only functions solving the initialvalueproblem. Please help me.
> > Thanks in advance!
>
> If your ode is backward equation with finale condition, you need to repla=
ce a time variable by its reverse to transform to forward problem.
>
> If you have both initial andfinalcondition, check out BVP5C.
>
> Bruno

Sorry, I still cannot work it out

My equation is like this:
s =3D zeros(15,1)=A3=BA
ds =3D -[ 56.6255+29.8194*s(1)+3.88810*s(6)+5.63478*s(11)+109.419*s(5)+
(s(2)+55.6844*s(5))*s(1)+(s(3)+6.33204*s(5))*s(6)+
(s(4)+9.17664*s(5))*s(11);
 -329.633-13.5638*s(1)-9.26906*s(6)-31.2007*s(11)+109.419*s(10)+
(s(7)+55.6844*s(10))*s(1)+(s(8)+6.33204*s(10))*s(6)+
(s(9)+9.17664*s(10))*s(11);
  213.265+10.4535*s(1)+10.7237*s(6)+32.9642*s(11)+109.419*s(15)+
(s(12)+55.6844*s(15))*s(1)+(s(13)+6.33204*s(15))*s(6)+
(s(14)+9.17664*s(15))*s(11);
 -2483.44+29.8194*s(2)+3.88810*s(7)+5.63478*s(12)-4972.89*s(5)+
(s(2)+55.6844*s(5))*s(2)+(s(3)+6.33204*s(5))*s(7)+
(s(4)+9.17664*s(5))*s(12);
 -752.718-13.5638*s(2)-9.26906*s(7)-31.2007*s(12)-4972.89*s(10)+
(s(7)+55.6844*s(10))*s(2)+(s(8)+6.33204*s(10))*s(7)+
(s(9)+9.17664*s(10))*s(12);
  484.744+10.4535*s(2)+10.7237*s(7)+32.9642*s(12)-4972.89*s(15)+
(s(12)+55.6844*s(15))*s(2)+(s(13)+6.33204*s(15))*s(7)+
(s(14)+9.17664*s(15))*s(12);
  122.248+29.8194*s(3)+3.88810*s(8)+5.63478*s(13)+199.089*s(5)+
(s(2)+55.6844*s(5))*s(3)+(s(3)+6.33204*s(5))*s(8)+
(s(4)+9.17664*s(5))*s(13);
 -1022.78-13.5638*s(3)-9.26906*s(8)-31.2007*s(13)+199.089*s(10)+
(s(7)+55.6844*s(10))*s(3)+(s(8)+6.33204*s(10))*s(8)+
(s(9)+9.17664*s(10))*s(13);
  1070.36+10.4535*s(3)+10.7237*s(8)+32.9642*s(13)+199.089*s(15)+
(s(12)+55.6844*s(15))*s(3)+(s(13)+6.33204*s(15))*s(8)+
(s(14)+9.17664*s(15))*s(13);
  296.916+29.8194*s(4)+3.88810*s(9)+5.63478*s(14)+483.549*s(5)+
(s(2)+55.6844*s(5))*s(4)+(s(3)+6.33204*s(5))*s(9)+
(s(4)+9.17664*s(5))*s(14);
 -3116.94-13.5638*s(4)-9.26906*s(9)-31.2007*s(14)+483.549*s(10)+
(s(7)+55.6844*s(10))*s(4)+(s(8)+6.33204*s(10))*s(9)+
(s(9)+9.17664*s(10))*s(14);
  3195.41+10.4535*s(4)+10.7237*s(9)+32.9642*s(14)+483.549*s(15)+
(s(12)+55.6844*s(15))*s(4)+(s(13)+6.33204*s(15))*s(9)+
(s(14)+9.17664*s(15))*s(14);
          54.2301+135.337*s(5)+3.88810*s(10)+5.63478*s(15)+s(1)+
(s(2)+55.6844*s(5))*s(5)+(s(3)+6.33204*s(5))*s(10)+
(s(4)+9.17664*s(5))*s(15);
         -9.33297-13.5638*s(5)+96.2485*s(10)-31.2007*s(15)+s(6)+
(s(7)+55.6844*s(10))*s(5)+(s(8)+6.33204*s(10))*s(10)+
(s(9)+9.17664*s(10))*s(15);
          7.73866+10.4535*s(5)+10.7237*s(10)+138.482*s(15)+s(11)+
(s(12)+55.6844*s(15))*s(5)+(s(13)+6.33204*s(15))*s(10)+
(s(14)+9.17664*s(15))*s(15)];

since s(t) is the vector variable, and the equation does not contain
explicitly a t variable, I don't know how to transform it into a
feasible form.
I notice that there is a odeset option" BDP", can it be used for that?
Anybody can help me? Thanks in advance!

Subject: How to solve a final value problem?

From: Torsten Hennig

Date: 27 Oct, 2008 15:02:39

Message: 5 of 6

>I wish to solve a final value problem of a nonlinear >ordinary equation
>group, how can I use the the Matlab to do that? It seems >that there is
>only functions solving the initial value problem. Please >help me.
>Thanks in advance!

If your ODE-system reads
dy/dt = f(t,y), y(tend) = y_end
make a change of variables according to
t~ = -t
y~(t~) = y(t)
You arrive at
dy~/dt~ = -f(-t~,y~(t~)), y~(-tend) = y_end
to be integrated between -tend and 0.
So in your case (if f does not contain t explicitely),
just set a minus-sign in front of the vector of the
right-hand side and integrate between -tend and 0.

Best wishes
Torsten.

Subject: How to solve a final value problem?

From: workaholic

Date: 28 Oct, 2008 12:00:59

Message: 6 of 6

On 10=D4=C227=C8=D5, =CF=C2=CE=E711=CA=B102=B7=D6, Torsten Hennig <Torsten.=
Hen...@umsicht.fhg.de>
wrote:
> >I wish to solve a final value problem of a nonlinear >ordinary equation
> >group, how can I use the the Matlab to do that? It seems >that there is
> >only functions solving the initial value problem. Please >help me.
> >Thanks in advance!
>
> If your ODE-system reads
> dy/dt =3D f(t,y), y(tend) =3D y_end
> make a change of variables according to
> t~ =3D -t
> y~(t~) =3D y(t)
> You arrive at
> dy~/dt~ =3D -f(-t~,y~(t~)), y~(-tend) =3D y_end
> to be integrated between -tend and 0.
> So in your case (if f does not contain t explicitely),
> just set a minus-sign in front of the vector of the
> right-hand side and integrate between -tend and 0.
>
> Best wishes
> Torsten.

Thanks a lot!

Best regards

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