mmcdara

7891 Reputation

22 Badges

9 years, 54 days

MaplePrimes Activity


These are questions asked by mmcdara

Hi, 

 

Does it exist a way to get all the types a variable verifies?
For instance
x:=4;
type(x, t); # true for t in {positive, posint, algebraic, ...}

Thanks in advance

Hi, 
I need do generate a large number of matrices (always with the same dimensions) whose each column is a random sample of a different random variable.
I wrote a rather simple procedure to do that (see below a notional example). Let T and S the time and the memory size required for a single execution of this procedure, then its execution N times needs a time N*T and a size N*S.
If time is not a problem, the increase in memory size is extremely constraining.
How should I write this procedure in order that N executions of it use a memory of the order of S and not N*S?
 

Download Not_Efficient.mw

 

Hi
I inadvertently discovered that it was possible to create variables in a kind of dynamic way.
I wonder if the way i did  is something which is documented somewhere?

TIA
 

restart:

vars   := [a, b__c, t[1]];

[a, b__c, t[1]]

(1)

k := 1:
for i in vars do
  ``||i := k;
  k := k+1:
end do:

vars;

[1, 2, 3]

(2)

 


 

Download Assignement.mw

Hi, 

I have a 2nd order linear ODE that I solved firstly in a formal way.
The plot of the solution contains a "hole" which, in fact, corresponds to the range where the formal solution is not real.
This seemed strange to me as I expected a real solution.
So I solved this ODE numerically and this gave me a real solution.
Could you please explain that to me ?

Thanks in advance

PS : These results are obtained with Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895

restart:

with(plots):

perturbation := .9*(diff(epsilon(t), t, t)) = (-28.67085587*piecewise(0.2000000000e-1*t < 0.8e-1, 0., 0.2000000000e-1*t < .12, -0.8e-1+0.2000000000e-1*t, 0.2000000000e-1*t < .14, .16-0.2000000000e-1*t, 0.2e-1)-0.7645561571e-1*t-1.548363347)*(diff(epsilon(t), t))-0.7596363e-1*piecewise(0.2000000000e-1*t < 0.8e-1, 0., 0.2000000000e-1*t < .12, -0.8e-1+0.2000000000e-1*t, 0.2000000000e-1*t < .14, .16-0.2000000000e-1*t, 0.2e-1)-0.202569683e-3*t+0.26997403e-1-10.10*epsilon(t)

perturbation := .9*(diff(`&epsilon;`(t), t, t)) = (-28.67085587*piecewise(0.2000000000e-1*t < 0.8e-1, 0., 0.2000000000e-1*t < .12, -0.8e-1+0.2000000000e-1*t, 0.2000000000e-1*t < .14, .16-0.2000000000e-1*t, 0.2e-1)-0.7645561571e-1*t-1.548363347)*(diff(`&epsilon;`(t), t))-0.7596363e-1*piecewise(0.2000000000e-1*t < 0.8e-1, 0., 0.2000000000e-1*t < .12, -0.8e-1+0.2000000000e-1*t, 0.2000000000e-1*t < .14, .16-0.2000000000e-1*t, 0.2e-1)-0.202569683e-3*t+0.26997403e-1-10.10*`&epsilon;`(t)

(1)

Digits:=10:
EPS := rhs( dsolve({evalf(perturbation), epsilon(0)=0, D(epsilon)(0)=0}, epsilon(t)) ):

# a lengthy expression that involves Kummer's special functions

plot(EPS, t=0..10, gridlines=true);


Digits:=20:
evalf(eval(EPS, t=5));
Digits:=10:

 

-0.26529838913395427314e88+0.10340147081332027605e89*I

(2)

numsol := dsolve({perturbation, epsilon(0)=0, D(epsilon)(0)=0}, numeric):

odeplot(numsol, [t, epsilon(t)], t=0..10, gridlines=true, color=red)

 

 


 

Download dsolve_vs_numeric_dsolve.mw

Hi

I would like to know if recent Maples's verion (> 2015) contain methods for solving functional equations ?
Functional_equation

TIA

First 31 32 33 34 35 36 37 Last Page 33 of 48