nm

9271 Reputation

19 Badges

12 years, 10 days

MaplePrimes Activity


These are questions asked by nm

I'd like to bind a symbol to some expression, but display the expression analytically before evaluating, and show the value on the same line (not new line).

Something like:

restart;
a:=10: b:=3:
f:='a+b^2';`=`,f;

But this display the expression and its numerical value on 2 lines. I'd like to get this output:

      f:=a+b^2 ,`=`,19  

This is just so I can see the expression before it is evaluated, and its numerical value on same line. Or if there is a better way do this. I tried using print, but could not get the assignment to work then.

 

I am not sure why Maple gives this:

r:=int( 1/(x+sqrt(x)),x);

Using Mathematica and Matlab, the answer should be

   2 Log[1 + Sqrt[x]]

At x=1, Maple result is not defined, since log(0), but Mathematica gives a numerical value for 2*log(2)

Is this a brach cut issue? Could someone please verify this. I am using Maple 17.02

The real part of both solutions agree for x>1, but Maple answer ofcourse has a complex part, and that is what I am wondering about. Is Maple correct, and Mathematica should have returned that? May be a Math expert can comment.

 

 

I was looking at a question on another forum, and tried in Maple also, and Maple also have a problem with this integral. Here is a simple version. The problem is that int() gives different numerical answer from evalf(Int). Maple can't solve this analytically, so values have to be used for the integrand before calling int()

restart;
eq2:=(a/(a + c*z))^L*exp(-z)/sqrt(z);

L:=2:
a:=10^(0.1):
b:=10^(0.1):
c:=0.01*a:
int(eq2,z=0..infinity);   # 177.245
evalf(Int(eq2,z=0..infinity));   # 1.7551


I think the 1.7551 is the correct value. My question is: Why did maple give wrong answer from int()? Is it analytical reason, or purely numerical?

Maple 17.02, windows 7.

I was answering this question on another platform, and wanted to compare with Maple. On Matlab, this is the result

format long
916.536 + 3.3

      9.198359999999999e+02

When using Maple I get

evalhf(916.536 + 3.3);
919.836000000000013

I am on a 64 bit intel PC, and the OS is windows 7, 64 bit, and I my Maple is 64 bit version also.

Using Mathematica on my PC, which is 64 bit also, I get same as Matlab:

FullForm[916.536 + 3.3]
919.8359999999999`

and help on evalhf says:
"A call to evalhf evaluates an expression to a numerical value using the floating-point
hardware of the underlying system. The evaluation is done in double precision."

So, the question is, why I am not gettting the same result as those others shown above?
May be it has to do with this:

"The evalhf function converts all its arguments to hardware floats, computes the answer
and converts the answer to a Maple float result."

?

Is there a way to tell Maple to expand a complex function in Laurent series around a point, and have it show the series expansion that are valid for different regions? Either by the user telling it which region to use, or it automatically shows all regions?

For example, given

f(z):= z-> (3*z+1)/((z-1)*(z+1))

This has a pole at z=1 and at z=-1. I want to expand this around z=1. Hence it will have Laurent series in the annulus between z=1 and z=-1, but there is also region outside z=-1 that goes to infinity. So there are two regions.

When I do

with(numapprox);
laurent((3*z+1)/(z^2-1),z=1);

Maple gives the correct Laurent series for the region in the annulus |Z-1|<2, i.e. the first region (the one inside the two singularities).

But I want to see the expansion for different region, for |z-1|>2 (to check if I did it ok). This is what I get btw

3/(z-1) - 2/(z-1)^2 + 4/(z-1)^3 - 8/(z-1)^4 +.... 

Do I need a special package for this?

Fyi, I found this question here but it does not really answer my question. I want to speficy both the point of expansion, and also the region itself.

 

 

First 168 169 170 171 172 173 174 Page 170 of 175