nm

11643 Reputation

20 Badges

13 years, 144 days

MaplePrimes Activity


These are replies submitted by nm

@janhardo 

Your updated book solution does not seem to be correct either. If you look at Maple's solution, you see there is  an extra sin(n*x) outside everything which you do not have. 

Any way, to make it look similar to what I think you want, simply expand the body of the sum itself. One possible way to do this is like this
 

 

 

restart;

 

# Definieer de parameters
L := Pi:

# Stel de golfvergelijking op
pde := diff(u(x,t),t,t) = c^2 * diff(u(x,t),x,x):

# Definieer de randvoorwaarden
bc := u(0,t) = 0, u(L,t) = 0:

# Definieer de beginvoorwaarden
ic := u(x,0) = f(x), D[2](u)(x,0) = g(x):

# Los de PDE op met begin- en randvoorwaarden
sol := pdsolve([pde, bc, ic], u(x,t)):

# Toon de oplossing
simplify(sol);

u(x, t) = 2*(Sum(sin(n*x)*((Int(sin(n*x)*f(x), x = 0 .. Pi))*cos(c*n*t)*c*n+(Int(sin(n*x)*g(x), x = 0 .. Pi))*sin(c*n*t))/(n*c), n = 1 .. infinity))/Pi

#new_sol
new_sol:=lhs(sol)=evalindets(rhs(sol),'specfunc(anything,Sum)',X->Sum(expand(op(1,X)),op(2,X)));

 

u(x, t) = Sum(2*sin(n*x)*(Int(sin(n*x)*f(x), x = 0 .. Pi))*cos(c*n*t)/Pi+2*sin(n*x)*(Int(sin(n*x)*g(x), x = 0 .. Pi))*sin(c*n*t)/(Pi*n*c), n = 1 .. infinity)

 


 

Download not_same_V2.mw

 

@C_R 

 I use them allot in techincal documentation.

Equations labels are great for documenation. I use them all the time, in Latex. 

In actual, code they make no sense, as one can no longer copy/paste code and use it, as it has all these hardcoded label numbers in the code. 

How will one run code that says  convert((13), diff); copied from help page in order to try it in their own worksheet? It makes code in help page read-only.

Code in help pages should be such that it can be copied and used to try it. equation labels get in the way of doing this.

For final reports, meant for presentation only and publication, sure. equation labels are great and I use them all the time.

But I do not think they make sense for use in help pages meant to be a page that a user can copy any command from it and try them.

Btw, there is a big difference between saying something like

         see equation (13) for .....

and between writing

        eval( (13) , x=0 )   

where now (13) is a equation number.

The first case is fine and should be used in help to refere to something,. I am talking about the second one above, where the actual equation number is embeded inside the Maple code itself.

 

@acer 

wow, that was it. 

Yes, I had turned off the  "show equation labels" in the Tools->Options->Display

This is one of the first things I do when I install Maple, as I hate these and do not like them and do not use them at all. To refer to something, I assign it to a variable. I do not need equation labels.

I had no idea that turning off the equation lables messes up the help pages now.

After turning them on, now all input in help page shows as 1D with equation numbers in them instead of 2D math,

But still, can't copy any individual command shown. As the command now itself has equation label embeded in it.

Here is an example from same page ?D

When copying the above command (the convert command) to my worksheet, it shows as

           convert(??, diff);
 

In the worksheet. So if I wanted to run these two commands in my worksheet, I can't.

Better way to do help pages is to use normal variables. This way it is not hardcoded like this. So the above example would be this

e:=D(f)(0);
convert(e, diff);

Now one can copy each command and evaluate them in their own worksheet since there is no hardcoded label references that are only valid in the help page and not outside the help page.

I know assigning results to variables is very old fashioned and not the modern cool fashion like using equation labels, but it works everywhere and all the time and this is how Maple was in the good old days.

@C_R 

does the help pages itself on your Maple shows some input as 2D and some as 1D and some mixed?

It does for me. I am on windows, may be if you are not, this is why.

I can't copy anything to mywork sheet from the help page when the input in the help page in in 2D.

Here is small movie. (right click on it and open in new tab to see large)  You see how it is all mixed up. I use interface extended if this makes any difference, 

Windows 10.

 

I do not understand the result  2*z*z'+y'

This is not valid Maple expression. Why not simply use DifferentialGeometry for total derivative?


 

restart;

f:=z^2+y;

z^2+y

DifferentialGeometry:-DGsetup([x], [z, y]):

DifferentialGeometry:-ExteriorDerivative(f);

_DG([["form", "Euc", 1], [[[2], 2*z], [[3], 1]]])

 


 

Download total_derivative.mw

looks like the search there can be improved. Try using google search. Type this exactly as is

"Created In: Maple 10" site:maplesoft.com/applications

in your browser search.  This returns many pages of hits now

 

@Preben Alsholm 

I really do not remember. Too many bugs and can't remember eveything I find :)

If you do find similar one, then feel free to delete this.  I switched to using solve instead, so I am OK now.

@C_R 

as far as I know there is nothing wrong with  applying exp() to both sides of an equation. This is always valid. So if we have an equation that looks like    ln(x)=y, we can always write this as  x=exp(y) since   exp(ln(x)) = x always.

Maple does this automatically, this mathematically is always valid
 

