nm

8552 Reputation

19 Badges

12 years, 348 days

MaplePrimes Activity


These are replies submitted by nm

@Carl Love 

Great. thanks. So may be this is a skill that needs to be acquired to know which command to use and which not to use each time, and it is not something one can reason about using logical steps.

For example, why would

convert(s,trig);
combine(%):

work, but not

convert(s,trig);
simplify(%);

and not

convert(s,trig);
convert(%,sinh);

and not

convert(s,trig);
convert(%,trigh);

and why simplify was needed to tell Maple that is same as

I mean, if this processes is based on trial and error method, then that is not a good way to go about it, but if there is a logic behind it, then that will be better.

computing the indefinite integral, then evaluating it on the intervals, then letting {p=1,n=1,q=1,m=1} in the result gives a divide by zero. Not -(1/2 I)/Pi. Just an observation, that is all.

restart;
assume(m::integer, n::integer, p::integer, q::integer,x::real):
h:=(x,m,n,p,q)->-(1/8*I)*(exp((2*I)*Pi*x)-1)^2*(exp(-(2*I)*Pi*x*(n-q+2))-exp(-(2*I)*Pi*x*(n-q+1)))/(Pi^3*x*(m-x)*(p-x)):
sol:=int(h(x, m, n, p, q), x):
sol:=subs(x=infinity,sol)-subs(x=-infinity,sol):
subs({p=1,n=1,q=1,m=1},sol);

     Error, numeric exception: division by zero

 

@acer 

strange that the good and bad ODE both give same analytic solution.

 

@Andriy 

"You should not use any CAS for such type of tasks."

I think the above statment is not fair and assumes many thing about the user.

Many use a CAS to verify a calculation that was already done by hand. For me, that is the main use of a CAS. To help me find if I made an error or not.

It is also possible that this specific calculation could be small part of very large program. So asking someone not do this step using CAS is simply not possible in this senario.

@Carl Love 

 

screen shot.... thanks

@Carl Love 

thanks. That is actually what I tried. it puts the 1/2 below the whole expression, which is not what I want. I wanted it to show like you showed it. I am using Maple 17.02 on windows 7, 64 bit. I use worksheet. Here it is:

@acer 

thanks. The syntax you showed really helps and I will use them.
But as I said, I do not have specific problem. Just was looking for shorter syntax. A typical use, is when I solve a set of ODE's and want to multiply the solution by some A matrix. So now, I was doing this:

ode1:=2*diff(x(t),t)+x(t)+diff(y(t),t)+2*y(t)=exp(t):
ode2:=3*diff(x(t),t)-7*x(t)+3*diff(y(t),t)+y(t)=0:
sol:=dsolve({ode1,ode2},{x(t),y(t)}):
A:=<< -10/3|-5/3>,<17/3|4/3>>;
A.convert(convert(map(rhs,sol),list),Vector);

with your syntax, I can do the last line above like this:

    A.<map(rhs,sol)[]>;

which is much shorter.   (I tend to prefer shorter syntax :)


thanks

@Carl Love 

Actually, I just tried it and it worked. No special reason. But simplify() works at that stage, so will edit my answer and replace convert to simplify.

 

I assumed you had a type  in (x+y)^2+(1)/x+y  and you meant  (x+y)^2+  1/(x+y), else the result you want to obtain do not follow....you might want to fix your question

@Carl Love 

Maple prime will not let me edit my own answer, it says "You do not have permission to delete this document". So, I'll see if it works here:

plot([f(x),diff(f(x),x)],x=-3..3,discont=true,legend=[typeset("f(x)"),typeset("f'(x)")]);


 

@Carl Love 

Thanks. I searched/googled for clear variable in Maple and did not see this. But this works.

In Particular, I got wrong information from this site:

http://www.cs.princeton.edu/courses/archive/fall09/cos323/symbolic/mapleSym.html

"This was done to clear the variable. Maple, unlike Mathematica, does not
have a Clear function for variables. Before using a variable in an equation
be sure you know what it represents or if you are not sure assign a constant
such as 1 or 0 to it."

 

@ThU 

Even if one is able to conver it to ODE. It will remain non-linear. And ODE can't solve non-linear ODE's (in general ofcourse).  Otherwise, why convert it to ODE in first place? Why not use intsolve() on it as is? One can't remove the non-linearity by converting it to ODE.

Without knowing what the non-linear integral equation is, hard to answer. Since each one might require different approach to solving.

@Markiyan Hirnyk 

Thanks. I actually tried this before posting:

dsolve(lhs(ode)=rhs(ode),{x(t),y(t)});

Error, (in dsolve) expecting an ODE or a set or list of ODEs. Received (Vector(2, {(1) = diff(x(t), t), (2) = diff(y(t), t)})) = (Vector(2, {(1) = 2*x(t)+y(t), (2) = 3*y(t)-x(t)}))

I did not think of trying your way with "-" instead:

dsolve(lhs(ode)-rhs(ode),{x(t),y(t)});

Strange why one works and not the other. But I am sure there is a good reason :)

If one thinks of a function as something that one can apply a known mathematical operation on, say differentiation or integration or any other defined operation that can be applied on a function in the mathematical sense, w.r.t its arguments, then one can easily make a rule to see the difference between a command and a function.

For example,  sin(x) is a function since diff(sin(x),x) is defined and int(sin(x),x) as well.

But plot(sin(x)) is not a function. Since one can't write diff( plot(sin(x)), sin(x) ), Also print(x) is not a function, since diff( print(x), x) is not defined and int( print(x), x) is not defined,  and so on.

So, may be this simple rule of thumb can make it easier to see which is a function and which is a command.

eq:=(3*x-y(x))*diff(y(x),x)=2*x;
dsolve(eq,y(x));

 

First 66 67 68 69 70 71 Page 68 of 71