MaplePrimes Questions

Suppose I have a list of differential equations:

L:=[x*diff(f(x),x)+2*x+1=0, 4*(diff(f(x),x$2))^2+7*diff(f(x),x)-2=0, x*diff(f(x),x)+2*x+1=0, 3*(diff(f(x),x))^2-f(x)-1=0];

how can I rewrite this list such that 
L:=[[x*diff(f(x),x)+2*x+1=0,2], [4*(diff(f(x),x$2))^2+7*diff(f(x),x)-2=0,1], [3*(diff(f(x),x))^2-f(x)-1=0,1]];
i.e., rewrite this list as the [equation, Number of occurrences in the list]

Hi all guys, it is simple equation, I wanna get the expression of w=()^(1/4) which consists zg & fg. I use solve command but fails, could you please help me?

NULL

p := (1/24)*z*g[u]+(1/24)*f*g[z]-(1/144000)*w^4*(f*g[z]+z*g[u])

(1/24)*z*g[u]+(1/24)*f*g[z]-(1/144000)*w^4*(f*g[z]+z*g[u])

(1)

solve(p = 0, w)

2*375^(1/4), (2*I)*375^(1/4), -2*375^(1/4), -(2*I)*375^(1/4)

(2)

NULL

Download solve_an_equation.mw

Dear all, why "has" always returns false ?

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'm struggling getting read statements to work in code attachments.

Are there any limitations for the read command?

Test.zip

Hi dear mapleprime users, i have a problem in a change of varibales if the following ode. i want to use "r=R*rs,u(r)=h*u(R*rs)" variable changes in ode, how can i do that, R is a constant. tnx for the help

restart;with(Student[ODEs]):

y := (1 + diff(u(r), r))*diff(u(r), r, r) + (1 + vs*u(r)/r + (1 - vs)/2*diff(u(r), r))*diff(u(r), r)/r - (1 + (1 + vs)/(2*r)*u(r))*u(r)/r^2

(1+diff(u(r), r))*(diff(diff(u(r), r), r))+(1+vs*u(r)/r+(1/2)*(1-vs)*(diff(u(r), r)))*(diff(u(r), r))/r-(1+(1/2)*(1+vs)*u(r)/r)*u(r)/r^2

(1)

constants := constants, R:

subs(r=R*rs,u(r)=h*u(R*rs),y) ;convert(%,D)

(1+diff(u(R*rs), R*rs))*(diff(diff(u(R*rs), R*rs), R*rs))+(1+vs*u(R*rs)/(R*rs)+(1/2)*(1-vs)*(diff(u(R*rs), R*rs)))*(diff(u(R*rs), R*rs))/(R*rs)-(1+(1/2)*(1+vs)*u(R*rs)/(R*rs))*u(R*rs)/(R^2*rs^2)

 

Error, invalid input: diff received R*rs, which is not valid for its 2nd argument

 
 

 

Download change_of_variables.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]);