acer

32333 Reputation

29 Badges

19 years, 323 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@janhardo Btw, it's also bit heavy-handed to do actions like,
    combine(b, trig)
or simplify. The problem is that you don't allow the user an optional way to choose not to do it.

I can make a guess as to one reason why you might have put it in there: Your SplitPDE1 procedure applies expand, to separate the linear/nonlinear terms as separate additive terms (so that they can be select'd). But a factored product, unexpanded, could contain linear terms that get missed, eg.     u_t*(K+u_x)
So, if you inadvertantly expand'd/blew-up some trig terms then you might want to combine to get back politely to the original form. However, one problem is that you cannot know whether that has to be done, and you don't offer a way to not do it.

That's why earlier I mentioned applying normal (or a frontend'd expand) instead of just a plain expand call. That leaves trig stuff like sin(u_t+K+x) alone, and you don't need to take on the burden of possible repair. But normal will still cause the wanted expansion of factored products, so that the linear & nonlinear addends get separated. Eg, compare,
  expr := sin(diff(u(x),x)+K+x) + u(x)*(K+diff(u(x),x));
  expand(expr);
  normal(expr);

Hope that makes sense.

@salim-barzani I've made another edit/correction in my code above (both places).

@janhardo K is constant w.r.t. all of x,y,t, functions u,v of those, and derivatives of those functions.

Being unrelated to all of those, it's importance is not much different from a number here.

@janhardo Your approach seems to need some more corrections. What do you think?

restart

with(PDEtools)

undeclare(prime, quiet); declare(u(x, y, t), quiet); declare(v(x, y, t), quiet); declare(f(x, y, t), quiet)

 

pde1 := diff(u(x, y, t), t)+diff(u(x, y, t), `$`(x, 3))+diff(u(x, y, t)*v(x, y, t), x)+t*(diff(u(x, y, t), t))+K

diff(u(x, y, t), t)+diff(diff(diff(u(x, y, t), x), x), x)+(diff(u(x, y, t), x))*v(x, y, t)+u(x, y, t)*(diff(v(x, y, t), x))+t*(diff(u(x, y, t), t))+K

pde2 := diff(u(x, y, t), x)-(diff(v(x, y, t), y))-y*(diff(u(x, y, t), y))-t

diff(u(x, y, t), x)-(diff(v(x, y, t), y))-y*(diff(u(x, y, t), y))-t

T := 'T'; linpred := proc (term) options operator, arrow; not has(simplify((eval(term, {u(x, y, t) = T*u(x, y, t), v(x, y, t) = T*v(x, y, t)}))/T), T) end proc

pde1_lin, pde1_nonlin := selectremove(linpred, expand(pde1)); pde2_lin, pde2_nonlin := selectremove(linpred, expand(pde2))

pde1_lin; pde1_nonlin

diff(u(x, y, t), t)+diff(diff(diff(u(x, y, t), x), x), x)+t*(diff(u(x, y, t), t))

(diff(u(x, y, t), x))*v(x, y, t)+u(x, y, t)*(diff(v(x, y, t), x))+K

pde2_lin; pde2_nonlin

diff(u(x, y, t), x)-(diff(v(x, y, t), y))-y*(diff(u(x, y, t), y))

-t

Download splitsen_in_lineair_en_niet_linear_werkend_def_12-8-2025_ac.mw

@salim-barzani 

Your approach with,
    eval(term, u(x, y, t) = T*u(x, y, t))/T
or,
    eval(term, {u(x, y, t) = T*u(x, y, t), v(x, y, t) = T*v(x, y, t)})/T
(and variants on that idea) seems to be poor. It doesn't work properly for some very simple examples.

note: I made an edit to fix a typo, where I accidentally used Z1 instead of Z2 in a step of dealing with pde2. I've corrected that now, in the code above. It happened to not affect your original example.

You could alternatively make a reusable procedure,
[edited]

restart

with(PDEtools, declare); with(PDEtools, undeclare)

undeclare(prime, quiet)

declare(u(x, y, t), quiet); declare(v(x, y, t), quiet)

 

Split := proc (expr::algebraic, F::(list(name)), L::(list(name))) local Z, dum, res; Z := map(proc (v) options operator, arrow; v = freeze(v) end proc, [indets(expr, And(specfunc(diff), satisfies(proc (fn) options operator, arrow; depends(fn, L) end proc)))[], `~`[apply](F, L[])[]]); res := thaw([selectremove(type, eval(expr, Z)+dum, Or(linear(`~`[rhs](Z)), satisfies(proc (f) options operator, arrow; not depends(f, `~`[rhs](Z)) end proc)))])[]; res[1]-dum, res[2] end proc

 

