nm

10204 Reputation

19 Badges

12 years, 145 days

MaplePrimes Activity


These are questions asked by nm

I am also not sure how to program a check in the code to determine that dsolve solved the differential equation.

For example

ode:=diff(y(x),x)-a*(x^n-x)*y(x)^3-y(x)^2=0;
sol:=dsolve(ode,y(x));

In this case, sol is () as it could not solve it. When I tried odetest, I get an error

odetest(sol,ode);

Error, invalid input: odetest uses a 2nd argument, ODE, which is missing

What is the correct way to check dsolve was successful that will work for all cases? I am looking for programmable method, no GUI use.

 

 

 

 

In Maple help on int, it says

"If Maple cannot find a closed form expression for the integral, the function call itself is returned"

But then, what is the correct way to check for this in the code? How do I know that the result returned is the call I made? (it would have been easier if these functions throw an error, or set some status code that one can check for success or failure).

Why this simplifes:

z1:=n*(Int(cos(x)^(n-2), x))-(Int(cos(x)^(n-2), x));

simplify(z1);

But when adding an extra term to z1, it no longer simplfies the above any more:

z2 := cos(x)^(n-1)*sin(x)+n*(Int(cos(x)^(n-2), x))-(Int(cos(x)^(n-2), x));

simplify(z2);

You can see the second term, which is z1, was not simplfied any more.

Why? And how would one go about simplifying z2 such that the second term gets simplfies as with z1, but while using z2 expression. It seems simplify stopped at first term and did not look ahead any more?

Maple 18.02, windows.

Given expr:=sin(n*x); and say I want to find its value at n=1,x=Pi/2, I found I can do

subs({n=1,x=Pi/2},expr); eval(%);

or combine into one

eval(subs({n=1,x=Pi/2},expr); ----(1)

But also one can write

eval(expr,{n=1,x=Pi/2}); ----- (2)

So if someone wants to just find value of expression as above, it seems (2) is much simpler than (1) since no need to call subs, it is done automatically. Is there anything else I am overlooking?

Only problem I see in the above, is that subs() uses different order: subs({},expr), while eval is:  eval(expr,{}); The other way around.

It would have been better if the order was the same in the API, to reduce confusion.

 

 

sometimes when I download something from Maple apps centers, such as this package, http://www.maplesoft.com/applications/view.aspx?SID=33406  I find the example documents there are written in .mw and when I open them, there are in document mode style, the fancy word like style which I can't stand looking at.  It has all the math input in italic and maple commands look different from classic Maple text. It very confusing, since I see something as   (0<x<1) which is valid in this document mode, but in classical maple, this is not valid code.

 

It seems Maple has 2 different syntax. One that works in document mode and one that is classical text maple.

I like to use only input as Maple notation which these documents do not do.

Is there a way to convert such .mw file to become standard classic worksheet mode? I know I will lose the chapter/section heading and all that.  I also tried selecting all in the document, then did Tools->options->Display->Input display->Maple notation, but nothing happend to the open document. It remained document mode with 2D math input.

When I save it as .mws, and open it again, it remains on document mode.

How to convert such documents to classical Maple syntax?

 

 

First 167 168 169 170 171 172 173 Last Page 169 of 185