pagan

5062 Reputation

23 Badges

14 years, 245 days

 

 

"A map that tried to pin down a sheep trail was just credible,

 but it was an optimistic map that tried to fix a the path made by the wind,

 or a path made across the grass by the shadow of flying birds."

                                                                 - _A Walk through H_, Peter Greenaway

 

MaplePrimes Activity


These are replies submitted by pagan

@kutscher 

fsolve(ddEQ2,0.0..1.0);

                    0.089572502098965952134

plot(ddEQ2,0.0..0.3,view=-1000..1000);

plot(ddEQ2,0.3..1.0,view=-1..1);

@Danik For normal evaluation of expressions to floating-point, `Digits` denotes the number of decimal digits of working precision. That's not the same as promising that many digits of accuracy.

@Danik For normal evaluation of expressions to floating-point, `Digits` denotes the number of decimal digits of working precision. That's not the same as promising that many digits of accuracy.

@awehring I used `map` because `simplify` applied to the entire rhs (after isolating for p) was undoing the effort by recombining the terms in the sum. But by mapping `simplify` across the terms in the sum (and so applying `simplify` individually to each term in the sum) the desired result was obtained. This made it a tricky scenario for using `simplify` after `collect`.

Simplification is a bit of an arcane art. The best way to learn is to read the documentation, other people's examples, and... practice.

@awehring I used `map` because `simplify` applied to the entire rhs (after isolating for p) was undoing the effort by recombining the terms in the sum. But by mapping `simplify` across the terms in the sum (and so applying `simplify` individually to each term in the sum) the desired result was obtained. This made it a tricky scenario for using `simplify` after `collect`.

Simplification is a bit of an arcane art. The best way to learn is to read the documentation, other people's examples, and... practice.

As wonderful as this alternate debugger is, why are it's facilities not in Maple itself? The debugger in the Standard GUI is so poor in quality, that the contrast is alarming.

As wonderful as this alternate debugger is, why are it's facilities not in Maple itself? The debugger in the Standard GUI is so poor in quality, that the contrast is alarming.

@icegood Yes, you can view non-exported module locals.

A note on that.

When modifying procedures from Maple's own Libraries, you might want to be careful to watch for values previously stored to remember tables or Cache (and possibly distinguish between those stored by default by the system and those stored previously in the current session).

@icegood Yes, you can view non-exported module locals.

A note on that.

When modifying procedures from Maple's own Libraries, you might want to be careful to watch for values previously stored to remember tables or Cache (and possibly distinguish between those stored by default by the system and those stored previously in the current session).

@serena88 

A:=Matrix([[1,4,1]]):

E11M:=Matrix(1,13):

for i from 1 to 6 do
nod:=(2*(i-1))+1;
E11M[1,nod..nod+2]:=E11M[1..1,nod..nod+2]+A;
end do:

E11M;

@serena88 

A:=Matrix([[1,4,1]]):

E11M:=Matrix(1,13):

for i from 1 to 6 do
nod:=(2*(i-1))+1;
E11M[1,nod..nod+2]:=E11M[1..1,nod..nod+2]+A;
end do:

E11M;

@ABond Here's another (made up) example.

restart:

sys:= diff(y(t),t) = cos( 1/2*y(t)-x(t)-Pi^2 ):
ini:= y(0)=10*sqrt(2)/2:

formula := abs(FF(t)) - sin(y(t))^2 - cos(y(t)) - 0.2*sqrt(t):

F[0]:=sin:

N:=10:

for i from 1 to N do
   newsys:=subs(x=F[i-1],sys);
   #print(newsys);
   sol[i]:=dsolve([newsys, y(0)=10*sqrt(2)/2], numeric,
                  output=listprocedure, known=F[i-1]):
   eval(y(t),sol[i])(0.2);
   F[i]:=unapply('evalf'(subs(y(t)=subsop(3=remember,eval(y(t),sol[i]))(t),
                              FF=F[i-1],
                              formula)),
                 t,numeric,proc_options=[remember]):
end do:

st:=time():
plot([seq(F[k],k=1..N)],0.1..2.0,legend=[seq(F[k],k=1..N)],
     color=[seq(RGB(0,1/((N-k+2)/7)^2,1-1/((N-k+2)/2)),k=1..N)],thickness=2);
time()-st;

@ABond Here's another (made up) example.

restart:

sys:= diff(y(t),t) = cos( 1/2*y(t)-x(t)-Pi^2 ):
ini:= y(0)=10*sqrt(2)/2:

formula := abs(FF(t)) - sin(y(t))^2 - cos(y(t)) - 0.2*sqrt(t):

F[0]:=sin:

N:=10:

for i from 1 to N do
   newsys:=subs(x=F[i-1],sys);
   #print(newsys);
   sol[i]:=dsolve([newsys, y(0)=10*sqrt(2)/2], numeric,
                  output=listprocedure, known=F[i-1]):
   eval(y(t),sol[i])(0.2);
   F[i]:=unapply('evalf'(subs(y(t)=subsop(3=remember,eval(y(t),sol[i]))(t),
                              FF=F[i-1],
                              formula)),
                 t,numeric,proc_options=[remember]):
end do:

st:=time():
plot([seq(F[k],k=1..N)],0.1..2.0,legend=[seq(F[k],k=1..N)],
     color=[seq(RGB(0,1/((N-k+2)/7)^2,1-1/((N-k+2)/2)),k=1..N)],thickness=2);
time()-st;

@ABond In your original question, you used `f` to denote the RHS (driving function) of the ODE. So I figured that is what you meant, when you wanted to replace x(t) in subsequent (iterated) solving steps with f(y_i(t)).

But you seem to also be using `f` to mean some arbitrary (composed) function of the solution y_i(t). That should be workable, just like in my initial answer. But instead of substituting into rhs(sys), you could use some other formula involving F[i] and y_i(t).

Do you have some other formula in mind? You suggest F[i-1]+f(y_i(t)). Ok, do you have a candidate for `f` there, or should I make one up?

@ABond In your original question, you used `f` to denote the RHS (driving function) of the ODE. So I figured that is what you meant, when you wanted to replace x(t) in subsequent (iterated) solving steps with f(y_i(t)).

But you seem to also be using `f` to mean some arbitrary (composed) function of the solution y_i(t). That should be workable, just like in my initial answer. But instead of substituting into rhs(sys), you could use some other formula involving F[i] and y_i(t).

Do you have some other formula in mind? You suggest F[i-1]+f(y_i(t)). Ok, do you have a candidate for `f` there, or should I make one up?

First 8 9 10 11 12 13 14 Last Page 10 of 81