eq:=ln(diff(y(x),x)) = x+y(x);

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

PDEtools:-Solve(eq,diff(y(x),x))

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

expand(%);

diff(y(x), x) = exp(x)*exp(y(x))

 


And now it is separable ode which is solved by integration.

Download exp_op.mw

@Carl Love 

fyi, Actually it works if I do not pass the assumptions to odetest.

But first obtain the result of odetest, and then in separate step, call simplify with the same assumptions. Now it works and gives zero.

So no need to change the assumptions the way you had them. I just need to replace x0,y0 with _C1 and it still works but not with odetest, but with simplify.

interface(version);

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

restart;

ode:= y(x) = x + 3*ln(diff(y(x), x)):
sol_separable:= dsolve(ode, [separable]);
assmp:= sol-> ((x,_C1)::~real, op(indets(sol, specfunc(ln))[]) >~ 0):

#do not add assuming here.
residual:=odetest(sol_separable, ode):

#add assuming here.
simplify( residual ) assuming assmp(sol_separable);

y(x) = -3*ln(exp(-(1/3)*x)-(1/3)*c__1)

0

 

 

Download V3_IC.mw

@Carl Love 

I tried your assumptions on general solution but it does not verify it. Would you know why? I replaced your sol-> ((x,x0,y0)::~real  with sol-> ((x,_C1)::~real since now there is no x0,y0 and only _C1,x are there.

restart;

ode:= y(x) = x + 3*ln(diff(y(x), x)):
sol_separable:= dsolve(ode, [separable]);
assmp:= sol-> ((x,_C1)::~real, op(indets(sol, specfunc(ln))[]) >~ 0):
odetest(sol_separable, ode) assuming assmp(sol_separable);

y(x) = -3*ln(exp(-(1/3)*x)-(1/3)*c__1)

-3*ln(3*exp(-(1/3)*x)-c__1)-x-3*ln(-1/(c__1*exp((1/3)*x)-3))

 

 

Download V2_IC.mw

works OK for me in Maple 2024.1


 

interface(version);

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

restart;

assume(g > 0):
dsolve({diff(r(t), t$2) + g * t * r(t), r(0) = r0, D(r)(0) = r1},  r(t));

r(t) = (1/2)*((g^(1/3)*GAMMA(2/3)^2*3^(2/3)*r0+(2/3)*3^(5/6)*Pi*r1)*AiryAi(-g^(1/3)*t)+AiryBi(-g^(1/3)*t)*(r0*GAMMA(2/3)^2*g^(1/3)*3^(1/6)-(2/3)*r1*Pi*3^(1/3)))/(g^(1/3)*GAMMA(2/3))

 


 

Download works_for_me.mw

@C_R 

Both solutions are correct, but the separable one requires assumptions to obtain zero result from odetest while the dAlembert one does not. In this sense, the dAlembert solution is preferable.

ode:=y(x)-x=3*ln(diff(y(x),x));
sol_dalembert:=dsolve(ode,[dAlembert]);

y(x)-x = 3*ln(diff(y(x), x))

y(x) = x, y(x) = x+3*ln(exp(-(1/3)*x)*c__1/(-1+exp(-(1/3)*x)*c__1))

odetest([sol_dalembert][2],ode)

0

sol_separable:=dsolve(ode,[separable]);

y(x) = -3*ln(exp(-(1/3)*x)-(1/3)*c__1)

residual:=odetest(sol_separable,ode);

-3*ln(3*exp(-(1/3)*x)-c__1)-x-3*ln(exp(-(1/3)*x)/(3*exp(-(1/3)*x)-c__1))

simplify(residual) assuming exp(-x/3) - c__1/3>0, x>0

0

 


 

Download difference_in_separable_and_dalembert.mw

I guess the rule of thumb here is this:

If we can find a method to solve non-linear ode in y', as in this example,  without first having to solve for y' , then use that method.

The dAlembert method does that, it does no require isolating y' first.

While in the case of solving as separable, we have to first solve for y' to isolate it, and then solve the resulting ode as seprable. This is the main difference I see.

I solved this ode by hand using both separable and dAlembert methods. I see nothing wrong with the separable approach, this is how we solve this at school. The only difference as I said, is we have to isolate y' first. And this seems to be the cause of the trouble even though I can't still see why and what is wrong with doing that. May be someone can see the subtle mistake if any in the separable solution method.

 

@Kitonum 

Thanks, I think the Maple 2024.1 gives the correct solution, not Maple 2018, because this Clairaut  ode can only have one general solution and possibly a number of singular solutions (if they are valid ofcourse).

In the above result from Maple 2018 you show, only the first general solution must be the correct one and all the others are not. 

Singular solutions do not have a constant of integration in them. So this looks like something that was fixed in later version of Maple after 2018 or in Maple 2024.

But the strange thing I was asking about are those warning messages.

I do not yet know what causes them and why they go away when trying the command one more time and do not think I saw them before from calling dsolve. They seem to be new.  I do not have Maple 2024.0 to check.

 

@dharr 

Oh, yes ofcourse. Phase plot does not work for non-autonomous system of odes. I completely forgot that when I was looking at this. It will be nice if Maple issues a WARNING message to alert the user so they know :)

 

First 13 14 15 16 17 18 19 Last Page 15 of 90