nm

10416 Reputation

19 Badges

12 years, 187 days

MaplePrimes Activity


These are questions asked by nm

Why Maple can not do this basic combining of two terms? What do  I need to do to help Maple do it? Am I not using the correct command?

restart;

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 1795 and is the same as the version installed in this computer, created 2024, August 28, 23:14 hours Pacific Time.`

e:=B^2/(4*(k^n)^(2/3)) - (k^n)^(1/3)*x;

(1/4)*B^2/(k^n)^(2/3)-(k^n)^(1/3)*x

combine(e);

(1/4)*B^2/(k^n)^(2/3)-(k^n)^(1/3)*x

combine(e,symbolic)

(1/4)*B^2*k^(-(2/3)*n)-k^((1/3)*n)*x

combine(e,power)

(1/4)*B^2/(k^n)^(2/3)-(k^n)^(1/3)*x

combine(e,radical)

(1/4)*B^2/(k^n)^(2/3)-(k^n)^(1/3)*x

combine(e,radical,symbolic)

(1/4)*B^2/(k^n)^(2/3)-(k^n)^(1/3)*x

combine(e) assuming positive;

(1/4)*B^2*k^(-(2/3)*n)-k^((1/3)*n)*x

combine(e,abs)

(1/4)*B^2/(k^n)^(2/3)-(k^n)^(1/3)*x

 

 

Download how_to_combine_august_28_2024.mw

For reference, using another software, this is what it gives

I do not know if this is how it always been in Maple. But now I noticed when I set assertlevel to 2, in order to catch wrong assignment type in my code, the try/catch do not catch such an error.  

My question is: Has it always been like this in Maple? May be it was, I am just asking for confirmation. I seem to remember I was able to trap such error before.

Here is MWE

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 1793 and is the same as the version installed in this computer, created 2024, August 25, 9:6 hours Pacific Time.`

libname;

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

restart;

interface(warnlevel=4):
kernelopts('assertlevel'=2):

 

foo:=proc();
local C_sol::list;
   try
      C_sol := 1;
   catch:
      print("error detected in my code");
   end try;
end proc:

foo(); #unable to catch assignment error

Error, (in foo) assertion failed in assignment to C_sol, expected list, got 1

 

 

Download why_trap_do_not_catch_assignment_error.mw

I sort of remember there is a special syntax for setting initial condition for an ode derivative as    y'(a)=b, where and are symbols. I forgot what it is, everything I try gives error. (I thought eval was used to work for this, but can't get it to work now).

Any one knows how to set this IC?   For an example, given this ode y''(x)+y'(x)+y(x)=0 I want to solve it with the IC as   y'(a)=b where has no numerical value. Just a symbol.

For an example, using another software, it is done as follows

ClearAll[x,y,a,b];
ode=y''[x]+y'[x]+y[x]==0;
DSolve[{ode,y'[a]==b},y[x],x]

Below is my attempts in Maple. I tried eval, subs, and the normal D(y)(a)=b but none of these works when is symbol. 

I looked at help and all examples I saw use constants, as in D(y)(0)=value. 

Iam sure this is possible to do in Maple, but I forgot how. Below is worksheet.
 

interface(version);

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

restart;

ode:=diff(y(x),x$2)+diff(y(x),x)+y(x)=0;
IC1:=eval(diff(y(x),x),x=a)=b;
IC2:=D(y)(a)=b;
IC3:=subs(x=a,D(y)(x)=b);

diff(diff(y(x), x), x)+diff(y(x), x)+y(x) = 0

diff(y(a), a) = b

(D(y))(a) = b

(D(y))(a) = b

dsolve([ode,IC1]);

Error, (in dsolve) found differentiated functions with same name but depending on different arguments in the given DE system: {y(a), y(x)}

dsolve([ode,IC2]);

Error, (in dsolve) found differentiated functions with same name but depending on different arguments in the given DE system: {y(a), y(x)}

dsolve([ode,IC3]);

Error, (in dsolve) found differentiated functions with same name but depending on different arguments in the given DE system: {y(a), y(x)}

#eval works if the point is actual value as in
IC1:=eval(diff(y(x),x),x=0)=b;

eval(diff(y(x), x), {x = 0}) = b

#but I want x=a in the above.


Download how_to_set_IC_point_to_symbol.mw

There is no issue for dirichlet initial condition, where  y(a)=b works. It is the  neumann one which I can't figure its syntax. So this works OK

ode:=diff(y(x),x$2)+diff(y(x),x)+y(x)=0;
IC1:=y(a)=b;
dsolve([ode,IC1]);

Maple help pages keep getting worst with each release.

I want all input to be displayed using Maple 1D notation, so I can copy the example to my worksheet since I only use worksheet and not document (2D) mode.

So even though the first thing I do when I open help it to turn off the 

                     view->Display examples with 2D

So it is no longer checked, I still see many pages using 2D math for input. 

Here is one example ?D  page

If I copy one such input to my worksheet now it looks like this

eveything in 2D becomes ?? when I copy it.

So one can only look but not copy?

Is there any other option to make sure, really make sure, all examples have 1D as input?

The problem is that it is all not consistent. Some examples have a mix of 2D and 1D as the above page. Some are in 2D and some are in 1D.

And this is all on the same help page!

Does no one inside Maplesoft even look at their own help pages?
 

At school the teacher always said that if we have second order ode and only one initial conditions (say y'(0)=0 or y(0)=0) then the solution should have one constant of integration in it.

And if we have no initial conditions, then the solution should have 2 constants of integrations in it.

And if we have two initial conditions, then the solution should have zero constants of integrations in it.

In this example, Maple is given second order ode with one IC. But the solution it gives when asked to solve it explicit, has no constant of integration in it at all. 

When asked to solve it using implicit, then the constant of integration shows up. 

Both solutions actually verify to be fully correct using odetest. So it looks like the solution as explicit is particular solution and not a general solution.

Why is that? Why it did not give general solution when asked to solve the ode as explicit?

restart;

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 1793 and is the same as the version installed in this computer, created 2024, August 25, 9:6 hours Pacific Time.`

libname;

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

restart;

ode:=y(x)*diff(y(x),x$2)+diff(y(x),x)^2+1=0;
IC:=D(y)(0)=1;

y(x)*(diff(diff(y(x), x), x))+(diff(y(x), x))^2+1 = 0

(D(y))(0) = 1

sol1:=dsolve([ode,IC],explicit);
 

y(x) = (-x^2+x*2^(1/2)+1/2)^(1/2)

sol2:=dsolve([ode,IC],implicit);

-(1/2)*y(x)^2+x*y(0)-(1/2)*x^2+c__2 = 0

odetest(sol1,[ode,IC]);
odetest(sol2,[ode,IC]);

[0, 0]

[0, 0]

 

 

Download why_missing_constant_of_integration_august_25_2024.mw

First 8 9 10 11 12 13 14 Last Page 10 of 189