125 Reputation

4 Badges

3 years, 337 days

MaplePrimes Activity

These are questions asked by DarkMath


I have two ordiary differential equations to be solved numerically. One of the equations can be solved independently (no need to solve the 2nd differential equation). However, in order to solve the 2nd differential equation, I need the numerical solution from the 1st one. 

sol1:=dsolve({ode1,x(0)=x__0, D(x)(0)=x__1},numeric, x(t), parameters=[a,b,c])


Now, I need to solve the 2nd differential equation which will give me y(t), but the differential equation depends on the function of x(t). What is the syntax of dsolve which incorporates the solution of another differential equation?




How one would define a function of a function-- a functional?


f(g(r)) := int(g(r), r)

I would like to get 


when I call it like


I could achieve this behaviour by substitions, but is there a nicer and shorter way of doing this?

Thanks in advance.


I was trying to simplify an expression using assume. However, I ended up with very long evaluation time and got an error: "Error, (in type/complex) too many levels of recursion". Here is the case:

Consider the following code:

simplify(csgn(a-b),assume=[a::real,b::real, a>0,b>0,a>b])

this gives 1 as expected.

However, if I run the following code:

simplify(csgn(a-b[2]),assume=[a::real,b[2]::real, a>0,b[2]>0,a>b[2]])

I get an error ""Error, (in type/complex) too many levels of recursion" after along evaluation. The last condition a>b[2] is causing the along evaluation time. Without it I get, of course, signum(a-b[2]), which is fine. 

If I do these tests without Physics package loaded, I get the result 1 immediately in both cases without any problem. So, something in Physics package is causing this problem. 

What is the problem? and how can I resolve this issue?

Thank you in advance.



I wanted to substitute exp(a) with p in an expression of the form exp(-a).


This threw back exp(-a) to me. I was expecting 


Is there a way to do that with subs? (a some mystical option perhaps?)

Thanks in advance.


I am little confused about the help file regarding the VectorCalculus:-PositionVector function. 

In the help file the first argument "comps" is defined as 
"list(algebraic); specify the components of the position Vector"

In spherical coordinates, the position vector is

r e_r

So, if the position vector to be entered is given in terms of the components (in spherical coordinates), the VectorCalculus:-PositionVector function should be called as


But this returns


(in the cartesian frame). This would make sense if r coordinates is r, theta coordinate is 0 and phi coordinate is 0. 

However, if I call it as


Then I end up with


Thus, the "components" given in PositionVector are not the components but the coordinates r=a, theta=b, and phi=c.

Am I missing something here or the help file is misleading? 

I appriciate your help. 

Thanks a lot.


1 2 3 Page 1 of 3