## 18245 Reputation

14 years, 243 days

## numeric ode solution?...

In another thread you mentioned this in relation to solving an ODE (numerically, presumably).

Why would you want a polynomial fit to that? Is it for export to use elsewhere? If a piecewise polynomial interpolant is wanted then you might be better off extracting that from the solution procedures that dsolve/numeric itself can return.

You should explain properly, clearly, and completely what you're trying to do.

(And please stop submitting multiple posts and questions for this query.)

## ok...

@Lisa6 I downloaded it, followed my instructions above and appended libname with its explicit location in a string, and got the following.

What did you try? Did you use a string with the location you put it on your machine?

```restart;

fn := cat(kernelopts(homedir),"/mapleprimes/convex.mla"):
#march(list, fn);

libname:=libname,fn:

with(FAN);

[&<, &<=, &=, &x, _create, _el, _maximal_list, _new, _print,
_shift, ambientdim, codim, contains, convert/PCOMPLEX,
convert/affine, dim, flagf, flagh, fvector, genhpolynomial,
genhvector, homology, hplanes, hvector, image, iscomplete,
ispointed, ispolytopal, isquasipolytopal, isregular,
issimplicial, lines, maximal, minimal, preimage, rays,
regularpart, regularsubdiv, simplicialsubdiv,
simplicialsubdiv/subdivide, skeleton, stellarsubdiv, support,
traverse, traverse2]

with(convex);

Convex version 1.2.0, Copyright (C) 1999-2016 Matthias Franz

[affinehull, ambientdim, arecompatible, barycenter, boundary,
codim, contains, containsrelint, convhull, corank, corners,
crosspolytope, cube, cyclicpolytope, delaunay, dim, directsum,
distance, domain, dotprod, draw, dual, edges, emptypcomplex,
emptypolyhedron, emptypolytope, facefan, faces, facets, fan,
flagf, flagh, fullcone, fullpolyhedron, furthestdelaunay,
fvector, genhpolynomial, genhvector, hilbertbasis, homology,
hplanes, hspacenos, hspaces, hvector, image, incidencematrix,
incidentfacets, incidentrays, intersection, isaffine,
isbounded, iscomplete, iscontained, isempty, isface, isfulldim,
islinear, ispointed, ispolytopal, isquasipolytopal, isregular,
issimple, issimplex, issimplicial, issimplicial1, join,
lensspace, lineality, linearhull, lines, maximal, maximum,
minimal, minimum, minkowskisum, modz, newtonpolytope,
normalfan, pcomplex, permutahedron, plotdata, polar, poshull,
posorthant, pred, preimage, projspace, proximum,
randompolytope, rank, raynos, rays, readpoly, recession,
regularpart, regularsubdiv, relint, simplicialsubdiv, skeleton,
stdsimplex, stellarsubdiv, succ, support, surface, torsion,
transversalfan, traverse, traverse2, vertexnos, vertices,
volume, voronoi, wprojspace, writepoly, zerocone, zerofan]```

I don't understand why you wait until the third message to provide the link to the file. It's not very helpful.

## pardon?...

@Lisa6 I don't understand what you're trying to say.

Is this a duplicate of your earlier question about the 3rd party package?

It's not evident what you actually tried here, with libname. What string did you use? What's in the .mla file? I won't be able to guess those things.

## comment...

@Anthrazit The Units:-UseUnit facility allows the kernel session to actually generate expressions with the preferred units. Under the hood, this works by utilizing a modification of the SI system.

The units-formatting facility of the GUI allows it to customize the units (of equivalent dimension) in the prettyprinting of the expressions (regardless of which form they actually contain).

