grompvevo

30 Reputation

One Badge

0 years, 85 days

MaplePrimes Activity


These are questions asked by grompvevo

I want to test how well Maple's numeric solver respects a variety of conservation laws. To do so, I must numerically integrate a numerical derivative; however, every method I've tried using does not work. In essence, I need the following code to work.

restart;
with(PDEtools); with(plots); with(DEtools);
pde := diff(v(x, t), t, t) = diff(v(x, t), x, x);
f := xi -> exp(-xi^2);
a := -10; b := 10; dx := 1/50; t_final := 10;

pds := pdsolve(pde, {v(a, t) = 0, v(b, t) = 0, v(x, 0) = f(x + 5), D[2](v)(x, 0) = -eval(diff(f(x), x), x = x + 5)}, numeric, range = a .. b, time = t, spacestep = dx);

sol_proc := rhs(pds:-value(output = listprocedure)[3]);
sol := (x, t) -> piecewise(a < x and x < b, sol_proc(x, t), 0);
int(fdiff(sol(x, t), [t = 0]), a .. b);

Error, (in depends) too many levels of recursion

I want to solve a pde numerically, where one of the initial conditions involves an integral expression. In essence, I would like to get the following code to run. 

restart;
with(PDEtools);

# the heat equation
pde := diff(v(x, t), t) = diff(v(x, t), x, x);

f := x -> exp(-x^2);

a := -1.68858; b := 1.68858; delx := 1/100; t_final := 5;

pds := pdsolve(pde, {v(a, t) = 0, v(b, t) = 0, v(x, 0) = 1 - int(f(f(s)), s = 0 .. x)}, numeric, range = a .. b, time = t, spacestep = delx);

Error, (in pdsolve/numeric/process_IBCs) improper specification of initial/boundary condition: additional unknown(s) {s} were found in v(x,0) = 1-int(exp(-exp(-s^2)^2),s = 0 .. x)

pds:-animate(frames = 120, t = t_final);

Maple doesn't have any built-in function to evaluate the integral expression, so the initial condition doesn't evaluate to a simple expression involving x. I hope that because pdsolve is outputting numerical results, it should be acceptable for the initial condition to output floats as well.

Page 1 of 1