pde1 := diff(u(x, y, t), t)+diff(u(x, y, t), `$`(x, 3))+diff(u(x, y, t)*v(x, y, t), x)

diff(u(x, y, t), t)+diff(diff(diff(u(x, y, t), x), x), x)+(diff(u(x, y, t), x))*v(x, y, t)+u(x, y, t)*(diff(v(x, y, t), x))

pde2 := diff(u(x, y, t), x)-(diff(v(x, y, t), y))

diff(u(x, y, t), x)-(diff(v(x, y, t), y))

Split(pde1, [u, v], [x, y, t])

diff(diff(diff(u(x, y, t), x), x), x)+diff(u(x, y, t), t), (diff(u(x, y, t), x))*v(x, y, t)+u(x, y, t)*(diff(v(x, y, t), x))

Split(pde2, [u, v], [x, y, t])

diff(u(x, y, t), x)-(diff(v(x, y, t), y)), 0

Split(pde1, [u, v], [x, y, t]), Split(pde2, [u, v], [x, y, t])

diff(diff(diff(u(x, y, t), x), x), x)+diff(u(x, y, t), t), (diff(u(x, y, t), x))*v(x, y, t)+u(x, y, t)*(diff(v(x, y, t), x)), diff(u(x, y, t), x)-(diff(v(x, y, t), y)), 0

Download linear_ac2.mw

@Andiguys Did you not read the worksheet in sand15's Answer above?

That is to say, did you not try the parametric option? Eg,

raw := solve({X3, X4}, {s1}, parametric):
res := simplify(raw) assuming 0 < s1, 0 < s2, 0 < d;

Q_s_ac.mw

@Andiguys 

...not if you don't both provide and properly explain the complete details of which names you wish to substitute, and by what values, no.

See kernelopts(alloc) for memory allocated from the OS to the running mserver.

(I'd expect that not to be able to exceed the total available RAM+swap.)

Do not confuse that with kernelopts(usage), which relates to memory used (or re-used) by Maple's garbage collector. That total can indeed exceed the available OS memory, since it reflects a running total and does not denote a snapshot of the total OS allocation a particular moment.

@sand15 I'm currently looking at Viking stuff in L'Anse aux Meadows (end of the world).

But when I get back to my computer (Fri, 01/08) I could take a look at this.

ps. The OP seems to have indicated (elsewhere) that he couldn't use Kitonum's contour labelling proc for the (erroneous) reason that it's not found as a stock command. Perhaps someone might explain to him that Kitonum's procedure's code for that was simply in his Post & comments.

Is there a reason why you could not use the,

   DocumentTools:-Tabulate

command? (...or a variant of that, either embedding in the current sheet, or opening in a wholly new sheet, possibly split if you need a page break, etc).

What are you final goals, eg.  to export this (pdf file), or something else?

@GFY No, this is an unusual and uncommon situation.

When I try to login on my phone (android, chrome) it briefly shows the page indicating that I'm logged in, and then a few seconds later it boots me out and back a page, automagically.

Logins on two desktops (ubuntu) from chromium worked.

@Geoff 

What do you think happens in your example (12) when p>1 and n is not an integer?

What do you think happens in your example (13) when n is not an integer?

You haven't described in any detail what you think is wrong.

@mehdi jafari You now write, "I was specifically looking for the plot of P1 vs x, which is implicitly embedded within the expression FF."

Why didn't you write explicitly what you were actually looking for, when you first posted the Question?

Also, there are a lot of ways to do approach this as an optimization problem rather than a root-finding one (... or, ways to get an inaccurate representation of FF=0 and level curves, via curve-fitting or what have you). But it's not clear that hardware double-precision is adequate.

You should explain exactly what kind of plot you're trying to get. And you should state outright what floating-point tolerance (allowed error or inaccuracy) you are willing to accept. Otherwise  don't see how answers to this are very meaningful.

For all we know, the imaginary components of your expression FF (which are indeed quite small) could be just numeric noise, induced by innaccurate float coefficients due to inadequate earlier rounding, etc, and whose 3D surface plot is smooth merely by their occurence within exp subterms. We wouldn't be able to judge, in this absence of background details.

1 2 3 4 5 6 7 Last Page 1 of 591