acer

31404 Reputation

29 Badges

19 years, 132 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

I'll address your error message: [Length of output exceeds limit of 1000000]

If you are going to assign the odeplot result to a name then the GUI can get confused when trying to inline print/display the output. (...in the case that the plot structure is very large.)

You can get around that by doing it in two steps:

# Note that this next statement is terminated with a full colon.
phaseplot := odeplot(sol, [x(t), y(t)], 0 .. 20000, numpoints = 20000,
                     color = red, thickness = 2,
                     axes = boxed, gridlines,
                     title = "Phase-space Diagram"):

# Now, terminating with a semicolon, to show it.
phaseplot;

extra_steps_ac.mw

 

e := Int(1/(3*u^4 + u + 3), u):

IntegrationTools:-Change(e, u=y*x^(1/3), y);

    Int(x/(3*x^2*y^4+x*y+3*x^(2/3)),y)

One way is the following change of variables, after which the integration succeeds.

Then, the actions after the call to value are just to massage the form. You can adjust or fiddle with them to get variants.

But simplify of the difference between this form and your particular target form produces zero.

restart;

kernelopts(version);

`Maple 2024.0, X86 64 LINUX, Mar 01 2024, Build ID 1794891`

foo := Int(sqrt(x^2+sqrt(x^4+1))/(x+1)/sqrt(x^4+1),x=0..infinity);

Int((x^2+(x^4+1)^(1/2))^(1/2)/((x+1)*(x^4+1)^(1/2)), x = 0 .. infinity)

bar := IntegrationTools:-Change(foo,u=x^2 + sqrt(x^4 + 1)):

combine(evala(convert(simplify(value(bar)),ln)));

(1/8)*(2+2*2^(1/2))^(1/2)*ln(113+80*2^(1/2)+72*(1+2^(1/2))^(1/2)+52*(2+2*2^(1/2))^(1/2))


Download Int_CW.mw

It's not clear to me what might be your precise problem or actual goal.

But here is a modified example.

Test_ac.zip

Are you trying to get something like the following?

restart;

y := (1 + diff(u(r), r))*diff(u(r), r, r)
     + (1 + vs*u(r)/r + (1 - vs)/2*diff(u(r), r))*diff(u(r), r)/r
     - (1 + (1 + vs)/(2*r)*u(r))*u(r)/r^2;

(1+diff(u(r), r))*(diff(diff(u(r), r), r))+(1+vs*u(r)/r+(1/2)*(1-vs)*(diff(u(r), r)))*(diff(u(r), r))/r-(1+(1/2)*(1+vs)*u(r)/r)*u(r)/r^2

PDEtools:-dchange({r=R*rs, u(r)=h*U(R*rs)}, y, [rs, U]);

(1+h*(D(U))(R*rs))*h*((D@@2)(U))(R*rs)+(1+vs*h*U(R*rs)/(R*rs)+(1/2)*(1-vs)*h*(D(U))(R*rs))*h*(D(U))(R*rs)/(R*rs)-(1+(1/2)*(1+vs)*h*U(R*rs)/(R*rs))*h*U(R*rs)/(R^2*rs^2)


Download dchange_ex.mw

It works if one specifies the function, eg. as y(x).

(That error message is attempting to describe an ambiguity, otherwise)

ode:=diff(y(x),x$2)+diff(y(x),x)+y(x)=0;

diff(diff(y(x), x), x)+diff(y(x), x)+y(x) = 0

dsolve([ode,D(y)(a)=b], y(x));

y(x) = (3^(1/2)*c__2*sin((1/2)*3^(1/2)*a)+2*b*exp((1/2)*a)+c__2*cos((1/2)*3^(1/2)*a))*exp(-(1/2)*x)*sin((1/2)*3^(1/2)*x)/(3^(1/2)*cos((1/2)*3^(1/2)*a)-sin((1/2)*3^(1/2)*a))+c__2*exp(-(1/2)*x)*cos((1/2)*3^(1/2)*x)

dsolve_exx.mw

The following takes about 1sec on my machine,

map(u->fsolve(unapply('evalf[15]'(u),T)),
    subsindets((rhs-lhs)~(eval(eqList,t=T)),
               specfunc(Int),
               uu->Int(op(uu),method=_d01ajc,digits=15)));

  [-4.000000000, -3.139954398, -2.113700371, -1.528831968, 
   -1.048408886, -0.7066382663, -0.4795776807, -0.3151696062, 
   -0.1824325597, -0.06254879140, 0.08914597087, 0.3686891818, 
   1.504692983, 2.115525214, 2.461195982, 2.720883279, 
   2.962135688, 3.213074710, 3.598125622, 5.163493045, 
   6.560014160, 6.814134444, 6.668244819, 6.405779566, 
   6.193526060, 6.022014505, 5.954332725, 6.067614012,
   6.326776518]

The term "student portal" is quite often used to refer to the following documentation, which is available both online as well as (offline) in the Maple GUI's own Help system:  Maple Portal
(nb. In the actual Maple GUI you can issue ?portal or search for the term portal in the Help browser.)

