Adri van der Meer

Adri vanderMeer

1420 Reputation

19 Badges

21 years, 152 days
University of Twente (retired)
Enschede, Netherlands

MaplePrimes Activity


These are replies submitted by Adri van der Meer

@Heeka 

(1) Y_vals produces a list of y(x), for x=0, 0.1, 0.2, ..., 1.0.

(2) Comparison exact and numeric solution:

restart;
DE := (x+b*y(x))*diff(y(x),x) + y(x) = 0;
BC := y(1)=1:
b := 1/10:
# exact solution:
sol1 := dsolve( {DE,BC}, y(x) ): Y1 := unapply( subs( sol1, y(x) ), x );
# numeric solution:
sol := dsolve( {DE,BC}, y(x), numeric, output=listprocedure ):
Y := subs( sol, y(x) ):
# comparison exact and numeric sulution
plot( Y1-Y, 0..1 );

Notice that in the display statement you must provide the plots as a sequence or list. If you use a set:

  plots:-display]( {A,B,C,E}, ...

the plots, and consequentlly the corresponding legends, are put in random order.

Notice that in the display statement you must provide the plots as a sequence or list. If you use a set:

  plots:-display]( {A,B,C,E}, ...

the plots, and consequentlly the corresponding legends, are put in random order.

... and if you want a plot of the derivative dpH/dVb:

plot( [VB,1/diff(VB,ph), ph=ph0..ph40], labels=["Vb",typeset(Diff(pH,Vb))] );

... and if you want a plot of the derivative dpH/dVb:

plot( [VB,1/diff(VB,ph), ph=ph0..ph40], labels=["Vb",typeset(Diff(pH,Vb))] );

@emma hassan If you want to use the assigned valies of the table B in the matrix, you have to remove the unassign command B := 'B':

@emma hassan If you want to use the assigned valies of the table B in the matrix, you have to remove the unassign command B := 'B':

@Carl Love I was trihggered by the words  "Existence and uniqueness" , which leads me automatically to IVP's!

@Carl Love I was trihggered by the words  "Existence and uniqueness" , which leads me automatically to IVP's!

@fias In this special case the for-loop is (perhaps the most) efficient.

But I supposed that your problem (because it is easily done by hand) was a simple example of more complicated recurrence equations.

@fias In this special case the for-loop is (perhaps the most) efficient.

But I supposed that your problem (because it is easily done by hand) was a simple example of more complicated recurrence equations.

Thank you, Carl, this helps.
I think it is not a bug, bacause when the function is not one-to-one there can be multiple solutions:

h := piecewise( x<1,x,x-1): solve(h=y,x): lprint(%);
piecewise(y < 0, [y], y < 1, [1+y, y], 1 <= y, [1+y])

Thank you, Carl, this helps.
I think it is not a bug, bacause when the function is not one-to-one there can be multiple solutions:

h := piecewise( x<1,x,x-1): solve(h=y,x): lprint(%);
piecewise(y < 0, [y], y < 1, [1+y, y], 1 <= y, [1+y])

@williamov 

(1) In the procedure Basisvector you initialize num6 als a number. This has to be a Vector:

BasisVector := proc(a, b, num)
  local result6, i;
  result6 := Vector(num);
  for i from 1 to num do
    result6[i] := 0;
  od;
  for i from 1 to num do
    result6[i] := Basis(convert(a(i, 1 .. -1),list), b);
  od;
  return result6;
end proc;

(2) Now we can see what Q is:

 BasisVector(<g1|g2|g3|g4|g5>, tdeg(x, y, h121, h122, h123, h124, h125), 2),
tdeg(x, y, h121, h122, h123, h124, h125),
'Q',2):
lprint(Q);

[-h124*y^3-h124*y-h125*x+h125*y-h121+1]

So Q is a list, not a rtable!

 nops(Q);
                               1

@williamov 

(1) In the procedure Basisvector you initialize num6 als a number. This has to be a Vector:

BasisVector := proc(a, b, num)
  local result6, i;
  result6 := Vector(num);
  for i from 1 to num do
    result6[i] := 0;
  od;
  for i from 1 to num do
    result6[i] := Basis(convert(a(i, 1 .. -1),list), b);
  od;
  return result6;
end proc;

(2) Now we can see what Q is:

 BasisVector(<g1|g2|g3|g4|g5>, tdeg(x, y, h121, h122, h123, h124, h125), 2),
tdeg(x, y, h121, h122, h123, h124, h125),
'Q',2):
lprint(Q);

[-h124*y^3-h124*y-h125*x+h125*y-h121+1]

So Q is a list, not a rtable!

 nops(Q);
                               1

2 3 4 5 6 7 8 Page 4 of 11