acer

32353 Reputation

29 Badges

19 years, 331 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

what is Besselj with lowercase j?  Is it supposed to be BesselJ? 

acer

@Bendesarts Do you mean something like this?

TrigEq3modif.mw

@tomleslie  A space between the 2 and the . (period) should also suffice. But nothing wrong with your suggestion of course.

I forgot to add that the Asker should not be loading LinearAlgebra[Modular] if that specialized subpackage is not what's wanted - it is not the same as the LinearAlgebra package.

@Bendesarts It's not clear to me whether you want to keep that "common" denominator.

TrigEq2.mw

Did you also wish to allow combining some of the trig terms?

Try changing those two instances of floating-point 2. to exact 2 instead. (It's possible that you intended the `.` for explicit multiplication, but forgot the spaces and hence input floats.)

acer

@Kitonum It may be worth noting that the optional second argument to `combine` may be useful in such cases, in order to restrict what kinds of combining are done if additional kinds of terms are present. Eg,

combine(y(x) = 1/3/2^x+_C1/(3^x)^2 + cos(x)*sin(x));   
    
                               x  (2 x)                   x      (2 x)   (-x)  (-2 x)
                y(x) = 1/6 (3 2  3      sin(2 x) + 6 _C1 2  + 2 3     ) 2     3

combine(y(x) = 1/3/2^x+_C1/(3^x)^2 + cos(x)*sin(x), power);

                                     (-x)
                                     2            (-2 x)
                              y(x) = ----- + _C1 3       + cos(x) sin(x)
                                       3

@samira moradi 

I suspect that the "rsquared" result may only be available when the target expression is linear in the parameters. Additional computed results and statistics may be obtained using the `solutionmodule` output (or, with a list of strings as the rhs of the `output` option). Also see the help page for the Statistics:-Fit command.

restart;

X := a * (-0.6356560300e-1*ln(Y+200.+17.54410643*Y^(2/3)+102.5985568*Y^(1/3))+
          0.6356560300e-1*ln(Y+200.)-.2201977080*arctan(.1974510146*Y^(1/3)
          -.5773502693)+.1096187623);

vx := <1500, 1340.00, 1135.00, 982.00, 884.15, 704.72, 520.00, 287.00, 70.00, 0.>:
vy := <0., 4.28, 7.77, 7.30, 9.00, 13.00, 25.85, 28.91, 38.48, 50.00>:

f:=Statistics:-Fit(X, vy, vx, Y, output=solutionmodule):

f:-Results("parametervalues");

f:-Results("leastsquaresfunction");

f:-Results("residualsumofsquares");

f:-Results("residualmeansquare");

f:-Results("rsquared");

f:-Results("rsquaredadjusted");

#f:-Results();

p1:=plot(vx,vy,style=point):
p2:=plot( [f:-Results("leastsquaresfunction"),Y,Y=0..50],color=red):
plots:-display(p1,p2);

@Traruh Synred Why not upload the xxx_MAS.bak file (or whatever) that is non-empty?  I mean, if it does not open properly, even after renaiming the file's extension from .bak to .mw say.

@Annonymouse I don't see a way to get the slightly larger asterisk that is tighter against the `y` (as Carl showed), without the subscript being set too far to the right. That leaves mostly the examples where the asterisk is slightly smaller and higher (as an exponent), but at least not too far right. It's tricky because the asterisk gets a higher baseline.

restart;
with(DEtools):
NLC := diff(y(t), t) = k*(Am-y(t));
Am := 20; k := .1;
ivs := [y(0) = 10, y(0) = 30, y(0) = 50];

DEplot(NLC, y(t), t = 0 .. 20, ivs,
       tickmarks = [default,
                    [10 = `y*__1`,
                     15 = `y*`[1],
                     20 = `#msubsup(mi("y"),mn("1"),mo("&ast;"))`,
                     30 = y[1]^`&ast;`,
                     40 = y[1]^`&lowast;`,
                     50 = y[1]^`&ast;` ]],
       font = [default, default, 15], view=7..50);

You could try using the entity lowast instead of ast, as I did above at tick y=40. But on my Linux that doesn't look pretty.

An additional wrinkle is that the y-view is not automatically expanded below to fit the y-tickmarks. So if your specified font makes the tick at y=10 too large then it may not get displayed unless you force a taller y-view.

Use the Big Green Arrow icon in the mapleprimes responses editor's menubar, to upload a copy of the corrupted worksheet.

acer

@tomleslie This is not the first post by this member with a mish-mash of incorrect usage (including improper use of MTM:-diff ).

Since the member does not seem capable of grasping that some of the problems start with the line with(MTM) then I don't see why anyone would bother to struggle more to help.

@Christopher2222 If the compiled proc cfix gives you problems you could use the slower evalhf(fix(...)) call instead.

I'm not sure that the success is so remarkable. The uniformly distributed noise is likely to leave quite a bit of local information (when it exists before the noise is added...).

Here is a refinement, where the width of the subarea used for interpolation is a supplied option. Also, if a pixel appears undamaged (value<1.0) at a particular layer then accept that value.

fiximgwidth.mw

With 90% damaged pixels, a slightly blurred reconstruction looks pretty good, using 4 for the width (ie, the 9x9 subarea around each pixel as opposed to width 1 for a 3x3 subarea).

Also, the process may be repeated. Ie, compare,

cfixed4:=Array(1..n,1..m,1..3,datatype=float[8],order=C_order):
CodeTools:-Usage( cfix( damaged2, cfixed4, n, m, 4 ) ):
Embed([img,damaged2,cfixed4]);

with,

cfixed4:=Array(1..n,1..m,1..3,datatype=float[8],order=C_order):
CodeTools:-Usage( cfix( damaged2, cfixed4, n, m, 4 ) ):
CodeTools:-Usage( cfix( copy(cfixed4), cfixed4, n, m, 4 ) ):
Embed([img,damaged2,cfixed4]);

or,

cfixed4:=Array(1..n,1..m,1..3,datatype=float[8],order=C_order):
CodeTools:-Usage( cfix( damaged2, cfixed4, n, m, 2 ) ):
CodeTools:-Usage( cfix( copy(cfixed4), cfixed4, n, m, 2 ) ):
Embed([img,damaged2,cfixed4]);

@Don_Caraota Note that DirectSearch:-SolveEquations can return local minima which are not actual roots (say, in the case that no roots are found). You may have to take care to proprocess and analyze residuals yourself, in order to ensure that you avoid this case.

@Earl If I had two lists N and M representing out-of-order pairs then I'd be tempted to use simple angle-bracket notation to make them into an n-by-2 Matrix, which could still be re-ordered by indexing with [sort(N, output= permutation)] where N is the independent data. The plot command would handle that result.

First 297 298 299 300 301 302 303 Last Page 299 of 592