Jaqr

25 Reputation

3 Badges

2 years, 55 days

MaplePrimes Activity


These are questions asked by Jaqr

Hello,

 

Here is the code I used to generate the image:

densityplot(x,x=0..1,y=-0..0.1,colorstyle=HUE,style=patchnogrid,scaling=constrained,view=[0..1,0..0.1],axes=none);

Then, I exported the image in a eps format. When the file is displayed, white lines appear as a grid. The problem comes from Maple and not from the softwares used to visualize the image. I tried so many things to solve that but...

 

How to solve the problem?

 

Thank you.

 

Jaqr

Hello,

I used the folowing command, but the problem is that there is a blank space in the name of a directory.

 

!curl -m 3 -o /Users/John/Documents/P Admin/a.dat  --insecure https://www.google.com/?gws_rd=ssl;

 

I used macosx, and in a Terminal window the correct path must be written as :

/Users/John/Documents/P\ Admin/a.dat

 

But, impossible to set the right expression with Maple.

I used for instance:

!curl -m 3 -o /Users/John/Documents/P\\ Admin/a.dat  --insecure https://www.google.com/?gws_rd=ssl;

 

But it failed.

 

What is the right expression?

 

Best regards

Hi,

 

Here is my code:

###################

f:=x->piecewise(x>=-1/2 and x<=1/2,1):
eq:={diff(x(t),t)-sum(f(t-k*T),k=0..K)*x(t)=0,x(0)=0}:
sol:=dsolve(eq, numeric, parameters=[T,K]);
sol(parameters=[1,20]);
############

And the result is an error I cannot solve:

Error, (in dsolve/numeric) the following unknowns appear in the system, but are not specified as parameters: {k}
 

Then, how to modify the code?

 

Best regards

 

Jaqr

Hi!
I have the following code:

f:=proc(x)
   local u;
   Digits:=15;
   if x>10^9 
    then 
        u:=1/x; evalf(2/Pi*arccos((u*u-1)/(1+u*u)));
    else
        evalf(2/Pi*arccos((1-x*x)/(1+x*x)))
    end if
end proc;

 

The advantage is that f(+infinity) is defined in this case whereas evalf(2/Pi*arccos((1-x*x)/(1+x*x))) is not for x:=+infinity. But, I would like to extend this procedure in such a way that f(1/0) or f(something) where something is infinity or a division by zero is defined and gives the same result as f(+infinity).

I added before the preocedure f above the following code:
 

NumericEventHandler( division_by_zero = proc() +infinity; end proc ):

But, it defines a global environment. I would like a local modification of the environment only inside the procedure for f.

How to solve this issue?

Best regards,

 

Jaqr


 

Hi!

Here below is the code I got problems:

#################################

Dens := proc(v)
local theta, r;
evalf[8](
    Int(
        Int(
            4*r/(1-0.84*cos(theta)^2)^(1/2)*exp(-r*(6.25-5.245*cos(theta)^2)^(1/2))
        , theta = 0. .. 2*Pi)
    , r = 0. .. v)
) assuming v>=0
end proc;

#
#

FitFinalDens := NonlinearFit(
  b*(1+a*u)/u*Dens(u/(1+a*u))
, depth
, veloc
, [u]
, initialvalues = [a = 1.4, b = 0.13]
, parameternames = [a, b]
, output = [leastsquaresfunction, residuals, parametervector]
, parameterranges=[a=1.1..3.0,b=0.02..0.8]
);

#################################

Then, I obtain two sort of errors:

First error message:

Error, (in Statistics:-NonlinearFit) invalid input: no implementation of NonlinearFit matches the arguments in call, 'NonlinearFit(0.13*(1.+1.4*u)*(int(int(4*r/..........

etc...

 

Second error message:

Error, (in Statistics:-NonlinearFit) complex value encountered

 

So, really I don't known how to correct the code.

I tried a lot  of things such as using  "value" command,  "Re" command, etc.

Do you have a solution?


Sincerely yours.

 

Jacqr

 

 

Page 1 of 1