acer

32333 Reputation

29 Badges

19 years, 323 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@permanoon123 So, why can't you be bothered to type in the integral in Maple yourself?

@permanoon123 Why do you want to work with the trapezoid rule?

What do you mean by stating that y=2, when y is used as a variable of integration?

What is f(y)?

@Carl Love I believe that the Equation Label needs to be shown to be used, and they are only shown alongside output.

I inserted a Label reference, and then went back and supressed output of the line that had that Label, by terminating the statement with a full colon. Upon re-execution of the whole sheet that inserted reference became "??" and the error "Invalid label reference" was emitted. This was in a Worksheet, in 1D input mode.

Moreover, only one Label gets shown if I have several statements in an Execution Group, each terminated with a semicolon. An inserted reference seems to get the last output.

Please provide a complete example.

Did you perhaps intend this as an optimization problem, to find values which made the equations close to zero?

Why set the data up in floating-point, and incur loss of precision up front?

Did you forget to attach something?

Which Maple version are you using?

@Carl Love There is some problematic aspect to that use of thisproc (but I'm not sure just what...), and style=pointline (Maple 2015?).

LogisticMapM1802.mw

@weidade37211 

You can also see Wikipedia for more thorough descriptions of symbolic and numeric integration.

Here are some basic notes on Maple syntax for doing both such computations.

restart

The following are calls to the active command int  (lowercase), or its 2D Input analogue.

I entered the second one of these using the Expression palette . Notice that the 2D Input integral symbol is in black.

int(sin(x), x = 0 .. Pi)

2

int(sin(x), x = 0 .. Pi)

2

 

The following are calls to the inert command Int  (capitalized). Notice that the 2D Input integral symbol is in gray.

 

H := Int(sin(x), x = 0 .. Pi)

Int(sin(x), x = 0 .. Pi)

That can also be entered in 2D Input using command-completion :

R := Int(sin(x), x = 0 .. Pi)

Int(sin(x), x = 0 .. Pi)

Those can be turned into active calls using the value  command:

value(H), value(R)

2, 2

They can also be computed using numeric integration . (See also here.)

evalf(H), evalf(R)

2.000000000, 2.000000000

Numeric integration can also be done by supplying a floating-point value in the integration range, or by supplying the option numeric in a call to active int. (For this to succeed and produce a floating-point result the integrand must evaluate to numeric values for each numeric substitution of the variable of integration, naturally). I do not recommend this syntax, as it blurs the more clear distinctions above.

int(sin(x), x = 0. .. 3.1415)

1.999999996

int(sin(x), x = 0 .. Pi, numeric)

2.000000000

The syntax evalf(Int(....)) allows for various additional options, which specify the numerical method, working precision, tolerance, etc.

evalf(Int(sin(x), x = 0 .. Pi, method = _Dexp, epsilon = 0.1e-13, digits = 15))

2.00000000000000

See also Section 4.2  of the User Manual, and Section 7.4  of the Programming Guide.

Download integration_notes.mw

@Norwegian explorer 

Could you not share the full details, if you have numeric values for the other parameters, or other definitions in play?

Attach a document or worksheet that contains full code to reproduce this.

Try it as,
    while (eps>0.001) do

And put statement terminators (color or semicolon) on the lines that assign to i and nstar.

And now here it is using the irregular 3D data (from rows 100 to 2640, I'm not sure yet just what's going on with the first 100 rows).

The surface plot looks like the 3d image the OP posted in a followup comment, but much smoother (and faster). The generated explicit expression and interpolating procedure can now be easily used to generate contour plots -- also done below.

restart;

a := 45/100;
#a := 2/3:

9/20

UC := proc(n, m__yy, m__zz)
  piecewise(1/5 < n, m__yy^2/min(1,(1-n)/(1-1/2*aa))^2
                     +(m__zz/piecewise(n <= aa, 1, 1-(n-aa)^2/(1-aa)^2))^(5*n),
                     m__yy^2/min(1,(1-n)/(1-1/2*aa))^2
                     +m__zz/piecewise(n <= aa, 1, 1-(n-aa)^2/(1-aa)^2));
end proc:

eval(UC(n, m__yy, m__zz), aa = a):

KK := simplify(%);

KK := piecewise(n <= 1/5, m__yy^2+m__zz, n <= 9/40, m__yy^2+m__zz^(5*n), n <= 9/20, 961*m__yy^2/(1600*(n-1)^2)+m__zz^(5*n), 9/20 < n, 961*m__yy^2/(1600*(n-1)^2)+(-121*m__zz/(400*n^2-360*n-40))^(5*n))

RR := solve({KK = 1, 0 < m__zz, 0 < n, m__zz < 1, n < 1}, {m__yy}):
RRR := (simplify(RR) assuming (0 < n, n < 1, 0 < m__zz, m__zz < 1)):
RRRR := subsindets(RRR, list, uu -> eval(m__yy, uu[1]));

RRRR := piecewise(n <= 1/5, sqrt(1-m__zz), n <= 9/40, sqrt(1-m__zz^(5*n)), n <= 9/20, -40*sqrt(1-m__zz^(5*n))*(n-1)*(1/31), 9/20 < n, -40*sqrt(1-m__zz^(5*n)*(-25937424601/(102400000*(10*n^2-9*n-1)^5))^n)*(n-1)*(1/31))

FF := [solve({RRRR = 0}, {m__zz})]:
FFF := (eval(m__zz, simplify(%[1])[1]) assuming (a < n));
#evalf(eval(FFF, n = 0.7));

(40/121)/(-1/(10*n^2-9*n-1)^5)^(1/5)

P1s := plot3d([RRRR, m__zz, n],
               m__zz = 0 .. piecewise(n <= a, 1, FFF) - 0.1*10^(-8),
               n = 0 .. 1, labels = [m__yy, m__zz, n], color="Orange",
               view = [0 .. 1, 0 .. 1, 0 .. 1], style = surface):

REStotaal:=ImportMatrix(cat(kernelopts(homedir),"/mapleprimes/REStotaal.txt")):

M:=REStotaal[..,4..6]:

FF:=Interpolation:-Interpolate(M[100..,1..2],M[100..,3],
                              method=radialbasisfunction, linear):

plots:-display(
  P1s,
  plot3d(FF,0..1,0..1,style=surface,color="SteelBlue")
);

C := [1/5, a/2, a, 0.6, 0.7, 0.8, 0.9];
plots:-display(
  plots:-contourplot([RRRR, m__zz, n],
                     m__zz = 0 .. piecewise(n <= a, 1, FFF) - 0.1*10^(-8),
                     n = 0 .. 1 - 0.1*10^(-8), labels = [m__yy, m__zz],
                     view = [0 .. 1, 0 .. 1], coloring = ["LightGreen", "Blue"],
                     contours = C, thickness = 3),
  plots:-contourplot('FF'(m__zz,n), m__zz=0..1, n=0..1,
                     view = [0 .. 1, 0 .. 1], coloring = ["LightGreen", "Blue"],
                     linestyle = dot, contours = C, thickness = 3)
);

[1/5, 9/40, 9/20, .6, .7, .8, .9]

 

Download testd5.mw

Could you attach a text file of the actual (irregular) data? That'd help.

[edit: I've been able to grind out a nice, smooth plot of m__zz vs m__yy and n, using explicit piecewise derived from your formula. I'll try to find time to post later. This may help (as well as look smoother).]

First 199 200 201 202 203 204 205 Last Page 201 of 591