tomleslie

13876 Reputation

20 Badges

15 years, 164 days

MaplePrimes Activity


These are replies submitted by tomleslie

@awass 

As noted in my earlier response cat() will concatenate and coerce the output to the type of the first argument. In both of your first arguments the first argument is a name so cat will return the name xi which (because it is a name) the standard interface will interpret and display as the equivalent greek letter. (I have no doubt that there is an interface setting which allows one to turn of this interpretation.)

If you want some really obvious examples of this phenomenon, then I suggest you try the somewhat more obvious

cat( t, "heta");

or

cat ( a, "lpha")

Both will display the appropriate greek letter as a name - Behaviour exaclty as I would expect

@Kitonum No argument that this one is quicker to do mentally: I just thought that since the OP was asking about integrals

"like ∫xdlnx"

(s)he might a want a recipe for difficult examples

Do you mean

x* d( ln(x) )

in which case the easy way to do it is substitute y=ln(x), which gives the integrand as exp(y) * dy, which integrates to exp(y), and reversing the substitution gives the answer x.

If this is what you are getting at then it can also be achieved with

int(x*D(ln)(x), x);

Agree with Preben on the 2-D math issue, but if I can assume none of Phi[0], x, theta, omega and t are independent of z, then the following will provide an answer

restart;
n:=1:
L:=2:
m:=3:
x[0]:=6:
h:=1/2:
Phi(x,theta,z,t):=-Phi[0]*sin((m*Pi*(x-x[0]))/(L))*cos(n*theta)*cos((Pi*z)/(h))*sin(omega*t):
eq1:=diff(Phi(x, theta, z, t), theta, theta):
mul(op(1..3,eq1))*op(5, eq1)*int(op(4,eq1),z = -h/2 .. h/2);

@Al86 

First of all you post (what I think) is syntactically incorrect Latex. Then you post an equation which Maple tells you is syntactically incorrect! And you expect someone to solve it?????

Forget finding a solution - you cannot even specify the problem!

