acer

32333 Reputation

29 Badges

19 years, 325 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@Hullzie16 You might first decide how accurate you need the results, then figure out how tight the precision and tolerances need to be to achieve that for a single m value, optimize that, and then figure out how many m values you need and optionally reuse a procedure to attain such, etc.

@Prakash J You could import using either ImportMatrix or ExcelTools:-Import , getting a Matrix say. Eg, (using Maple 18.02 as you have),

   M := Matrix(ImportMatrix("mapleprimes/foo1.xls")):

Then you could plot pairs of columns. Eg, you could plot the first column against the second,

   plot(M[..,[1,2]]);

You wrote of multiple plots, for different parameter values, but you're only showing two columns of Excel data.

ps. You didn't respond to my Anwer to your earlier differential equations Question (Blasius solution). Did it serve?

@Prakash J I cannot make sense of what you're trying to say.

@Earl I used the values 1,1/2,1/3 since those are the values used by default in the procedure.

The code can be seen with a showstat of the procedure. Here's a partial view of that:

showstat(`plots/coordplot3d`,7..9);


`plots/coordplot3d` := proc(coordname, ranges0::{list(list), [range, range, range]} := NULL, constvals0::{list(list), [range, range, range]} := NULL, {[labelling, labeling] := NULL})
local alab, cname, i, j, delta_x, delta_y, a, b, points, s, t, m, n, lcolor, f, info
  , viewop, arg_l, fun, ff, M, N, adef, bdef, cdef, ntot, cinfo, ord, c1, c2,
  r, features, oper1, oper2, coord, label, text, tpoints, funct1, funct2,
  funct3, s1, s2, f1, f2, f3, toto, hfsuccess, foo, ignoreview, uinfonames,
  ranges, constvals;
global _x, _y, _z, _F1, _F2, _F3, _ord, _a, _b, _c;
       ...
   7   adef := 1;
   8   bdef := 1/2;
   9   cdef := 1/3;
       ...
end proc
 

Download coordplot3d_vals_M2020.mw

@mr_picky Sorry, I'm not sure what you mean by, "Is there a symbol for this..."?

If you're asking whether there's a 2D Input (like the capitol Sigma Sigma notation) item, like from the palettes or command-completion, then no there isn't.

@Scot Gould Simple is,

  copy(A)

which doesn't have the burden of specifically using Matrix or Vector or Array, to match.

Using copy also preserves any special shape&storage and attributes (except read-only). Using the named constructors removes such, except sparse storage.

Both ways preserve datatype.

Please put your followup queries on this example here, instead of spawning wholly separate new Question threads for such.

(duplicate threads are flagged as such, and possibly then deleted.)

@AHSAN Your Question's attachment was last saved by you in Maple 2022.0.

Accordingly, I used Maple 2022.2 for my Answer. I don't use any add-ons, non-default computational or output settings, or initialization file.

@mmcdara I didn't complete what you did. I implemented something quite different.

By far the major portion of what I did was reimplementing the OP's entire scheme of computing and displaying his boundary as surface and contour rather than mere roughly approximate 3D points. And I implemented all that in wholly new custom procedures, using dsolve/numeric in a different manner.

I also retained his original method=_Dexp for the procedures I added, and instead adjusted the epsilon tolerance.

In one minor spot of his original loop code (which I entirely replaced, IMO) I did happen to also use the d01ajc method. That was purely by coincidence as I hadn't seen your Answer until just now. But I don't prefer the loop approach (or, at least, not any aspect of simply taking the highest mu data value accepted), and wanted method=_Dexp anyway on account of some precision experiments and root-finding I was trying on it.

@AHSAN

For example, the following places the lower flat surface at a custom distance below the bottom of the upper surface. The distance between them is 1/3 of the distance between highest and lowest points in the upper surface.

This attachment shows how that calculation is made programmatically. Adjust to taste.

Help_3D_view_acc.mw

ps. I really think that your Question's original text did not explain what you actually wanted to do.

Please provide full code of your example.

@C_R The OP is using Maple 18 (released 2014), not Maple 2018.

@Ali Hassani The first bullet point of the Rules section of the Help page for define begins, "A rule can be an equational rule specified using the syntax of patmatch, or...".

And the Help page for patmatch describes these terms: nonunit, conditional, and _type.

The terms algebraic, anything, identical, and freeof are Maple types.

Regarding your additional requirement, an additional rule can be added,

restart;

 

define(T,T(a::nonunit(algebraic)+b::nonunit(algebraic))=T(a)+T(b),
         T(a::nonunit(algebraic)*x^n::integer)=a*T(x^n),
         T(a::nonunit(algebraic)*f(x))=a*T(f(x)),
         'conditional'(T(a::anything)=a*T(1),
                       _type(a,And(Not(identical(1)),freeof(x)))));

 

T(alpha__1*x^2*y+alpha__2*x^4*t+alpha__3*t*y);

t*alpha__2*T(x^4)+y*alpha__1*T(x^2)+alpha__3*t*y*T(1)

T(3*t*x^(-2)+4*alpha*t^4*f(x));

3*t*T(1/x^2)+4*alpha*t^4*T(f(x))


Download define_ex2.mw

@Preben Alsholm A partial result,

restart;

sol:=y(x) = (exp(RootOf(-sin(x)*tanh(1/2*_Z+1/2*c__1)^2+sin(x)+exp(_Z)))+sin(x))/sin(x);

y(x) = (exp(RootOf(-sin(x)*tanh((1/2)*_Z+(1/2)*c__1)^2+sin(x)+exp(_Z)))+sin(x))/sin(x)

ode:=diff(y(x),x)-cot(x)*(y(x)^(1/2)-y(x)) = 0;

diff(y(x), x)-cot(x)*(y(x)^(1/2)-y(x)) = 0

sol1,sol2:=allvalues(sol);

y(x) = (exp(-c__1+ln(-1+2*(-sin(x)*exp(c__1))^(1/2))+(2*I)*Pi*_Z1)+sin(x))/sin(x), y(x) = (exp(-c__1+ln(-1-2*(-sin(x)*exp(c__1))^(1/2))+(2*I)*Pi*_Z1)+sin(x))/sin(x)

simplify(evalc(simplify(sol1)),radical) assuming c__1::real, x>0, x<Pi;
simplify(evalc(odetest(%,ode,y(x)))) assuming c__1::real, x>0, x<Pi;

y(x) = ((2*I)*exp(-(1/2)*c__1)*sin(x)^(1/2)+sin(x)-exp(-c__1))/sin(x)

0

simplify(evalc(simplify(sol2)),radical) assuming c__1::real, x>0, x<Pi;
simplify(evalc(odetest(%,ode,y(x)))) assuming c__1::real, x>0, x<Pi;

y(x) = (-(2*I)*exp(-(1/2)*c__1)*sin(x)^(1/2)+sin(x)-exp(-c__1))/sin(x)

0

Download nm_odetest_simp_ex1.mw

@Preben Alsholm Since historically there can be more than one numeral after the first period (or, just one), then one might Search for the leading comma instead.

Eg,

str:=convert(kernelopts(version),string);

   "Maple 18.02, X86 64 LINUX, Oct 20 2014, Build ID 991181"

str[7 .. StringTools:-Search(",",str)-1];

              "18.02"
str:=convert(kernelopts(version),string);

   str := "Maple 2024.0, X86 64 LINUX, Mar 01 2024, Build ID 1794891"

str[7 .. StringTools:-Search(",",str)-1];

              "2024.0"
First 43 44 45 46 47 48 49 Last Page 45 of 592