nm

11353 Reputation

20 Badges

13 years, 11 days

MaplePrimes Activity


These are questions asked by nm

I was not expecting to see step-by-step for this ode, but why does it give internal error instead of saying not supported? 

Am I doing something wrong in the call? Unfortunately, this Maple internal error can't be trapped at user level. Which means the whole program terminates also.

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1820 and is the same as the version installed in this computer, created 2024, September 28, 18:14 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

ode:=3*diff(y(x),x$2)+x*diff(y(x),x)-4*y(x)=0;

3*(diff(diff(y(x), x), x))+x*(diff(y(x), x))-4*y(x) = 0

Student:-ODEs:-ODESteps(ode,y(x))

Error, (in anonymous procedure called from Student:-ODEs:-ODESteps) too many levels of recursion

try
   Student:-ODEs:-ODESteps(ode,y(x));
catch:
  print("cought the error ");
end try;

Error, (in anonymous procedure called from Student:-ODEs:-ODESteps) too many levels of recursion

 


 

Download too_many_Levels_odesteps_oct_14_2024.mw

 

I never really understood Intat. Help says 

"The intat command expresses an integral evaluated at a point; it is analogous to using the D command to express a derivative evaluated at a point."

But slope at a point is clear what it is and one can visualize it.

I do not understand what integral at single point means.

If one thinks of integration as area under the curve of the function, so what does area at single point mean? Should not integration (definite) always have lower and upper limits?

But my main question is not the above. I am sure there is a valid reason for Intat, otherwise it will not be in Maple.

But my quesiton is, in the context of solution to ode, can one replace result given using Intat by Int such that the lower limit starts from zero, and using same upper limit?

ie change Intat(...., a_ = something)  by Int( ... , a_ = 0 ... something) without changing the semantics or the correctness of the solution?

Because in  Intat, the lower limit is empty, and this always bothered me. At school the teacher says definite integration should have both lower and upper limits.

I tried it few places, and odetest verifies the solution of ode when using Intat or when using Int with lower limit zero:

ode:=diff(y(x), x) = B + C*f(a*x + b*y(x));

diff(y(x), x) = B+C*f(a*x+b*y(x))

sol_1:=Intat(1/(C*f(_a*b)*b+b*B+a),_a = (a*x+b*y(x))/b)*b-x+_C1 = 0;
sol_2:=Int(1/(C*f(_a*b)*b+b*B+a),_a = 0..(a*x+b*y(x))/b)*b-x+_C1 = 0;

Intat(1/(C*f(_a*b)*b+b*B+a), _a = (a*x+b*y(x))/b)*b-x+_C1 = 0

(Int(1/(C*f(_a*b)*b+b*B+a), _a = 0 .. (a*x+b*y(x))/b))*b-x+_C1 = 0

odetest(sol_1,ode);

0

odetest(sol_2,ode);

0

 

 

Download intat_vs_int.mw

Is there a case you know, where solution of ode which has Intat, when replaced by Int with lower limit 0, will no longer verifies the ode?  I am not able to find one so far. But may be there is.
 

Update

fyi, I found case where it makes difference. Not for odetest, but when using value. When using Int(...,tau=0..upper) vs   Intat(....,tau=upper)

value was able to find the value when using Intat, but not when using Int (for this example). 

So I think I will just stick to Intat even though both verified the ode as valid solution as it is better to be able to find value for integral if possible. I knew there must be good reason why Intat was invented.

 

ode:=diff(y(x),x)= sin(x-y(x));

diff(y(x), x) = sin(x-y(x))

sol_1:=Int(1/(1 - sin(tau)), tau = 0..x - y(x)) = x + _C1;
sol_2:=Intat(1/(1 - sin(tau)), tau = x - y(x)) = x + _C1;

Int(1/(1-sin(tau)), tau = 0 .. x-y(x)) = x+_C1

Intat(1/(1-sin(tau)), tau = x-y(x)) = x+_C1

odetest(sol_1,ode);

0

odetest(sol_2,ode);

0

value(sol_1);

int(1/(1-sin(tau)), tau = 0 .. x-y(x)) = x+c__1

value(sol_2);

