tomleslie

13876 Reputation

20 Badges

15 years, 163 days

MaplePrimes Activity


These are replies submitted by tomleslie

@Preben Alsholm

As Preben has pointed out a couple of posts ago, the objective of the odetest()  command is to verify whether a given list/set of solutions are valid for the given list/set of differential equations - check the manual which says

The odetest command checks explicit and implicit solutions for ODEs by making a careful simplification of the ODE with respect to the given solution. If the solution is valid, the returned result will be 0; otherwise, the algebraic remaining expression will be returned.

The fact that your first application of the odetest command, ie

odetest(puta, odesys)

does not return 0, indicates that your putative solutions (puta) are not valid for your ODE, odesys.

I think you have to resolve this issue before you can do anything else. Either there is a problem with your ODE (typo, maybe), or your guessed(?) solutions are not in fact correct



 

Sorry but your question doesn't make a lot of sense to me. I don't really  understand the first part (problem set-up) at all, and fail to see how this relates to the second part (all the implicitplots). A few simple questions

When you say $u_[t] + uu_[x] = 0$, I assume the '$' symbols are completely meaningless. The '$' construct can do useful things in Maple, but I am reasonably sure that this is not what you want, so you actually mean u_[t] + uu_[x] = 0. Now I am pretty sure that you don't want indexed values (ie [] brackets), but I am also pretty sure that you don't want two simple functions u_(), and uu_() so I am going to make another wild guess that this is actually your differential equation, so what you mean by this "expression" would actually be represented in Maple as

diff(u(x,t),t)+u(x,t)*diff(u(x,t),x)=0

which, if memory serves, looks a bit like the Hopf equation often written as ut+u*ux=0 (althoughMaple does not allow the use of subscripts to indicate partial differentiation - you can "spoof" it but I wouldn't bother)

Now I have to work out what you mean by

$u(x,t) = a$ if $x < -1$
           = $b$ if $ -1 < x < 1$
            = $c$ if $ x > 1$

Again I'm pretty sure that you don't need/want all of those '$' symbols - so the first step is to produce

u(x,t) = a if x < -1
         = b if  -1 < x < 1
         = c if  x > 1

Defining a function like this in Maple is best done by using the piecewise construct

piecewise( x<-1,                 u(x,t)=a,
                x>=-1 and x<1, u(x,t)=b,
                x>=1,                u(x,t)=c
               );
I'm now guessing that in fact this expression is intended to determine your initial conditions (since you claim to have an initial value problem) - but the above does not define any "initial" values, so my next guess is that you mean to define the initial conditions

ics:= piecewise( x<-1,                 u(x,0)=a,
                       x>=-1 and x<1,  u(x,0)=b,
                       x>=1,                u(x,0)=c
                    );

So the summary of the problem would be that you want to solve the partial differential equation

diff(u(x,t),t)+u(x,t)*diff(u(x,t),x)=0 (whhihc I think is the Hopf equation)

subject to the initial conditions

ics:= piecewise( x<-1,                 u(x,0)=a,
                       x>=-1 and x<1,  u(x,0)=b,
                       x>=1,                u(x,0)=c
                    );

Before I go any further (if I go any further), please confirm whether the above is correct, or if I have been wasting my time piling wild guess on wild guess.

 

I have no idea what you are trying to do with those implicitplot commands or how they relate to the first part of the problem - I would assume that you are trying to plot the solutions to the pde but can make absolutely no sense of what is written here

@maple2015 

last time, when I said

"I suggest you post a worksheet showing your calculation so far with a detailed description of which part is failing"

I meant it. You have to help us, to help you

Don't copy-and-paste. Use the big green up-arrow (right-hand element in the second row of icons in the toolbar) to upload your worksheet

As a general rule I don't do homework problems unless the original poster can show some signs of having at least tried to solve the problem themselves. Even if I felt inclined to solve this problem, I could not so (neither could anyone else) given the supplied information, so you will have to try harder.

The MOL technique relies on discretizing one all but one dimension: the reaming dimension is treated as continuous. From your comment

t=1,delta t=0.1,x=1,Nx=10

which of x and t are considered discrete and which is continuous?? Does t go from 0 to 1 in steps of 0.1?? This is OK but unusual because in most MOL problems t is considered continuous and spatial dimensions are discretized. You can do it the other way round, , but I would want some definite confirmation before I even started. Other wise I could spend time solving the wrong problem - so which is it??

In your definition of the differential equations you have

du/dt=0.01 d^2u/dx^2

Does d^2u/dx^2 equal anything in particular - you know like 0, 1, exp(x)*cos(t)+myLatestShoppingBill?? Problem is insoluble without this information

Like I said - Try Harder

@Alejandro Jakubi 

After no response on this site, I submitted it to Maple Technical support and the last I heard from them (26Aug2014) was

Hello Tom,
Thank you for contacting Maplesoft. I suspect this behaviour may be due to the thread safe ability of the seq command.
I have forwarded this problem to our second level support for review. I will keep you informed as to the outcome.
Regards,
Chris
Technical Support Analyst

so I never did find out why $ was so much slower than seq - I just stopped using $

@Preben Alsholm 

Preben is completely correct. I got so bogged down fixing the simple details of you problem that I lost sight of your ultimate objective - mea culpa

When using the odetest() command, you are supplying a list(set) of differential equations and a list(set) of functions, and asking Maple to verify whether the functions actually are *solutions* of the differential equations. If they are, then odetest will return {0=0} (or maybe[0=0]).

So with the amendments and comments which have been made so far, progress may have been made, but the supplied function list is a long way from being a solution of your differential equation.

The only combination of the remaining parameters I have come uo with so far whihc does form a solution is {a=0, gamma=beta}. Since this is equivalent to making A, B, C. phi independent of r, I have a funny feeling this isn't a solution you want!!

 

@Rouben Rostamian  

I agree with you: however I actually remember the very first post I ever made on this site which was to ask why repeated calculations using the $ construct ran about 10X slower than those using the seq construct. I never did get a satisfactory answer Maple techies eventually decided it had something to do with ensuring thread safety: I didn't particularly buy this (still don't), but since I discovered the time penaly involved, I have prety much given up on the $ construct

