Mariusz Iwaniuk

892 Reputation

14 Badges

4 years, 39 days

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by Mariusz Iwaniuk

@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

@mmcdara 

Did you read my comments,I need solution with int(numeric) ,not int(symbolic) that I want  CurveFitting for that.

I do not want to wait for computation time an eternity.

Above MMA code give me solution, about a few second.

Thanks anyway.

Volterra2bis_ver2.mw

 

@sand15 

For func(x,7) it should be :x + x^3/6 + x^5/120 + x^7/5040

for n=7 it should be almost the same as sinh(x).

@sand15 

Thanks you for your efforts,but:

1.At first I need int(numeric),because I have  more complicated example and Int(symbolic) can't solve or is very slow.See

2.it does not matter if I use: Interpolation or CurveFitting.

3.Your answer dosen't work for me.("Problem is this method seems to diverge",Why ? I dosen't know)

Maybe exist a workaround and no need to convert code from MMA to Maple.

MMA solution with more complicated example:

 

@vv 

Maple's Sum have troubles, at t=1/10, workaround is:

Let's says for: t=3/100.

1/exp(2.)-evalhf(add(eval(2^(-j)*t^(-2*j)*GAMMA(-2*j+1, 1)*exp(-1)/factorial(j), t = 3/100), j = 0 .. 1000));

#-2.296937672*10^237

int(eval(exp(-1-1/v)*(1-exp(v^2/(2*t^2)))/v^2, t = 3/100), v = 0 .. 1, numeric);

#-2.296937672*10^237

,but for  t=2/100 or near t=0  gives: Float(-infinity) :P

 

Who needs such large numbers?

@weidade37211 

 

I did some tests and you can see Maple 2017.3 have bad performace and baheves incorrectly. 

 

 

@isifesai 

This has nothing to do with the first question.

Please post a new question.

5 6 7 8 9 10 11 Last Page 7 of 23