So, if you force the units-formatting facility of the GUI to utilize its notion of the SI units then that appears -- visually -- to override the effect of the Units:-UseUnit (or convert(...,units,...) expression contructions.

So you might keep units-formatting off (set to "none"), if utilizing UseUnit. Or you might possibly be able to get the kN/m effect with units-formatting alone. But it might be problematic to have the two mechanisms work together.

## two things...

@Anthrazit I see two problems.

The first is a mistake on your part. You have used just the name mm for the expressions assigned to b amd h. That's not the same as Unit(mm), or what you get from the Units palette. A visual cue is that the plain name mm appears in italics, whereas the units get typeset in upright font.

The second problem rakets to so-called unit-formatting in the Document. Your Document seems to have output unit formatting set to SI as default for the sheet. That overrides the conversions I showed -- the values of the expressions is in terms of the desired kN/m but (rightly or wrongly) the GUI prettyprints it using SI default units. It works fine for me in a new Document or Worksheet, or if I toggle unit-formatting off in an output area of yours. You might choose to avoid such a blanket default for your Document (since individually changing various outputs formatting back again would of course be the tedious effort to avoid).

## "optimize"...

@Grigoriy Yashin You have not given any clear description of what you mean by "optimize", and without such it is unreasonable to expect a programmatic approach for attaining it. What is your definition?

I cannot tell whether you prefer E1 or E2 below (or the variant Kitonum showed), and why.

## comment...

@Carl Love It's quite possible that I am misunderstanding your definitions.  Is this supposed to be covered by it?

```restart;
{ x+z, y+x }[1];

x + z

restart;
z+x:
{ x+z, y+x }[1];

y + x```

## collect, etc...

@Grigoriy Yashin Maple's trig commands work with radians, so you want Pi rather than 180, and in that case it does the simplification automatically.

As I mentioned before, the collect command can be useful for simplifying rearrangements. In this case it helps to first replace the terms m__1+m__2+m__f with a temporary, then collect, and then resubstitute. I uses the frozen form as the replacement, and resubstitute merely by thawing. Alternatively, you could also do the algsubs with any temp names of your choice. Or you could use subs and substitute only for the literal occurences of m__1+m__2+m__f.

The following shows some possibilities, for collect.

That last result is relatively quite compact, though of course it depends on the metric for measuring size of an expression.

## duplicates...

Please stop(!) posting duplicates of this query.

You may need to install all of the subpackage -- and perhaps even most or all of the parent package -- to get full functionality of the command in question.

You should start off by sending an inquiry to the authors of this 3rd party package.

## example...

@HuanLuong A brief description of a data collection with "blank cell data" is not an example of a data collection with "blank cell data".

## undefined...

@HuanLuong If you replace each "blank cell data" value with either undefined or Float(undefined) then the plotting command should exclude it from the rendered surface.

I cannot state precisely how to do the replacement programmatically, since you haven't given an example of such a data collection with "blank cell data".

## second example...

@Grigoriy Yashin Your second example demonstrates how one can get into a muddle by using several unnecessary layers of operators. It makes it less easy to tell how it has gone wrong, with diff being called on names rather than function calls in t. For example, you need to apply wrt t and get x(t) before calling diff and not afterwards.

Also, the intial, short operators like x:=t->x are wrong (and near meaningless).

But your whole second example can be handled simply with no operators at all (at least, not for this task -- and you could always unapply the final result, say with respect to t).

I suggest that you stop using operators in the original way, as it obscures what is going on, and is overly confusing.

By the way, your input contains two names which can appear like `l__2c` but which are not the same. In one of them the "c" seems to be a UTF-8 encoding, perhaps `\321\201`. Anyway, they are not the same name, and I suspect that is an oversight or typo. I have made them the same, below. Of course, if you really intended them to be different then you can change it. The important thing is that all you really need here is expressions.

If you are interested in rearranging your result with some particular form in mind then I suggest that you also look at the collect command. That command accepts a third parameter which specifies how to treat the resulting coefficient term. For example,
collect(V__2si, [l__1, l__2c], u -> simplify(u, size));
collect(V__2si, [diff], u -> simplify(u, size));
collect(V__2si, [diff(theta__si(t), t), diff(beta__si(t), t)], u -> simplify(u, size));
collect(V__2si, [diff(x(t), t), diff(z(t), t)], u -> simplify(u, size))

and so on. There are many variations. It wasn't clear to me what form you prefer.

Also, you might prefer to have the output of certain function calls (with respect to t) appear in suppressed form. And you might prefer a prime notation for derivatives. This is only a suggestion. You might find it easier to see the structure of the terms in the output if your document starts with one or both of these commands:
PDEtools[declare](theta__si(t), beta__si(t), psi(t),x(t),z(t));
PDEtools[declare](prime = t);

## evalf(Int(...) option...

@dharr You can speed that up quite a bit by adding the options method=_d01ajc,epsilon=1e-5 to the Int call assigned to intt.

## multiple...

This is also reasonably quick (turning off adaptive plotting could make it even faster...).

It also includes a dotted asymptote for m=1.4, and you could add such for the other m values, if you please.

```restart;
ig := 2*sqrt((a^2 + 1)/(x^2 + 1))
/sqrt((x^2 + 1)*exp(4*m*(arctan(a) - arctan(x))) + (-a^2 - 1)):
H:=Int(ig,x=a..X,method=_d01ajc,epsilon=1e-5):
Mvals:=[0.8, 1.0, 1.2, 1.3, 1.35, 1.4]:
plots:-display(
plot(evalf(Int(eval(ig,[a=3,m=1.4]),x=3..infinity)),
X=3..200,linestyle=dot,color=gray),
plot([seq(eval(Re(H),[a=3]),m=Mvals)],X=3..200,
legend=Mvals)
);
```

## ???...

What is this!? The dummy variable of integration is x, and the range is set by you with the value given for a and infinity.

As given the integral doesn't contain any free variable with respect to which to plot, once evaluated at the given numeric values of the two parameters a and m. As you gave it, the integral has a constant value.

Did you intend for the upper limit of integration to be some free name, instead of infinity as you wrote it? In such a case you could plot for the value of the integral versus that name.

 1 2 3 4 5 6 7 Last Page 3 of 414
﻿