-2/(tan((1/2)*x-(1/2)*y(x))-1) = x+c__1

 


 

Download int_vs_intat_v2.mw

 

I have expression which can have many different functions  in it. Assume the expression is `+` type.

I do not know before what these function names are. 

Is there a way to make Maple collect on these functions automatically? Simplify does not do it. So if there is something like b*g(x)+g(x) in the expression, to simplify this to (1+b)*g(x) automatically?

I noticed if expression is   just b*g(x)+g(x) then simplify does give (1+b)*g(x) but once I add a new term, like 3+b*g(x)+g(x) then it no longer does it! which for me is very strange. I was expecting to get 3+(1+b)*g(x) 

Here is an example

restart;

T:=g(x)+b*g(x);
simplify(T);

g(x)+b*g(x)

g(x)*(b+1)

T:=3+g(x)+b*g(x);
simplify(T);

3+g(x)+b*g(x)

3+g(x)+b*g(x)

T:=3+g(x)+b*g(x)+f(x);
simplify(T);

3+g(x)+b*g(x)+f(x)

3+g(x)+b*g(x)+f(x)

 

 

Download simplification_oct_9_2024.mw

What do I need to do to get this output using another software

Ofcourse, I could go and add code to find the names of each function and then use collect. But it seems to me simplify should have done this automatically as the above shows. So I am wondering if there is an option I've overlooked which will do this more easily.

Maple 2024.1

This is probably asked before but can't find it. 

After making a plot, then RIGHT-CLICKing on it, option menu comes up that allows one to modify the plot (like adding gridlines, or change the line style).

How does one find the Maple command after doing such changes, so one can use the command in the code?

Here is an example. I modified a little acers plot in this answer and added the points to the plot

eq:=-0.0004*x^2 - 2.7680*10^(-28)*x^12 - 2.1685*10^(-43)*x^18 - 1.3245*10^(-37)*x^16 - 1.6917*10^(-32)*x^14 + 0.7650 + 6.6773*10^(-18)*x^8 - 2.5543*10^(-23)*x^10 - 8.0002*10^(-13)*x^6 + 3.6079*10^(-8)*x^4 = 0:
the_roots:=fsolve(eq):	
the_roots:=map(X->[X,0],[the_roots]):
p1:=plot(lhs(eq),x=-210..210,size=[500,200]):
p2:=plot(the_roots,style=point, color=red, symbol=solidcircle, symbolsize=20):
plots:-display(p1,p2)

 

I was lazy to look up the grid option syntax. So right clicked on the plot and found option to add gridline. So said, great. And the above is the result.

But now I'd like to see the command used so I know where the grid option goes and how its syntax is. There does not seem to be option in the interface to display the Maple command used.

How would one find it?

Maple 2024.1 on windows 10

 

What is the correct idiom in Maple to check that one number is greater than another or not?

For example if n=sqrt(3) and m=3 ?

Maple does not like to compare sqrt(3) with other number. It says 

   Error, cannot determine if this expression is true or false: 3 <= 3^(1/2)

I am doing this in code, so solution has to be such that it works for all cases of n and m, without the ability to look at screen and decide.

I found that using is works without the need to convert to float.  Should one then use is(n>=m) instead of evalb(n>=m) always?  

I can also always apply evalf() on each side before. But this seems like an overkill to me.

restart;

n:=sqrt(3);
m:=3;

3^(1/2)

3

if evalb(n>=m) then
   "yes";
else
   "no";
fi;

Error, cannot determine if this expression is true or false: 3 <= 3^(1/2)

if n>=m then
   "yes";
else
   "no";
fi;

Error, cannot determine if this expression is true or false: 3 <= 3^(1/2)

if evalb(evalf(n)>=m) then
   "yes";
else
   "no";
fi;

"no"

if is(n>=m) then
   "yes";
else
   "no";
fi;

"no"

 

 

Download checking_one_number_larger_than_another.mw

For reference, another software does compare these two numbers as is without the need to convert them to floating point;

But it looks the design of Maple in this aspect is different. Since the principal root of sqrt(3) is always the positive one, I did not think it will cause a problem.

First 15 16 17 18 19 20 21 Last Page 17 of 199