nm

8552 Reputation

19 Badges

13 years, 30 days

MaplePrimes Activity


These are questions asked by nm

Given this

z := -d*(y+a)+a;

and say we want to replace  a-a*d by c  so that the result is  c - d*y, but this does not work:

algsubs((a-a*d)=c,z);

since Maple does not "see" the d*a expression as it is not expanded yet.  Only when writing this it works:

algsubs((a-a*d)=c,expand(z));

At first I thought since this is an "algebraic" substitution, then Maple will figure it out on its own. But it seems that the expression being substititued has to explicity show there for it to work? Looking it help, it says

"Like subs, it does not expand products or powers before substitution"

So my question is: Is the rule of thumb when using algsubs, is to always expand the expression as in the above example?

Is there another Maple command or a package, which would have found this substition on its own? (i.e. without expanding first)

 

 

 

 

In Maple 2015:

 

restart;
with(Tolerances):
a:= 3 &+- 1;
b:= 2 &+- 1;
c:= 2 &+- 1;
solve(a*x^2+b*x+c=0,x);

gives "Error, (in evalr) improper op or subscript selector"

Is there a way to make it work with interval, i.e. Tolerances variables?  In Mathematica, the above works:

a = Interval[{2, 4}];
b = Interval[{1, 3}];
c = Interval[{1, 3}];
Solve[a*x^2 + b*x + c == 0, x]

Screen shot:

 

I was hoping to get similar result with Maple.  Is there differenet package/commands to work with interval variables in Maple that would support all operations if not this package?

 

These both work the same way

s1:=StringTools:-Join(["this is a ","test"]);
s2:=cat("this is a ","test");

When should one not use cat() command? It seems much simpler than Join. Are there cases where cat() will not work and Join will work?

according to help on timelimit

"Note: For efficiency reasons, the timelimit bound is ignored while in built-in routines."

Which is not very useful, since I want to limit  int() to some CPU time.

There are some integrals that can hang Maple easily. I'd like to set some CPU time on an int() and
have it terminate with error, but I am not able to find how to do that.

For example this

int((a+a*sin(f*x+e))^(1/2)*(c+d*sin(f*x+e))^(5/2),x)

Will hangs Maple.
Is there a trick some expert here can show to limit the CPU time on a build in operation?
May be some package or other command can do this?

I am only interested in int() now, but if it can work also on dsolve, that will be good.

thank you
ps. Mathematica supports putting time constraint on build-in commands. So I do
not see why Maple can't also do the same.

related topic is here

Suppose I have 2 differential equations in vector form, and I want to solve them using dsolve. I am not able to figure the syntax for what I would do for scalar ODE to initial its derivative at t=0, which is D(x)(0)=some_value, but do the same when x is a vector.

Here is an example:

restart;
x := t-> <x1(t),x2(t)>;
eq:=diff~(x(t),t$2) =~ <sin(t),t>;
ic1:=x(0)=~0;

So far so good. Now I wanted to also make initial conditions for derivative at zero to be some value. Only syntax I know is using D(x)(0)=some_value. But this works for scalar ODE. When I tried

ic2:=D(x)(0)=~0;

I got

This does not work:

ic2:=diff~(x)(0)=~0;

any help on the correct syntax to use? I am using Maple 2015

 

First 141 142 143 144 145 146 147 Last Page 143 of 164