gcarlson

36 Reputation

2 Badges

12 years, 304 days

MaplePrimes Activity


These are questions asked by gcarlson

<p>I running Maple 12. I don't see what could be wrong with the specified initial values for this nonlinear fit problem. Note error when initial vlaues are specified, and no error without initial values.

Good Day!

I numerically solved a system of ODEs with dsolve for the functions p(x) and q(x) over the domain x=[-1,+1].  Boundary conditions are specified at x=-1 and x=+1.  The output is a listprocedure.  

I want to determine the n-th derivatives of p(x) and q(x) at x=0.  Alternatively, I want the power series representation of p(x) and q(x) about x=0.

I would appreciate any advice on how to use Maple 10 to accomplish this.

Thanks.

Glenn

The attached Maple10 worksheet solves a system of differential equations. A plot of the solutions y1(t) (red curve) and y2(t) (green curve) appears below. Download 2353_fsolve-avoid.mws
View file details As a check, I want to use fsolve and the "avoid" option to find both times at which y1 has the same value as when y1=y2, but I'm having trouble. I would appreciate any advice on how I can get the "avoid" option to work for me. fsolve finds the earlier time easily enough (t=.9036852930e-1), but when I use the "avoid" option (highlighted statement below) to find the later time (t=.5225499740), I get the error "Error, (in fsolve) avoid = {.9036852930e-1} is an invalid option." The code is appended below. Thanks. Glenn ======== > restart; > with(plots): > sys:= Diff(y1(t),t)=-3*y1(t) + 2*y2(t), Diff(y2(t),t)=y1(t)-3*y2(t); > ic := y1(0)=1, y2(0)=5; d d sys := -- y1(t) = -3 y1(t) + 2 y2(t), -- y2(t) = y1(t) - 3 y2(t) dt dt ic := y1(0) = 1, y2(0) = 5 > odesol:=dsolve({sys,ic},{y1(t),y2(t)},type=numeric,output=listprocedure); odesol := [t = (proc(t) ... end proc), y1(t) = (proc(t) ... end proc), y2(t) = (proc(t) ... end proc)] > Y1:=eval(y1(t),odesol); Y2:=eval(y2(t),odesol); Y1 := proc(t) ... end proc Y2 := proc(t) ... end proc > Teq:=fsolve('Y1'(t)='Y2'(t),t); Teq := 0.5225499740 > Yeq:=Y1(Teq); Y2(Teq); Yeq := 1.45974175440983366 1.45974175447049736 > T1:=fsolve('Y1'(t)=Yeq); T2:=fsolve('Y2'(t)=Yeq); T1 := 0.09036852930 T2 := 0.5225499740 > fsolve('Y1'(t)=Yeq, t, avoid={T1}); fsolve('Y1'(t)=Yeq, t=T2); Error, (in fsolve) avoid = {.9036852930e-1} is an invalid option 0.5225499740 > Y1(%); 1.45974175440983366 > plot({Y1(t),Y2(t)},t=0..3);

Page 1 of 1