@escorpsy 

Sorry but Q does seem to cancel.

You can see why if you remove phi(r) from the substitution list: ie use

puta := {A(r) = (1-a/r)^alpha, B(r) = (1-a/r)^beta, C(r) = (1-a/r)^gamma};

followed by

collect(collect(odetest(puta, odesys), phi(r)), diff(phi(r), r));

which will "gather" terms in phi(r) and diff(phi(r),r).

There are only two terms containing these functions. The first depends on (diff( phi(r), r) )^2/phi(r)^2, and the second depends on diff(phi(r),r)/phi(r). The premultiplying factor of Q in the expression for phi(r) will give Q^2/Q^2 in the first term and Q/Q in the second one - so Q always cancels.

If you *know* that your system should depend on Q then I can only conclude that you have typo in your original equation: can't help with that:-(

@Preben Alsholm 

Attached is a corrected worksheet with all functions correctly defined. As well as, for example, A when you mean A(r), there are also a few places where you have A (r) (note the space) which also need correction.

The last couple of commands in the attatched worksheet show a couple of quick attempts to "collect" powers of r or (1-a/r)^.., nether of them particularly successful at "prettifying" the original expression

 

de2.mw

@Carl Love 

Two points

    1. Strangely enough, I do know the difference between interpolation and fitting, but I made a judgement call on whether the OP did. It's surprising how often people want to fit "reasonably simple)" algebraic functions to data. Chances are about even I was wrong with this assumption: I can live with that
    2. Fascinated by the "worksheet" displayed in you response: the "displayed" code cannot produce the "displayed" output!?! 'Y' is used but never evaluated (and 'B' is evaluated but never used). Downloadable version has the same problem. Trivial fix - change

 

              else CurveFitting:-ArrayInterpolation(X,Y,[x])[]

           to

              else CurveFitting:-ArrayInterpolation(X,B,[x])[]

           Alternatively, change

               B:= cos~(X);

           to

               Y:= cos~(X);

Check out the examples section of the Statistics[Fit] page which gives pretty much a step-by-step process for fitting a function to experimental data.

@Alejandro Jakubi 

Haven't fixed anything and it seems to be working again this morning - puzzling

@Mac Dude 

Assuming you can define the average as a recursive procedure call, then careful parameter-passing and an "option remember" statement ought to provide the previous average as a lookup

@Markiyan Hirnyk 

f(x):=(5*x^2-125)/(x^2-16)

First 196 197 198 199 200 201 202 Last Page 198 of 207