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

@vv 

Workarounds always exist,but disgust always remains.

Thanks.

@Rouben Rostamian  

de := diff(u(x), x, x)+u(x)*(diff(u(x), x))-u(x) = exp(2*x);

bc := u(0) = exp(0), u(1) = exp(1);

dsol := dsolve({bc, de}, numeric,range = -1 .. 2);

plots:-odeplot(dsol, x = -1 .. 2, view = 0 .. 3);

dsol(2);

#Warnings and Errors ?

Where is my plot on rage -1..2 ?

It seems Mathematica is smarter than Maple.

 

@acer 

Thanks :)

@tschuermann 

Yes,I have this errors messagess from FindRoot.

Increasing in ParametricNDSolve to WorkingPrecision -> 25 helps.

 

My code is terribly slow and  needs to  completely for rework.

I do not have time for such a job.

I not a guru in Mathematica I'm still learning.

Maybe you can ask here.

HeunC_ver2.zip

 

@tschuermann 

For  table 40x40  and more probably you  need increase:

1.Digits:                      15 or 20

2.In dsolve:                abserr = 0.1e-50 ?

3. In dsolve:               changing: method=numericmethod (maybe there is a better method(faster))

4. In findroot code:   {guard::posint:=1,maxtries::posint:=1600} ?Explanation for these number See link. For table 40x40 is: posint:=1600

 

For sure computation times  increase very quickly.

 

@acer 

Hello

Can you explain,what is number 5 and 50 in this code below:

{guard::posint:=5,maxtries::posint:=50}

Thanks.

@tschuermann 

I attached MMA notebook if it's useful to you:HeunC.zip

 

@vv 

What is the correct answer, because I'm not sure of my answer for OP ?

@Markiyan Hirnyk 

MMA  11.3 says:

 

Is Mark Viola is wrong with his answer. It has 127K reputation?

 

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}]]

 

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