A slightly higher link is this Student Help Center link.

There is also the Teacher Resource link, and the online Training link.

And all of those can be accessed from Maplesoft's main webpage, under the Support and Resources tab at the top.

You can do,

    rtable_eval(M)

That command was invented for dealing with this kind of situation.

The behavior you showed relates to a full eval not making a copy of an rtable, which relates to the (good) design of not having the mutable rtable structures (Matrix,Vector,Array) get passed as copies when they're arguments in procedure calls. (This allows for in-place sematics for rtables, in procedure calls.)

Can you not just assign copy(T) to some other name, and then act in-place on that (in the usual way) by assigning to indexed entries?

You should be able to run this in Maple 2024.1 (or Maple 2023.2, etc). But not Maple 2024.0 which had a bug, now fixed.

I created a procedure which generates a static plot for any values of those parameters (and tfinal the end-point for t). Then I show how it can be used with Explore, or plots:-animate letting the tfinal value change. [This is a natural way to proceed; I see now that Carl has done much the same thing.] I also allow extra arguments to the procedure be passed along into the odeplot call (for which I too collapsed your seq into a single call).

You could also add the plotting command view option to the calls to G, if you'd prefer. Eg,
   view=[0..7, -10..2]
etc.

explore_odeplot_2.mw

Adjust other options as wanted.

[edit] It is interesting; when I first posted this Answer it was the only one, but now Carl's appears above it -- even with no votes yet for either. Perhaps the system got confused by very close posting times. (But I've also seem some other curious new behavior by this site.)

Consider the situation where the name e has been assigned a value, at the level at which you are making those calls.

For example, after e:=37 has been executed.

Now m:-e will still access that export of your given module. But m[e] will not, since that evaluates to a reference to m[37]. You could use m['e'] however.

And it could get even more complicated inside some procedure which had e as a parameter. Then m['e'] might not access that export of m, while m[':-e'] could work ok.

So, if two decent choices are m:-e and m[':-e'], which is easier to type and use? For me, it's the first of those two.

The different results you see are because in the case of x (instead of 2) there is ambiguity, as C_R explains.

You've asked whether the difference arose from using the two input forms, ie. 2D Input with the explicit command, versus 2D Input with units-shortcut entry. In that case the only difference (ie. if the commands were the same) would be that with the shortcut the unit in the input is typeset like in the output.

Below I've used Alt-Shift-u to get the Unit(m) typeset in the input for the line involving expr2.  In modern Maple that input renders with an upright Roman "m", without double-braces. (Mapleprimes uses an older backend that still shows the double-braces.)

As the lprint (line-print) command reveals, the expressions themselves are the same.

expr1 := 4*Unit(m)

4*Units:-Unit(m)

expr2 := 4*Unit('m')

4*Units:-Unit(m)

lprint(expr1)

4*Units:-Unit(m)

lprint(expr2);

4*Units:-Unit(m)

Download 2dmath_unit_entry.mw

See also this Help page which describes this hotkey mode of unit entry.

There are two main ways to get a subscripted name.

One involves a double-underscore (so-called Literal Subscript), and another involves an indexed name (so-called Indexed Subscript). The actual constructs for those would be g__n and g[n], respectively.

The ScientificConstants package uses the latter, ie. indexed names, to refer to its constants.

In 2D Input mode you can get the typeset subscripted form for input with the keystrokes,
    g Ctl-Shift-underscore n      (Windows, Linux)
    g Cmd-Shift-underscore n    (Mac OSX)

For example, using those keystrokes,

with(ScientificConstants)

GetConstant(g[n])

neutron_g_factor, symbol = g[n], derive = 2*mu[n]/mu[N]

Download 2dmath_indexed_entry.mw

You can also enter g[n], literally, in either 1D or 2D input modes.

See this Help-page for 2D Input ketyboard shortcuts.

You wrote,

Consider the expression 5m+x. This expression works in
Units:-Simple but not in Units:-Standard.

Units:-Simple adds a quantity 5m to a quantity without units.
But why can one add a quantity with units to a quantity
without units?

Units:-Standard tries to add a quantity 5m to a quantity
that is assumed to have units. What units are assumed?

The point is that the name x might be evaluated later on at some value involving some unit of dimension length.

One can evaluate x (in expressions containing x) with pretty much whatever value you want, in general. And for the expression 5*Unit(m)+x some later value like 3*Unit(mm) or 8*Unit(km) is quite fine. So the expression 5*Unit(m)+x can be allowed. So that's one thing that the newer Units:-Simple does, which the older Units:-Standard does not: it allows such an addition.

You asked, "What units are assumed?" But it's not some specific unit that's taken. It's the dimension of length that is taken.

And with the notion that the x in expression 5*Unit(m)+x can be considered as having dimension length, further dimensionall anaylsis is possible. That dimensional analysis may help with further symbolic manipulation.  That dimensional analysis can also help in the front- and back-ends of commands that are taught to understand units more, eg. plot, fsolve, etc.

First 8 9 10 11 12 13 14 Last Page 10 of 327