MaplePrimes Questions

Hi,

I'm facing this issue when I try to use the Dsolve function in maple, it indicates me the following error :

"Error, (in dsolve/numeric/SC/firststep) unable to evaluate the partial derivatives of f(x,y) for stiff solution"

Here is part of the code :

Lagerkraft:=rhs(Eq__Sys_4_ohneZwang[1][2])=0;
                                      2           
                          / d        \            
Lagerkraft := cos(phi(t)) |--- phi(t)|  a__ks m__k
                          \ dt       /            

                             2             
                 / d        \              
   + cos(phi(t)) |--- phi(t)|  a__sss m__ss
                 \ dt       /              

                             2           
                 / d        \            
   + cos(phi(t)) |--- phi(t)|  l__k m__ko
                 \ dt       /            

                             2          
                 / d        \           
   + cos(phi(t)) |--- phi(t)|  l__k m__p
                 \ dt       /           

     /  2        \                       
     | d         |                       
   + |---- phi(t)| sin(phi(t)) a__ks m__k
     |   2       |                       
     \ dt        /                       

     /  2        \                         
     | d         |                         
   + |---- phi(t)| sin(phi(t)) a__sss m__ss
     |   2       |                         
     \ dt        /                         

     /  2        \                       
     | d         |                       
   + |---- phi(t)| sin(phi(t)) l__k m__ko
     |   2       |                       
     \ dt        /                       

     /  2        \                                      /      
     | d         |                                      |   4  
   + |---- phi(t)| sin(phi(t)) l__k m__p + 5000000 A exp|- --- 
     |   2       |                                      \  961 
     \ dt        /                                             

                                             2\                   
  /            /phi(t) + Pi\                \ |                   
  |100 Pi trunc|-----------| - 25 phi(t) + 9| | u + 200000 u A = 0
  \            \   4 Pi    /                / /                   


indets(Lagerkraft,name)
  {A, Pi, a__ks, a__sss, l__k, m__k, m__ko, m__p, m__ss, t, u}

Parameterliste__5:=[
A=4071.5*10^(-6),
a__ks=-20.94481*10^(-3),
a__kos=14.063837*10^(-3),
a__sss=0,
l__k=100*10^(-3),
m__k=11.02736,
m__ko=0.7237868,
m__p=1.437419,
m__ss=15,
u=1
];
                     [                                            
Parameterliste__5 := [A = 0.004071500000, a__ks = -0.02094481000, 
                     [                                            

                                             1                    
  a__kos = 0.01406383700, a__sss = 0, l__k = --, m__k = 11.02736, 
                                             10                   

                                                       ]
  m__ko = 0.7237868, m__p = 1.437419, m__ss = 15, u = 1]
                                                       ]


Lagerkraft5a:=subs(Parameterliste__5, Lagerkraft);
                                                        2
                                            / d        \ 
 Lagerkraft5a := -0.01484538000 cos(phi(t)) |--- phi(t)| 
                                            \ dt       / 

                                  /  2        \               
                                  | d         |               
    + 814.3000000 - 0.01484538000 |---- phi(t)| sin(phi(t)) + 
                                  |   2       |               
                                  \ dt        /               

                  /      
                  |   4  
   20357.50000 exp|- --- 
                  \  961 

                                              2\    
   /            /phi(t) + Pi\                \ |    
   |100 Pi trunc|-----------| - 25 phi(t) + 9| | = 0
   \            \   4 Pi    /                / /    


indets(Lagerkraft5a,name)
                            {Pi, t}

Lösung_Lagerkraft:=dsolve({Lagerkraft5a,AB},phi(t),numeric,dsolve_options);

Thanks

 

Hi folks, here's a bug in converting abs to Heavisides:

Converting the derivative of the abs function to a piecewise function is fine: 
convert(abs(1,x),piecewise);
returns
piecewise(x < 0, -1, x = 0, undefined, 0 < x, 1);