Obvious things which are wrong with the expression you supply

  1. You seem to believe that if you want the 4th power of a function the appropriate code is v^4(1,t-r) . No!! If you would RTFM, then you would discover that the correct syntax is v(1,t-r)^4
  2. You seem to believe that JacobiTheta3(0,exp((-Pi^2)*r)v^4(1,t-r) is meaningful. Well applying (1) above I would get JacobiTheta3(0,exp((-Pi^2)*r)v(1,t-r)^4, but this still isn't meaningful because there ought to be some operation between JacobiTheta3(0,exp((-Pi^2)*r) and v(1,t-r)^4 which is probably(?) a multiplication. So applying my psychic powers, you probably mean JacobiTheta3(0,exp((-Pi^2)*r)*v(1,t-r)^4 - but maybe not??

After repeatedly applying my psychic powers to compensate for you complete incompetence, the best guess I can come up with for the statement of your problem is

JT4:=JacobiTheta4((Pi/2)*x, exp((-Pi^2)*s));
JT3:=JacobiTheta3(0, exp((-Pi^2)*r));
h:=0.000065;
INT := v(x,t)=1-h*int(JT4*(1-h*int(JT3*v(1,t-r)^4,r=0..t-s))^4,s=0..t);

Cut-and paste the above into Maple and check the output equation: is it what you want???

Now I have absolutely no idea if the returned equation is correct. And I have little faith that you know either, on the basis that you can't write a synctactically correct equation for a bet. However it might help you post a syntactically correct question?

BTW in some of your previous posts you cited ceratain original conditions on v(1,t) and v(x,0). In any future post I recommend that you include the INT expression and any such subsidiary conditions.

Only if the problem is known can a solution be attempted!

 

@Al86 

Well then my latex viewer must be playing up

I won't be looking at this problem again till you post it in Maple format

@acer 

So basically

"in general we would not know how p was formed and by what commands)"

and therefore, for some more-or-less random multivariate polynomial p then either

  1. op(1,p) is arbitrary, or
  2. coeffs(p)[1] is arbitrary

which of course means that neither of these commands can be used programmatically.

Is the above a reasonable statement of the issue

@Al86 

My first and  very serious recommendation is that you do not post equations in Latex format on this site. By doing this you are requiring that responders

  1. first of all have to load your Latex into some kind of viewer and then
  2. retype them in Maple

Ask yourself: why should I bother??? After all, you can't be bothered to express your problem in Maple syntax, but you want me to do it for you. Generally speaking I'm just not prepared to do that much work just so that I can figure out what your problem is.

Having noted the above, when I use my own latex viewer and then have to retype for Maple, I find your equations inconsistent at best (this may be a problem with my latex viewer, which is why the above point is so important)

For example, you give your basic equation as (I'm not making this up, it is cut-and-paste)

v(x,t)=1 - h*\int_0^t JacobiTheta0(1/2x , \pi i s) v^4(1,t-s)ds

and then state that

JacobiTheta0(1/2 x , i\pi t) = \sum_{m=-\infty}^\infty (-1)^m e^{-m^2\pi^2 t} \cos(m\pi x)

\theta_3(t) = \sum_{m=-\infty}^\infty e^{-m^2\pi^2 t}

If I delete the (irrelevant???) central term for the above expression, I don't have to worry about about the fact that 'theta_3(t)' bears no relationship to the maple function 'JacobiTheta3' so I get

JacobiTheta0(1/2 x , i\pi t) =\sum_{m=-\infty}^\infty e^{-m^2\pi^2 t}

Note that, according to this last equation, JacobiTheta0(1/2 x , i\pi t) does not depend on the variable x. Since this does not depend on the variable x, then neither does your basic equation

v(x,t)=1 - h*\int_0^t JacobiTheta0(1/2x , \pi i s) v^4(1,t-s)ds

which therefore means that v(x,t) does not depend on x!

I am reasonably sure that this is not what you mean - but am I supposed to guess what you want?

I respectfully suggest that you open a Maple worksheet, in which you define the equations you want to solve (preferably in 1-D input syntax) together with definitions of subsidiary functions (such as v(1,t) , v(x,0) and any JacobiThetaXX functions) in terms understandable to Maple

 

@Al86 

The attached worksheet shows 3d plots of

  1. the solution of your pde over the range x=0..1, t=0..1
  2. the error estimate over the same range

PDEprob2.mw

I have been unable to find any way of obtaining the " the rate of convergence of this numerical solution." I'm not saying that it can't be done, just that I haven't been able to figure out anything useful by studying the manual

 

 

@Al86 

When I see a pde problem like this, the first thing I do is to put as many things on defaults as I can - I only try to get clever if the default settings don't work - so I deleted several of the options from your pdsolve() command. When the resulting code worked, and produced what were apparently sensible answers, I stopped thinking about the problem.

To answer your questions more explicitly

  1. As the ?pdsolve/numeric help page states, the default method is centered/implicit. If you want to know what other methods are available then ?pdsolve/numeric/method and ?pdsolve/numeric/methods are helpful. In general you have to know a lot about your pde in order to select the most "efficient" method. I don't know anything about your specific pde, so if the default method "works" then I would only ever investigate alternatives for educational purposes. There are eleven different solution methods: I have no plans to apply each one to your problem and figure out which is "best". It might or might not, be the ForwardTimeCenteredSpace you seem to be so keen on - although even this method has two options , ie forward/backward, so I hope you know which you want/need
  2. Spatial/temporal errors: first of all I suggest you check out the ?pdsolve/numeric/errorcontrol. If you examine the examples on this page, you will see that setting errorest=true will enable you to produce plots of solution +/- estimated error. You can change the "allowable error" by adjusting the value of the option abstol. Depending on the selected solution method (your choice), any failure to achieve the specified abstol may be overcome by reducing timestep and spacestep, at the expense of increased execution time. For any given pde this is an "experimental" process. I suggest you play with the errorest option mentioned previously, then tighten abstol to watch how the errorest "bands" change. (And if you have enough time on your hands you can do this for all eleven solution methods!

@Carl Love 

Ok I accept the explanation if only because the manual does state

It must be executed in a separate prompt (or line) from all other commands, since all commands in a prompt are passed to the kernel at once; entering other commands in the prompt could cause unexpected results

I have to admit, I have a problem with this if only because the commands within an execution group have to be executed in sequence - otherwise

a:=1;
a:=a+1;

could not be guaranteed to give the answer 2 - which would be seriously unacceptable. Thus commands in an execution group have to be executed in sequence, I'm having a big problem with why this causes some issue with 'restart'.

The reason this bothers me is that when I'm working on my own projects, I tend to start off with something which I suppose I would call an "initialisation group" which usually contains: a "restart" command; read statements for required procedures; assignment statements for stuff I consider "global" (for the project); possibly a few other things like _Env settings - and if I can't rely on the restart command????!!!!

Can't work out why I haven't been nailed by this issue before

BTW in the unlikely even that the OP is still interested, the following sequence fulfills the required function, and does not (seem to) have restart issues (and where order is determined only by the op() command )

  restart;
  p:= x^2*y-2*y*z+3*x^2+2*y-z;
  terms:=[op(p)];
  cl:= coeffs~(terms);
  t1:= [seq(`if`( cl[j]>0,
                  seq( op(j,p)/cl[j],
                       i=1..cl[j]
                     ),
                  NULL
                ),
                j=1..numelems(cl)
             )
        ];

 

@mahdy 

Whllt accepting that this method can be made to work, I'm still very puzzled why you should want to do something whic the manual says

is not intended for end users.

when other simple methods (using .mw or .mpl) exist.

What do you gain by being using the difficult and obscure? Other than having to ask someone else to resolve your problems???

@Carl Love 

Actually this code worked on every example I tried, including your "counterexample"

However I did eventually manage to break it, by assigning a polynomial to p, then reassigning a different polynomial to p within the same code block. Have to admit I don't understand this behaviour!!

See attached

polyTerms.mw

Identical behaviour in 2015.1 and 18.02

@acer 

Leaving aside the niceties of the calling sequence, your code updates the variables palette when given a .m file. (At least it does in 2015.1)

@chiefjazzdiewltr 

For the purposes of this thread I only ever used the smartplot() command which you have used.

For the examples wich you have supplied I would not expect plot() commands to work any better

As I have tried to explain before, if you wnat to plot a function/expression/whatever then you have an obligation to ensure that the function evaluates "sensibly" over the domain which you want to plot

Without wishing to get too "mathematical" over the definition of "sensibly" in the above remark, one check is  whether the function evaluates to non-complex, non-infinite values over the domain being plotted.

If you can post an example of a function which evaluates to non-complex, non-infinite values over the domain being plotted, and Maple is plotting it incorrectly, then I would get seriously interested.

Otherwise you would have to come up with a description of how you want a plot of a function over a domain, where some values are  real, some are complex, and some are infinite - what do you expect this to look like?

If you need a concrete example then forget Maple, get your pencil/paper out (calculator if you have to!)  and plot the value of the function 1/sqrt(x) for x=-1..1 - decide why you can't do it, and so appreciate why Maple can't do it either!

 

 

First 186 187 188 189 190 191 192 Last Page 188 of 207