acer

33400 Reputation

29 Badges

20 years, 332 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@rstellian The stylesheet option was introduced in Maple 2017, so it's not available in Maple 2016.

@wanderson 

It may be enough to change inert Diff to active diff here (or perhaps use value(pde) ).

restart;

kernelopts(version);

`Maple 13.00, X86 64 LINUX, Apr 13 2009, Build ID 397624`

(1)

The equation of heat condition in a medium of
variable conductivity k(x) is
"(∂ u)/(∂ t)=(∂)/(∂ x)(k(x) (∂ u)/(∂ x))."

In your case the conductivity is a piecewise constant
function which jumps from k__1 to k__2 at the interval's

midpoint. In principle we should be able to take

"k(x) = `k__1`+(`k__2`-`k__1`) Heaviside(x-L),"

or equivalently

"k(x)=`k__1`+(`k__2`-`k__1`) piecewise(x<L, `k__1`, `k__2`)."

I am unable to make either of these representations
work with Maple's numeric solver, so I do the next
best thing which is to approximate the Heaviside function
with a smooth function such as

myHeaviside := x -> (1+erf(4*x))/2;

proc (x) options operator, arrow; 1/2+(1/2)*erf(4*x) end proc

(2)

Let's compare myHeaviside with the real thing:

plot([Heaviside(x), myHeaviside(x)], x=-10..10,
  color=[red,blue], axes=frame, gridlines=false,
  legend=[Heavisie, myHeaviside]);

 

OK, then, let's start:

pde := diff(u(x,t),t) = diff(k(x)*diff(u(x,t),x), x);

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

(3)

ibc := u(x,0)=0, u(0,t)=v1,  u(2*L,t)=v2;

u(x, 0) = 0, u(0, t) = v1, u(2*L, t) = v2

(4)

k := x -> k1 + (k2-k1)*myHeaviside(x-L);

proc (x) options operator, arrow; k1+(k2-k1)*myHeaviside(x-L) end proc

(5)

L := 10: v1 := 20: v2 := 10: k1 := 10: k2 := 20:

To handle the sharp change in conductivity, we refine the spacestep size from

its default value of 2*L/20 by dividing it by 5.

pdsol := pdsolve(pde, {ibc}, numeric, spacestep=(2*L/20)/5);

module () local INFO; export plot, plot3d, animate, value, settings; option `Copyright (c) 2001 by Waterloo Maple Inc. All rights reserved.`; end module

(6)

pdsol:-animate(t=15, frames=50, labels=[x,u(x,t)],
  title="time = %f", gridlines=false);

 

 

Download pde_m13.mw

@Christopher2222 I would never alter someone else's vote even if I could (and I cannot.)

I submitted a bug report, when I first noticed this.

For one thing it is a backwards incompatibility in GUI usage. And it wasn't broken or inconvenient before, so the change didn't fix anything. So it's an unnecessary backwards usage incompatibility.

More importantly, it now looks as if it is a computational effect -- given the menu-item under which it now appears. And that is bad, because it makes it look like it's undoing any actual computation/assignment in kernel space. And of course it isn't.  Mathematica has such a feature and Maple does not.

It's an editing-undo, not an evaluation-undo. It should be moved back, asap in the next point release.

If Carl Love doesn't find it then imagine the havoc for non-experts.

A mistake on multiple levels

Except your idea doesn't always work, in part because it turns names into globals.

I can't imagine why anyone would give this an up-vote.

@reza gugheri I have updated your Question to mark it as version Maple 13.

@Christopher2222 I'm sorry, but I cannot understand what you're now asking because it seems as if you haven't understood a single word I've written so far. I have to stop with this now. Good luck.

@Christopher2222 But generally computed results will not show the effect. Eg,

restart;
macro(v^2=a^2+b^2):

p:=v:
p*v;
                  2
                 v 
So that's a huge set of situations where the macro won't give you anything extra.

@radaar How could I know anything about a .dll file that you merely reference in a worksheet!?

Is it for 32bit or 64bit?  (Your attached worksheet was last saved in 64bit Maple 2017.3. So if you're using 64bit Maple then the .dll better match.)

What's inside it? How did you build it?

@ecterrab Perhaps I misunderstood, but it seems to me that the OP was looking for considerably more than what macro provides.

Consider these examples. I got a strong sense the the OP wanted Maple to be able to utilize the "assignment" for mathematical effect on subsequently formed expressions -- rather than merely an abbreviation mechanism for input.

restart;
macro(v^2=a^2+b^2):

foo := (v^2)^2;

                             4
                     foo := v

hmm1 := foo/(a^2+b^2);

                               4
                              v
                    hmm1 := -------
                             2    2
                            a  + b

simplify(hmm1);

                         4
                        v
                      -------
                       2    2
                      a  + b

hmm2 := hmm1/v^2;

                              2
                             v
                   hmm2 := -------
                            2    2
                           a  + b

simplify(hmm2);

                          2
                         v
                       -------
                        2    2
                       a  + b

hmm3 := hmm2*v^2;

                               2
                      hmm3 := v

simplify(hmm3);

                          2
                         v

Please don't repost the question just because you haven't received an answer.

@Joe Riel Yes, there some special assignment syntax cases that have a specific meaning and are useful. But his meaning seems to be either general or at best unclearly specified.

Perhaps he is talking about assigning into rember tables of procedures. It doesn't seem clear though, because he also seems to be talking about subsequent use in contexts where ambiguity comes into play. I find it hard to discern what precisely he's requesting, that wouldn't be better achieved via algsubs, say.

I'm not saying that there is no way to extend Maple's assignment functionality in ways that could ever be useful. I'm saying that, as described so far, the request seems unclear or ambiguous.

@Christopher2222 No, that is not a good point. It muddles concepts and doesn't make sense in general.

And in fact you have your example wrong/backwards. But even if you corrected it then you'd be in a position that I anticipated when I wrote above that instead you should utilize an equation. That's because in general your proposal is unworkable, generally ambiguous, and does not make sense.

It doesn't make sense, as you've described it.

If you want to utilize an equation... then do so. You can even assign the equation (which you may utilize) to a name.

But what you've described does not make sense that I can see. You are muddling concepts.

@gaurav_rs Using Maple 2017.2,

for dig from 10 to 20 do
  Digits:=dig;
  forget(evalf); forget(int);
  res := int(fnormal(F1), [theta= Pi/4..7*Pi/4, r= 0..1]);
  printf("Digits=%a  %f\n",dig,res);
end do:

  Digits=10  -1152122349000.000000
  Digits=11  -1116001007100.000000
  Digits=12  -1116001007190.000000
  Digits=13  -1116001007191.000000
  Digits=14  -1116001007191.800000
  Digits=15  -1116001007191.800000
  Digits=16  -1116001007191.796000
  Digits=17  -1116001007191.796500
  Digits=18  -1116001007191.796470
  Digits=19  -1116001007191.796470
  Digits=20  -1116001007191.796470
First 235 236 237 238 239 240 241 Last Page 237 of 612