Whereas, 
convert(abs(1,x),Heaviside);
returns 1.

abs_problem.mw


 

restart;
interface(version);

`Standard Worksheet Interface, Maple 2020.2, Mac OS X, November 11 2020 Build ID 1502365`

(1)

convert(abs(1,x),piecewise);
convert(abs(1,x),Heaviside);

convert(%%,Heaviside);

piecewise(x < 0, -1, x = 0, undefined, 0 < x, 1)

 

1

 

-1+2*Heaviside(x)+undefined*Dirac(x)

(2)

abs(x)=convert(abs(x),Heaviside);
diff(%,x);
strange:=convert(%,Heaviside);
eval(subs(x=-1,%));

abs(x) = -x+2*x*Heaviside(x)

 

abs(1, x) = -1+2*Heaviside(x)+2*x*Dirac(x)

 

1 = -1+2*Heaviside(x)

 

1 = -1

(3)

plot([(abs(x)),lhs(strange),rhs(strange)],x=-5..5,colour=[black,red,blue]);

 

 

 


 

Download abs_problem.mw

Hi

The following code is time consuming. Please improve the code, if it is possible. Thanks for taking your time

restart;

T := time(): 
M := 50: 
Digits := 30: 
L := 500: 
R := (1/2): 
nu := 0.3: 
Em := 0.70e11: 
N := 1: 
Ec := 0.380e12: 
E:= Em*(1-(y/h+1/2)^N)+Ec*(y/h+1/2)^N: 
X :=(int(E*(z+(1/2)*R), [z = y-(1/2)*R .. 0, y = -(1/2)*R .. (1/2)*R]))/(int(E, [z = y-(1/2)*R .. 0, y = -(1/2)*R .. (1/2)*R])): 
beta := Pi^2/L^2: 
G := E/(2*(1+nu)): 
phi := add(b[n]*y^n, n = 0 .. M): 
Eq := diff(phi, y$2)+(diff(E, y))*(diff(phi, y))/E+((diff(E, y$2))/E-((diff(E, y))/E)^2)*phi-2*beta*(1+nu)*(phi-1): 
st := [seq(coeftayl(Eq, y = 0, j), j = 0 .. M-2)]: 
for k to M-1 do 
b[k+1] := solve(st[k], b[k+1]) 
end do: 
phi := subs(y = y-X, phi): 
phi := subs(solve({eval(phi, y = -(1/2)*R+X), subs(y = f, phi)}, {b[0], b[1]}), phi): 
f := piecewise(`and`(z >= -R, z <= 0), z+(1/2)*R+X, -z+(1/2)*R+X): 
Digits := 4: 
int(phi*G, [z = y-(1/2)*R .. 0, y = -(1/2)*R .. (1/2)*R], numeric)+int(phi*G, [z = 0 .. -y+(1/2)*R, y = -(1/2)*R .. (1/2)*R], numeric);

Time = Time()-T;

Note that the calculation of the integration requires alot of time. Both returns a similar result (calculation of an integration is sufficient)

Hello,

I'm trying to use a text editor (notepad++) to developp a code in Maple. 

Before creating a package, i would like to test step by step the different procedures that i create.

To do so, i would like to launch some procedures created in notepad++. I guess i have to call the maple kernel from notepad++. How can i do to call the maple kernel from a editor (in my case notepad++) ?

Next, would it be possible for me to test directly on a worksheet a procedure that i have been created in notepad and launched from notepad ?

I thank you in advance for your help.

hi! lately I'm thinking about animating complex phase portraits so I tried something like this:

restart;
with(plots);
f := (a, z) -> (z*a - 1)/(z^2 + z + 1);
display(seq(densityplot(proc(x, y) local res; res := evalhf(argument(f(1/100*a, y + x*I))); return res; end proc, -4 .. 4, -4 .. 4, axes = boxed, view = [-2 .. 2, -2 .. 2], restricttoranges, colorstyle = HUE, style = surface, grid = [201, 201]), a = 1 .. 200), insequence = true);
 

