johncarl

25 Reputation

One Badge

5 years, 229 days

MaplePrimes Activity


These are replies submitted by johncarl

@Kitonum 

Thank you a lot.

For this method, I need to determine the minimum and maximum of the function eval(z, t = 0) within the ranges x = -10 .. 10, y = -eval(w, t = 0) .. eval(w, t = 0).

Do you know how can I evaluate them?

@Kitonum 

I want the contour plot limitied by y. That is

z := -y + sech(x - 3*t);

w := 10*sech(x - 3*t);

with(plots);

contourplot(eval(z, t = 0), x = -10 .. 10, y = -eval(w, t = 0) .. eval(w, t = 0), contours = 5, grid = [101, 101])

 

Is there any way I can label it? Thanks

@acer 

When I work on it, it says "

Error, invalid input: ContoursWithLabels expects its 3rd argument, Range2, to be of type name = range(realcons), but received ...".

How can I do with it?

Thank you.

 

@acer 

Thank you.

I tried with the following code. However I do not know how to modify it with change of axis range. Can you please help?

 

restart;

ContoursWithLabels := proc (Expr, Range1::(range(realcons)), Range2::(range(realcons)), Number::posint := 8, S::(set(realcons)) := {}, GraphicOptions::list := [color = black, axes = box], Coloring::`=` := NULL)

local r1, r2, L, f, L1, h, S1, P, P1, r, M, C, T, p, p1, m, n, A, B, E;

uses plots, plottools;

f := unapply(Expr, x, y);

if S = {} then r1 := rand(convert(Range1, float)); r2 := rand(convert(Range2, float));

L := [seq([r1(), r2()], i = 1 .. 205)];

L1 := convert(sort(select(a->type(a, realcons), [seq(f(op(t)), t = L)]), (a, b) ->is(abs(a) < abs(b))), set);

h := (L1[-6]-L1[1])/Number;

S1 := [seq(L1[1]+(1/2)*h+h*(n-1), n = 1 .. Number)] else

S1 := convert(S, list)  fi;

print(Contours = evalf[2](S1));

r := k->rand(20 .. k-20); M := []; T := [];

for C in S1 do

P := implicitplot(Expr = C, x = Range1, y = Range2, op(GraphicOptions), gridrefine = 3);

P1 := [getdata(P)];

for p in P1 do

p1 := convert(p[3], listlist); n := nops(p1);

if n < 500 then m := `if`(40 < n, (r(n))(), round((1/2)*n)); M := `if`(40 < n, [op(M), p1[1 .. m-11], p1[m+11 .. n]], [op(M), p1]); T := [op(T), [op(p1[m]), evalf[2](C)]] else

if 500 <= n then h := floor((1/2)*n); m := (r(h))(); M := [op(M), p1[1 .. m-11], p1[m+11 .. m+h-11], p1[m+h+11 .. n]]; T := [op(T), [op(p1[m]), evalf[2](C)], [op(p1[m+h]), evalf[2](C)]]

fi; fi; od; od;

A := plot(M, op(GraphicOptions));

B := plots:-textplot(T);

if Coloring = NULL then E := NULL else E := ([plots:-densityplot])(Expr, x = Range1, y = Range2, op(rhs(Coloring)))  fi;

display(E, A, B);

end proc:

 

z := -y + sech(x - 3*t);

w := 10*sech(x - 3*t);

with(plots);

P1 := plot(eval(w, t = 0), x = -10 .. 10):
P2 := contourplot(eval(z, t = 0), x = -10 .. 10, y = -eval(w, t = 0) .. eval(w, t = 0), contours = 5, grid = [101, 101]):
display(P1, P2);

ContoursWithLabels( eval(z, t = 0), x = -10 .. 10, y = -eval(w, t = 0) .. eval(w, t = 0) );

@Mariusz Iwaniuk 

Thanks.

How about this integral?

I do not know how to use Maple to evaluate it. Thanks.

Page 1 of 1