Robert Israel

6577 Reputation

21 Badges

18 years, 215 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are replies submitted by Robert Israel

... just one more example of why 2D input should be avoided, especially by inexperienced users.

Note that the equation diff(v(x,y),x) = 0 means v(x,y) is constant in x.  The boundary condition v(0,y) = 150 then implies that v(x,y) = 150 everywhere.  But the boundary condition v(x,1) = 300 contradicts that.  So it's not surprising that Maple doesn't come up with a solution.

If you take v(x,y) = 150, the first equation becomes

150000000*diff(T(x,y),x)-.1*diff(T(x,y),y$2) = 0

Now pdsolve(..., numeric) requires one of the independent variables to be thought of as "time".  If that variable is x, then you should have
one initial condition for T at one value of x (just one initial condition, since the equation is first-order in x), two boundary conditions for T at values of y (since the equation is second-order in y).  Thus you could try something like

> pdsolve(150000000*diff(T(x,y),x)-.1*diff(T(x,y),y$2), {T(-0.3,y) = 400, T(x,0) = 400, T(x, 1) = 350}, numeric);

I also tried the system sys5 with these initial and boundary conditions for T and an initial condition for v (no boundary condition, because the equation for v is 0'th order in y).

> S:=pdsolve(sys5, {T(-0.3,y) = 400, T(x,0) = 400, T(x, 1) = 350,v(-0.3,y)=y}, numeric);

But this gave me an error:

Error, (in pdsolve/numeric/par_hyp) input system is too far from a 'standard' form (see ?pdsolve,numeric for more detail)

So Maple doesn't know how to handle this type of system (it would work if diff(v(x,y),y)^2 was replaced by v(x,y)^2), or if the second PDE was diff(v(x,y),x,y) = 0).


Note that the equation diff(v(x,y),x) = 0 means v(x,y) is constant in x.  The boundary condition v(0,y) = 150 then implies that v(x,y) = 150 everywhere.  But the boundary condition v(x,1) = 300 contradicts that.  So it's not surprising that Maple doesn't come up with a solution.

If you take v(x,y) = 150, the first equation becomes

150000000*diff(T(x,y),x)-.1*diff(T(x,y),y$2) = 0

Now pdsolve(..., numeric) requires one of the independent variables to be thought of as "time".  If that variable is x, then you should have
one initial condition for T at one value of x (just one initial condition, since the equation is first-order in x), two boundary conditions for T at values of y (since the equation is second-order in y).  Thus you could try something like

> pdsolve(150000000*diff(T(x,y),x)-.1*diff(T(x,y),y$2), {T(-0.3,y) = 400, T(x,0) = 400, T(x, 1) = 350}, numeric);

I also tried the system sys5 with these initial and boundary conditions for T and an initial condition for v (no boundary condition, because the equation for v is 0'th order in y).

> S:=pdsolve(sys5, {T(-0.3,y) = 400, T(x,0) = 400, T(x, 1) = 350,v(-0.3,y)=y}, numeric);

But this gave me an error:

Error, (in pdsolve/numeric/par_hyp) input system is too far from a 'standard' form (see ?pdsolve,numeric for more detail)

So Maple doesn't know how to handle this type of system (it would work if diff(v(x,y),y)^2 was replaced by v(x,y)^2), or if the second PDE was diff(v(x,y),x,y) = 0).


"err" is the distance your x is changing on this step.  You want to stop when that is near 0.  If you just took err:= abs(evalf(a)), that would always be around 2.23...
and you would never stop.

For your second problem: Newton's method is supposed to find a (real) solution of f(x) = 0.  What do you expect it to do if there is no solution?

 

The problem is that the Input Format for this posting was Plain Text rather than Filtered HTML.  For some reason (unknown to me), some of my postings are put into Plain Text format.  You can change this if you click on Input Format below the region where you enter the code.  I don't usually see the setting before I post (unless I use "preview comment"), but if necessary I use Edit and change the format.

The problem is that the Input Format for this posting was Plain Text rather than Filtered HTML.  For some reason (unknown to me), some of my postings are put into Plain Text format.  You can change this if you click on Input Format below the region where you enter the code.  I don't usually see the setting before I post (unless I use "preview comment"), but if necessary I use Edit and change the format.

It looks like your program has one if statement



if A = true then ...


with two else clauses

else
       NULL;
else
    if B >= C then ...

Since Maple says `else unexpected`, that's what it looks like to Maple too.

It looks like your program has one if statement



if A = true then ...


with two else clauses

else
       NULL;
else
    if B >= C then ...

Since Maple says `else unexpected`, that's what it looks like to Maple too.

I'm confused.  I get the same answer for both cases. 

> Eq2:=diff(W(t), t) = 0.304*W(t)-0.1916e-1*R(t)-2981*exp(0.295e-3*t)+2180-.36*H(t)+.6*(diff(R(t), t));
> Eq3:= subs(diff(R(t),t) = 0, Eq2);
> dsolve({diff(R(t),t) = 0, Eq2}, {R(t), W(t)});
> dsolve({diff(R(t),t) = 0, Eq3}, {R(t), W(t)});

Both give me the same answer:

{R(t) = _C2, W(t) = (Int(2180*exp(-38*t*(1/125))-479*exp(-38*t*(1/125))*_C2*(1/25000)-2981*exp(-60741*t*(1/200000))-9*exp(-38*t*(1/125))*H(t)*(1/25), t)+_C1)*exp(38*t*(1/125))}

I'm confused.  I get the same answer for both cases. 

> Eq2:=diff(W(t), t) = 0.304*W(t)-0.1916e-1*R(t)-2981*exp(0.295e-3*t)+2180-.36*H(t)+.6*(diff(R(t), t));
> Eq3:= subs(diff(R(t),t) = 0, Eq2);
> dsolve({diff(R(t),t) = 0, Eq2}, {R(t), W(t)});
> dsolve({diff(R(t),t) = 0, Eq3}, {R(t), W(t)});

Both give me the same answer:

{R(t) = _C2, W(t) = (Int(2180*exp(-38*t*(1/125))-479*exp(-38*t*(1/125))*_C2*(1/25000)-2981*exp(-60741*t*(1/200000))-9*exp(-38*t*(1/125))*H(t)*(1/25), t)+_C1)*exp(38*t*(1/125))}

> eval(r*t-s^2, op(V[1]));

 

> eval(r*t-s^2, op(V[1]));

 

It does know this, however:

> convert(1/sqrt(1-(x+h)),FormalPowerSeries,h); 
  ak:= op(1,A)/h^k;

ak := factorial(2*k)*(-1/(4*(x-1)))^k/(sqrt(-x+1)*factorial(k)^2)

> convert(1/sqrt(1+(x+h)),FormalPowerSeries,h); 
  bk:= op(1,B)/h^k;

bk := factorial(2*k)*(-1/(4*(x+1)))^k/(sqrt(x+1)*factorial(k)^2)

 

So the answer should be:

> simplify(k! * sum(eval(ak,k=j)*eval(bk,k=k-j),j=0..k)) assuming x>-1,x<1, k::posint;

sqrt(2)*sqrt(Pi)*(-1)^(1/4)*LegendreP(-1/2, k+1/2, -x)*(1/(-1+x^2))^((1/2)*k)/(2*(x+1)^(1/4)*(-x+1)^(1/4))

which, I think, is correct.

[ Why is the <maple> tag not working? ]

It does know this, however:

> convert(1/sqrt(1-(x+h)),FormalPowerSeries,h); 
  ak:= op(1,A)/h^k;

ak := factorial(2*k)*(-1/(4*(x-1)))^k/(sqrt(-x+1)*factorial(k)^2)

> convert(1/sqrt(1+(x+h)),FormalPowerSeries,h); 
  bk:= op(1,B)/h^k;

bk := factorial(2*k)*(-1/(4*(x+1)))^k/(sqrt(x+1)*factorial(k)^2)

 

So the answer should be:

> simplify(k! * sum(eval(ak,k=j)*eval(bk,k=k-j),j=0..k)) assuming x>-1,x<1, k::posint;

sqrt(2)*sqrt(Pi)*(-1)^(1/4)*LegendreP(-1/2, k+1/2, -x)*(1/(-1+x^2))^((1/2)*k)/(2*(x+1)^(1/4)*(-x+1)^(1/4))

which, I think, is correct.

[ Why is the <maple> tag not working? ]

Both implicitplot and implicitplot3d, given an expression f, plot the curve or surface f = 0.  So (x^2 - y^2)/(x^2 + y^2) and x^2 - y^2 are the same from that point of view (except that (x^2 - y^2)/(x^2 + y^2) is not defined at [0,0]).  I repeat, what is "the limit" that you are trying to show does not exist?  Do you mean the limit of
(x^2-y^2)/(x^2+y^2)?  In that case, I think you want to look at something like

plot3d(  (x^2 - y^2)/(x^2 + y^2), x = -1 .. 1, y = -1 .. 1, axes = boxed);

 

First 99 100 101 102 103 104 105 Last Page 101 of 187