Mariusz Iwaniuk

872 Reputation

14 Badges

3 years, 348 days

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by Mariusz Iwaniuk

 

What is the source of this plot? References ?

Only workaround.Convert to abs or signum(strange two white lines !) also works.

f := max(1, min(x, 2))+max(1, min(y, 2));

f2 := convert(op(1, f), piecewise)+convert(op(2, f), piecewise);

plots:-inequal(f2 <= 3, x = -5 .. 5, y = -5 .. 5, 'nolines');

f3 := convert(op(1, f), abs)+convert(op(2, f), abs);

plots:-inequal(f3 <= 3, x = -5 .. 5, y = -5 .. 5, 'nolines');

f4 := convert(op(1, f), signum)+convert(op(2, f), signum);

plots:-inequal(f4 <= 3, x = -5 .. 5, y = -5 .. 5, 'nolines');

 

@Markiyan Hirnyk 

(* "11.3.0 for Microsoft Windows (64-bit) (March 7, 2018)" *)
    
    sol = Reduce[{4*x1 + 7*x2 + 6*x3 == 186, 
    Floor[(1/2)*x1] + Floor[(1/5)*x2] + Floor[(1/3)*x3] == 18, 
    Floor[(1/5)*x1] + Floor[(1/2)*x2] + Floor[(1/4)*x3] == 21}, {x1, 
    x2, x3}, Reals];
RegionPlot3D[ImplicitRegion[sol, {x1, x2, x3}], MaxRecursion -> 2, PlotPoints -> 10](* ? *)

Gives a empty plot. Maybe user  vv 4397 is right.

2D version:

eq2 = {Floor[(1/2)*x1] + Floor[(1/5)*x2] + 
     Floor[-(2/9)*x1 - (7/18)*x2 + 1/3] - 8 == 0, 
   Floor[(1/5)*x1] + Floor[(1/2)*x2] + 
     Floor[-(1/6)*x1 - (7/24)*x2 + 3/4] - 14 == 0};
sol2 = Reduce[eq2, {x1, x2}, Reals]

RegionPlot[ImplicitRegion[sol2, {x1, x2}]](*Warning !!! MMA eat's RAM Memory. A bug ? *)

RegionPlot[ImplicitRegion[sol2, {x1, x2}], 
 Method -> {"DiscretizationMethod" -> "Symbolic"}, MaxRecursion -> 2, 
 PlotPoints -> 10](*Workaround*)

@VMorsaint 

Extract real solution using remove command witch user Acer mentioned:

sol := [RootFinding:-Analytic(4^x+1-x^4, x, re = -5 .. 10, im = -2 .. 2)]: remove(is, sol, nonreal);

#[2.09401285285812, -1.05356701067272, 3.98972895158790]

Answer looks better if you use  LogicalExpand.

sol = Reduce[{4*x1 + 7*x2 + 6*x3 == 186, 
   Floor[(1/2)*x1] + Floor[(1/5)*x2] + Floor[(1/3)*x3] == 18, 
   Floor[(1/5)*x1] + Floor[(1/2)*x2] + Floor[(1/4)*x3] == 21}, {x1, 
   x2, x3}, Reals] // LogicalExpand

RegionPlot3D[ImplicitRegion[sol, {x1, x2, x3}]]

 

@Carl Love 

Thanks for showing Maple weakness in: inttrans(fourier(piecewise function)).

I need convert twice piecewise function :P

@Preben Alsholm 

Nothing new,Maple leaks  like a sieve.Thanks for info.

@Preben Alsholm 

Thank you for quick fix.  :)

@isifesai 

Code for Maple below 2018 version.

Integro-Eq_Ver_3A.mw

@panke

I edited my answer and works as it should.

@Preben Alsholm 

Reading this paper on page 87 says better is Trapezoidal rule.


 

restart

intsolve(y(x) = x+Int((x-t)*y(t), t = 0 .. x), y(x))

y(x) = (1/2)*exp(x)-(1/2)*exp(-x)

(1)

convert(y(x) = (1/2)*exp(x)-(1/2)*exp(-x), trigh)

y(x) = sinh(x)

(2)

restart

func := proc (x, n) x+evalf[5](Int((x-t)*(('ifunc')(n-1))(t), t = 0 .. x, method = _d01ajc)) end proc; func(x, 0) := x

N := 0.5e-2

0.5e-2

(3)

Terms := 5

5

(4)

ifunc := proc (j) option remember; Interpolation:-Interpolate([seq(x, x = -3 .. 3, N)], [seq(func(x, j), x = -3 .. 3, N)], method = cubic) end proc; ifunc(0) := proc (x) options operator, arrow; x end proc

plot(sinh(x)-(ifunc(Terms))(x), x = -3 .. 3)

 

``


 

Download Volterra_integral_equation_ver2.mw

@isifesai 

I speed up computations by numeric integration.Code still requires polishing(Speed up).


 

restart

EQ := y(x) = a*(k*x+1)+b*x-k*(Int((x-t)*y(t), t = 0 .. x))+2*(Int(sqrt(x-t)*y(t)^3, t = 0 .. x))/sqrt(Pi)

y(x) = a*(k*x+1)+b*x-k*(Int((x-t)*y(t), t = 0 .. x))+2*(Int((x-t)^(1/2)*y(t)^3, t = 0 .. x))/Pi^(1/2)

(1)

restart

kernelopts(floatPi = true)

a := 0; b := 1; k := 1; A := 0; B := 3

0

 

1

 

1

 

0

 

3

(2)

ifunc := proc (j) local func; option remember; func := proc (x, n) option remember; a*(k*x+1)+b*x-k*evalf[5](Int((x-t)*(('ifunc')(n-1))(t), t = 0 .. x, method = _d01ajc))+2*evalf[5](Int(Re(sqrt(x-t)*(('ifunc')(n-1))(t)^3), t = 0 .. x, method = _d01ajc))/sqrt(Pi) end proc; func(x, 0) := a*(k*x+1)+b*x; Interpolation:-Interpolate([seq(x, x = A .. B, 0.1e-1)], [seq(func(x, j), x = A .. B, 0.1e-1)], method = cubic) end proc; ifunc(0) := proc (x) options operator, arrow; a*(k*x+1)+b*x end proc

plot([seq((ifunc(j))(x), j = 1 .. 5)], x = A .. B, view = [A .. B, 0 .. 10])

 

plot((ifunc(5))(x), x = A .. B, view = [A .. B, 0 .. 10])

 

``


 

Download Integro-Eq_Ver_2A.mw

Works only in Maple 2018 and above.

@mmcdara 

I find a way to solve my problem.

Thank you for your contribution.


 

restart

intsolve(y(x) = x+Int((x-t)*y(t), t = 0 .. x), y(x))

y(x) = (1/2)*exp(x)-(1/2)*exp(-x)

(1)

convert(y(x) = (1/2)*exp(x)-(1/2)*exp(-x), trigh)

y(x) = sinh(x)

(2)

restart

func := proc (x, n) x+evalf[5](Int((x-t)*(('ifunc')(n-1))(t), t = 0 .. x, method = _d01ajc)) end proc; func(x, 0) := x

ifunc := proc (j) option remember; Interpolation:-Interpolate([seq(x, x = -3 .. 3, .2)], [seq(func(x, j), x = -3 .. 3, .2)], method = cubic) end proc; ifunc(0) := proc (x) options operator, arrow; x end proc

plot([sinh(x), (ifunc(5))(x)], x = -3 .. 3, linestyle = [3, 4], color = ["Red", "Green"])

 

``


 

Download Volterra_integral_equation.mw

4 5 6 7 8 9 10 Last Page 6 of 22