Preben Alsholm

13743 Reputation

22 Badges

20 years, 334 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@lesshaste I would do it the same way (eval or subs, no real difference in this case).

To get a sequence of A(0) for n = 2 to (e.g. 10) one could do:

S:=NULL:
for n from 2 to 10 do
  SA:=seq(RA,k=0..n-2);
  SB:=seq(RB,k=1..n-1);
  S:=S,subs(solve({SA,SB},{seq(A(k),k=0..n-2),seq(B(k),k=1..n-1)}),A(0))
end do:
S;
evalf(S);

@lesshaste I would do it the same way (eval or subs, no real difference in this case).

To get a sequence of A(0) for n = 2 to (e.g. 10) one could do:

S:=NULL:
for n from 2 to 10 do
  SA:=seq(RA,k=0..n-2);
  SB:=seq(RB,k=1..n-1);
  S:=S,subs(solve({SA,SB},{seq(A(k),k=0..n-2),seq(B(k),k=1..n-1)}),A(0))
end do:
S;
evalf(S);

@Douglas Lewit Done, hopefully. But I think you should have suppressed the output from balance2 and Balance2.

@Carl Love Thanks for pointing that out to me. I have noticed it often enough, so I should know better. It always has had to do with < or > and maybe only after I edit an already posted reply.

I haven't made actual experiments with this, only noticed it and been quite annoyed by it.

I have inserted the intended lines again. Hopefully, they will remain as intended.

@Carl Love Thanks for pointing that out to me. I have noticed it often enough, so I should know better. It always has had to do with < or > and maybe only after I edit an already posted reply.

I haven't made actual experiments with this, only noticed it and been quite annoyed by it.

I have inserted the intended lines again. Hopefully, they will remain as intended.

@Markiyan Hirnyk My point was (as I also said) that the names the results from evalf  are assigned to have nothing to do with any unpredictable behavior by evalf. I was not criticizing your example as such, just that it didn't make that point.

@Markiyan Hirnyk My point was (as I also said) that the names the results from evalf  are assigned to have nothing to do with any unpredictable behavior by evalf. I was not criticizing your example as such, just that it didn't make that point.

If you give us the code as text, then you are more likely to get a response.

But clearly something like diff(x(0),t) would evaluate to zero resulting in 0=0 in the initial conditions.

You need to write D(x)(0)=0 instead.

But the variable names have nothing to do with it though.

restart;
with(RandomTools):
s := evalf(Generate(list(rational(denominator = 30), 10)));
s1 := evalf(Generate(list(rational(denominator = 30), 10)));
restart;
with(RandomTools):
s1 := evalf(Generate(list(rational(denominator = 30), 10)));
s := evalf(Generate(list(rational(denominator = 30), 10)));

But the variable names have nothing to do with it though.

restart;
with(RandomTools):
s := evalf(Generate(list(rational(denominator = 30), 10)));
s1 := evalf(Generate(list(rational(denominator = 30), 10)));
restart;
with(RandomTools):
s1 := evalf(Generate(list(rational(denominator = 30), 10)));
s := evalf(Generate(list(rational(denominator = 30), 10)));

A version not using identify:

interface(displayprecision=5);
evalindets(k,numeric,evalf[18]):
evalindets(%,`^`,x->op(1,x)^convert(op(2,x),rational));

A version not using identify:

interface(displayprecision=5);
evalindets(k,numeric,evalf[18]):
evalindets(%,`^`,x->op(1,x)^convert(op(2,x),rational));

@Axel Vogt Maple agrees:

sum(2*k-1,k=1..n);
expand(%);

@Axel Vogt Maple agrees:

sum(2*k-1,k=1..n);
expand(%);

Did you try the code in my comment? It reproduces the graphs on the top of page 5 rather exactly. It uses equtions 13 and 14. By r^2 is meant the inner product of r with r, i.e. <x,y>.<x,y> = x^2 + y^2.

First 186 187 188 189 190 191 192 Last Page 188 of 231