but this takes a long time to load. Do you how can we optimizate this code?

Hello,

In a maple code, i have the symbol dollar as an the last argument of a procedure.

What is the meaning of the use of dollar symbol as an argument in a maple procedure ?

Thank you for your help.

Hi,

I just upgraded to Maple 2021 and started getting strange results - similar calculations seemed to work in Maple 2020.

I am looking at correlated bivariate normal distributions. When doing a fully symbolic verification of the normalization, I get an incorrect result of infinity. I also get strange results when integrating over a circular region, but the normalization seemed to be a very elementary calculation.

Maybe someone can check this make sure I'm not losing my marbles. I've attached a worksheet.

Thanks.

Bivariate_Gaussian.mw

hi, do you know how can we plot analogy situation from this post:

https://mathematica.stackexchange.com/questions/100051/dynamic-epicycles/100108#100108

I really like simplicity and beauty of the idea from:

https://www.mapleprimes.com/posts/206167-Procedures-For-Two-Animations

and I wonder if it would be possible to add a third rolling circle similarly not including such long code from first page.

thanks in advance

Is there a reason that an angle theta from zero to pi/2 (0 to 90 deg) returns as invalid for an animation range?  I am trying to rotate a vector 2D for visualization.  This is build-up towards a 3d rotating vector in an animation.  

 

Here is the code: theta is the arrow tip rotation's location via cos(theta), sin(theta) coordinates in a 2D vector.

 

animate(arrow, [<cos(theta), sin(theta)>, width = [0.05, relative], view = [-1 .. 2, -1 .. 2], color = "blue"], theta = 0 .. Pi/2)

 

ErrorMessage:  

Error, (in plots/animate) 0 = 0 .. (1/2)*Pi  is an invalid animation range

 

 

Thanks In Advance,

Bill

Hello,

does Maple have a PDE solver? I want to solve the following inhomogeneous case of the heat equation:

diff(u(t,x,y,z),t)=k*Laplacian(u(t,x,y,z))+l*u(t,x,y,z)+m

with boundary conditions u(t,0,y,z)=u(t,L,y,z)=u(t,x,0,z)=u(t,x,L,z)=u(t,x,y,0)=u(t,x,y,L)=0. The initial condition is not fixed, as I want to try different cases. It will probably be some sinusoidal spatial function. I would prefer an analytic solution but I could live with a numerical one. If not in three spatial dimensions then even a solution with one dimension would be useful. I would appreciate any help.

Thank you.

How can this expression sorted in order of the symbol "y"? I want the terms with y locate at the beginnig.

restart:

f:=x^2+x^y+1-z

x^2+x^y+1-z

(1)

 

Download sort.mw

As the title, who can help me fix the problem like this

theta:= diff(arctan(y,x)):

W:= piecewise(

         theta>-Pi/2 and theta< -Pi/2+10, 1+A+B*cos(theta),

         theta>-Pi/2+10 and theta< Pi/2-10. 1-A+B*cos(thea)); 

there always plotout the undefined when acrtan(y,x)=Pi/2,

How can I ignore this undefined or define another value for W when acrtan(y,x)=Pi/2

    Dear Fellows
Hoped everything is fine with you. I plotted some contours for a flow model and i want to generate its dat file. Please help me in this regard. Thanks

Attached is a worksheet containing a simple assignment that gives an "illegal use of an object as a name" error. I created the superscripted name in the following way.

1)  type b.

2) click on the Insert|Typesetting|Superscript  item in the insert menu.

3) enter 1 at the cursor in the superscript position.

4)  the result is a name b with superscript 1, but this symbol does not constitute a valid name for an assignment.


 

Parse:-ConvertTo1D, "first argument to _Inert_ASSIGN must be assignable"

Error, illegal use of an object as a name

"b^1:=2+3;"

 

NULL


 

Download errorws.mw

First 178 179 180 181 182 183 184 Last Page 180 of 2195