nm

11413 Reputation

20 Badges

13 years, 71 days

MaplePrimes Activity


These are replies submitted by nm

@ecterrab 

Fyi, I found another example where de_degree returns different result depending on how the ode is written,

Please see attached worksheet

interface(version);

`Standard Worksheet Interface, Maple 2022.1, Windows 10, May 26 2022 Build ID 1619613`

restart;

#code from https://www.mapleprimes.com/questions/227477-Finding-Order-And-Degree-Of-ODE-In-Maple
de_degree := proc(de, f::expects(unknown) := NULL)
local de_in_diff_notation, derivatives, diff_ord;

de_in_diff_notation := convert(`if`(de::`=`, (lhs-rhs)(de), de), diff);
derivatives := indets(de_in_diff_notation, specfunc(diff));
if f <> NULL then
    derivatives := select(has, derivatives, f);
fi;
if derivatives = {} then return(0) fi;
diff_ord := PDEtools:-difforder(derivatives);
derivatives := select(u -> PDEtools:-difforder(u) = diff_ord, derivatives);
max(map2(degree, de_in_diff_notation, derivatives));
end:

ode:=y(x)-x*diff(y(x),x)-1/2/diff(y(x),x)^2=0;

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

odes:=[PDEtools:-dpolyform(ode)];

 

[[-2*x*(diff(y(x), x))^3+2*y(x)*(diff(y(x), x))^2-1 = 0], [(diff(y(x), x))^2 <> 0], []]

#this gives correct degree of 3, using the form from PDEtools:-dpolyform
de_degree(odes[1,1],y(x))

3

#this gives the wrong degree using the original ode form. THis should be 3, it gives 1
de_degree(ode,y(x))

1

 

Download different_degree.mw

@Carl Love 

The definition does not exclude the possibilities f=0 or g=0.

Are you saying that y(x) = g(p) can be dAlembert? for what conditions on g(p) ?

In this case, then y(x)=ln(diff(y(x),x)) and y(x)= tan(diff(y(x),x)) and so on all are now dAlembert. But clearly these are not. These are all quadrature.

But by adding an x to both the above examples, they now become dAlembert. y(x)=x*ln(diff(y(x),x)) and y(x)= x*tan(diff(y(x),x)) are dAlembert. (g=0 case is allowed)

So if y=g(p) can be dAlembert (i.e. f=0 is allowed), what are the conditions on g(p) for this to be the case? Otherwise, this is all fussy definitions.

In all the text books I looked at, I never seen an ode called dAlembert which had a missing x on the RHS (i.e. f=0 case) . But may be I did not look at enough examples.

try MmaTranslator  andFromMmaNotebook

But do not expect it to work on such large notebook with other non-mathematical functions in it. This translator is meant to be used to translate basic Mathematica math constructs.

Not to translate Full Mathematica code (otherwise, people will just use Maple to run Mathematic code for everything, which means Maplesoft will have to implement all of the Mathematica kernel in it, which is about 50 millions line of code or so). For example, do not expect the Plot commands to be translated to Maple.

My advice to translate this, is to do manually. Try to implement the algorithm itself in Maple directly, and do not translate line by line. I use this Maple translator to translate individual Mathematical expressions from Mathematica to Maple (which is very useful to have), but not to translate full functions and packages. Will not work for that.

 

 

@Christian Wolinski 

Thanks. It does fail on cases where the function shows up as argument to itself. But I do not think I have such cases, so this should not cause a problem.

restart;
C := proc(E, T)
   if type('E, T') then 1 elif hastype('E, T') then add(map(procname, [op]('E'), 'T')) else 0 fi;
end;
expr:=sin(sin(x));
C(expr,'specfunc(anything,sin)');  # gives 1
nops(indets(expr,'specfunc(anything,sin)'))  # gives 2

 

it would have been better if you attached such problem worksheet to use as an example. I do not see this problem you are talking about. But I do not use Maple to export pdf files much if any. I export what I want from the worksheet to Latex and compile the Latex to pdf. You get much better quality pdf this way.

But to change the font size in pdf, there are many external tools to use. Some are free, and some are not.

Adobe itself has an online service that does that Here is the link  https://www.adobe.com/acrobat/hub/how-to/change-font-size-in-pdf  

 

 

etc..

@Joe Riel 

This change was meant to be applied/used only within MmaTranslator:-FromMma package and not anywhere else in Maple. 

Since the expression x^y^z is a valid Mathematica expression and the Maple package is meant to be able to translate any valid Mathematica  Math expression to Maple, then it will be better if it can translate this to Maple, using a default internal setting  to generate x^(y^z) as translation to Maple.

Within Maple, it is no problem at all adding explicit () when needed.

That will something useful to have in Maple 2023 if possible. 

@acer 

Thanks! You are right, I am now using Chrom browser and able to write this here as you see,. 

But from Brave browser, which is the one I use all the time as it is more safe (no ads), when I login, this window is disabled for some reason.

I will try clearing the cache from the Brave browser to see if this has anything to do with it.

@Carl Love 

The debugger comes up automatically (when you uncomment the DEBUG(); statement). Then in the small window there (below where it says to enter a debugger command) I simply type

Object(A,ode,':-ic'=ic); 

This is to see what happens, without hitting the STEP button. i.e. just type in the window the actual Maple command which is about to execute. The error will show. At least it does on my Maple.

This is very useful feature. It allows one to issue Maple commands inside the debugger and examine things right at the place where there is a problem.

I do not know how you program without a debugger. You must be very good. I get lost without a debugger :)

@Carl Love 

Thanks. But the debugger gives same error. Here is screen shot. I am on windows using 2022.1

 

another screen shot

 

Do you not get same error?  

I now find the traditional optional argument handling easier to work with actually. Yes, I have to add few explicit IF THEN ELSE to check for each possible type and do an explicit casting. But this is not too bad, at least I get no strange errors like with corece. So my code now looks something like

if type(ic,set) then
     _self:-ic:=convert(ic,list);
elif type(ic,Vector) then
     _self:-ic:=convert(ic,list);
elif ....etc..
fi;

I do this each argument which can have different type

@dharr 

I understand that the default for y means default. But I need the actual numerical y range used. Using your example

p:=plot(sin(x),x=-1..10):
op(select(type,p,specfunc(VIEW)));

gives

VIEW(-1.0000000000 .. 10.0000000000, DEFAULT, _ATTRIBUTE("source" = "mathdefault"))

WHich does not tell the program what the actual y-range used is. Compare to 

lprint(p)

which has that information but in different location:

                "originalview" = [-.986250000000000071 .. 9.98625000000000007, -1. .. 1.]]))

The above has the actual numerical values for both x and y used. That is what I want. Not "default" as I can't use "default" in my other plots I am doing (phase diagrams), where it needs the acual values for y range.

@dharr 

Thanks but this gives only the x range. I need to also obtain the y-range used. Is it possible to modify it to obtain the both?

@ijuptilk 

But you did not address the question about v

Why is it partial derivative? It only shows in both equation as changing w.r.t. z only. 

You have so many mistakes in just writing what you want solved.

1) v shows as function of z only. So why use partial derivatives? Where will you use  v(z,0) =0 ?

2) There is no K1 in the equations

3) There is no alpha3 in the equations

4) There is no thetab in the equations.

5) There is no eta1 in the equations.

Trying to make the symbols that show in your equations latex match the numerical values you give will be a good start.

@Rouben Rostamian  

Would you know why it works with no error with plus but not with minus?

i.e. it works with  1+p.q but not with 1-p.q  ?

First 30 31 32 33 34 35 36 Last Page 32 of 91