MaplePrimes Questions

Why does Maple dsolve give this strange error from dsolve? I do not see that the input is wrong

restart;
F := x * ( y(x) + x*sqrt(x*y(x)) + sqrt(x^3*y(x)) );
ode:= diff(y(x),x) = F;
dsolve(ode,y(x));

I do not see where the input is invalid. I stared at it for 5 minutes.

Mathematica can solve this as follows

ode = y'[x] == x ( y[x] + x Sqrt[x y[x]] + Sqrt[x^3 y[x]]  )
DSolve[ode, y[x], x]

Did I type something wrong in Maple?

Physics:-Version();
    2018, June 12, 1:40 hours, MapleCloud version: 60

 

 

I want z  to becomes abs(z) then later on, remove abs() and obtain z back in the same form it was.

I found that Maple changes z when I put it inside abs. Like this

expr:=(-y^2+1);
abs(expr);
op(1,%);

So instead of 1-y^2, I end up now with  y^2-1. I want to keep the same expression I started with.

Mathematica does not do this:

expr = 1 - y^2
Abs[expr]
%[[1]]

Is there a way or option to tell Maple not change the expression when I put it inside abs()?

This complicates what I am trying to do in Maple.

thank you

Hello,

I've tried many combinations of assume(), simplify(), expand(), and evalc(), and I simply can't figure out how to make Maple evaluate my symbolic expression as a purely real valued expression. I know that my expression must be able to be expressed solely in real-valued terms since any number times its complex conjugate is real-valued. What function do I use to accomplish this? Thanks for your consideration. I've attached the code in question below.

Ian

testing_real_simplification.mw

restart;
v := 6000;

# Define the Fresnel reflection coefficient, rp
eta0 := 4; eta1 := n1+I*kappa1;
theta0 := (1/180)*ang*Pi; theta1 := arcsin(eta0*sin(theta0)/eta1);
xi0 := eta0*cos(theta0); xi1 := eta1*cos(theta1);
rp := (-eta0^2*xi1+eta1^2*xi0)/(eta0^2*xi1+eta1^2*xi0);

# Define the complex conjugate of the Fresnel reflection coefficient, rpCon
eta1Con := evalc(conjugate(eta1));
theta1Con := arcsin(eta0*sin(theta0)/eta1Con);
xi1Con := eta1Con*cos(theta1Con);
rpCon := (-eta0^2*xi1Con+eta1Con^2*xi0)/(eta0^2*xi1Con+eta1Con^2*xi0);

# Take the product of rp and its complex conjugate, rpCon. This should necessarily evaluate to a real-valued quantity.
prod := evalc(rp*rpCon);

Hello, i am a student from Germany and have a question:

for a  written paper in microeconomics I have to draw an "Edgeworth Diagram" in Maple, so I have to display two functions ( indifference curves) in one box, which has two x axis and two y axis. All axis have to be positive and in one box. Maybe you can imagine one standard graph with x and y axis as a half of a cube, which gets completed by an other x and y axis with negative values (in our imagination, later the negative values should be transformed into positive values). All in all I have to build up a box with two complete coordinate systems. I mean that a need a plot with two different x axis and two different y axis. I read about but the possibility to define lines through the plottools package, but I really dont know.

Maybe one of you has an idea, which would be fantastic. If you cant follow my bad description, maybe its better to google "edgeworth diagram". 

Thank you all !

Hello.

I wrote a simple code for the plot of the function:

restart;
Omega := 2*Pi*N; R0 := a*tanh((a^2-mu)/(2*T_c))*ln((2*a^2+2*a*q+q^2-2*mu-I*Omega)/(2*a^2-2*a*q+q^2-2*mu-I*Omega))/q-2;                      
T_c := 0.169064e-1; mu := .869262; N := 10;
R1 := int(R0, a = 0.1e-3 .. 100);    
R2 := evalf(abs(R1));
plot(R2, q = 0.1e-2 .. 10);

If the parameter N is not equal to zero then after near one hour calculations I got the desired plot. But for N=0 I have an error

Error, (in signum) too many levels of recursion

I searched this error on this site but I can't find anything relevant for this problem.

Thank you in advance for the help.

 

What is the correct idiom in Maple to do subexpression replacement?

Suppose I want to replace each occurance of ln(anything) by ln(abs(anything)) in an expression.

Currently I call indets and then loop over each entry and use patmatch to do the replacement.

Is there a better method than what I doing now? Here is an example

restart;
expr := 7*ln(arcsin(x))-(1/2)*ln(x-1)*sin(x)-(1/2)*ln(x+1)+f;
lis:=indets(expr):
for z in lis do
    a:='a';b:='b';c:='c';
    if patmatch(z,a::anything*ln(b::anything)*c::anything,'la') then
       map(z0->assign(z0),la);
       expr:=subs(z = a*ln(abs(b))*c, expr);
    fi;
od:
expr;

I do not know if this will fails on some other cases yet.


 

restart

Digits := 4

"phi(x):=16*x^(2)*(1-x)^(2):"

``

a1 := int((diff(phi(x), x, x, x, x))*phi(x), x = 0 .. L)

(6144/5)*L^5-3072*L^4+2048*L^3

(1)

``

a3 := int(phi(x)*phi(x), x = 0 .. L)

(256/9)*L^9-128*L^8+(1536/7)*L^7-(512/3)*L^6+(256/5)*L^5

(2)

``

lambda := 0.170e-1

0.170e-1

(3)

B := 0.223e11

0.223e11

(4)

A := 0.346e11

0.346e11

(5)

k[n] := W*(4*R*G*L^2+pi^2*(2*n-1)^2)/(C*(pi^2*(2*n-1)^2+4*R*L^2*(G+W)))

W*(4*R*G*L^2+pi^2*(2*n-1)^2)/(C*(pi^2*(2*n-1)^2+4*R*L^2*(G+W)))

(6)

b[n] := 4*pi*(2*n-1)/(4*R*G*L^2+pi^2*(2*n-1)^2)

4*pi*(2*n-1)/(4*R*G*L^2+pi^2*(2*n-1)^2)

(7)

U := Heaviside(t)

Heaviside(t)

(8)

w := 1

1

(9)

L := 3.5

3.5

(10)

Ra := 9

9

(11)

Rb := 5

5

(12)

W := 1

1

(13)

G := 0.5e-3

0.5e-3

(14)

R := Ra+Rb

14

(15)

C := 0.2e-1

0.2e-1

(16)

h := 0.250e-1

0.250e-1

(17)

nu := .22

.22

(18)

I1 := (1/3)*w*h^3

0.5207e-5

(19)

E[0] := A+B

0.569e11

(20)

nu1 := (1-nu)/((1+nu)*(1-2*nu))

1.142

(21)

"beta(x,t):=1/(w*h)(W(∑)(-(Pi^(3)*b[n]*(2*n-1)^(3))/(k[n]*8*L^(3))*cos(((2*n-1)*Pi)/(2*L)*x)*(exp(-k[n]*t)))+(R*G*(R*G)^(0.5)*sinh((R*G)^(0.5)*(x-L)))/(cosh((R*G)^(0.5)*L))*t+C*U*(R*G*(R*G)^(0.5)*sinh((R*G)^(0.5)*(x-L)))/(cosh((R*G)^(0.5)*L)))*exp(-W/(C)*t)"

proc (x, t) options operator, arrow; (W*(sum(-(1/8)*Pi^3*b[n]*(2*n-1)^3*cos((1/2)*(2*n-1)*Pi*x/L)*exp(-k[n]*t)/(k[n]*L^3), n = 1 .. 8))+R*G*(R*G)^.5*sinh((R*G)^.5*(x-L))*t/cosh((R*G)^.5*L)+C*U*R*G*(R*G)^.5*sinh((R*G)^.5*(x-L))/cosh((R*G)^.5*L))*exp(-W*t/C)/(w*h) end proc

(22)

eq := -nu1*I1*a1*((1/2)*E[0]*q(t)+B*lambda*(int(exp(-lambda*(t-s))*q(s), s = 0 .. t)))+2*w*h^2*beta(x, t)

-0.4603e11*q(t)-0.6134e9*(int(exp(-0.170e-1*t+0.170e-1*s)*q(s), s = 0 .. t))+0.5000e-1*(-0.7235e-2*pi*(pi^2+686.)*cos(.4488*x)*exp(-50.*(.3430+pi^2)*t/(pi^2+686.))/(.3430+pi^2)^2-.5860*pi*(9.*pi^2+686.)*cos(1.346*x)*exp(-50.*(.3430+9.*pi^2)*t/(9.*pi^2+686.))/(.3430+9.*pi^2)^2-4.522*pi*(25.*pi^2+686.)*cos(2.244*x)*exp(-50.*(.3430+25.*pi^2)*t/(25.*pi^2+686.))/(.3430+25.*pi^2)^2-17.37*pi*(49.*pi^2+686.)*cos(3.142*x)*exp(-50.*(.3430+49.*pi^2)*t/(49.*pi^2+686.))/(.3430+49.*pi^2)^2-47.47*pi*(81.*pi^2+686.)*cos(4.039*x)*exp(-50.*(.3430+81.*pi^2)*t/(81.*pi^2+686.))/(.3430+81.*pi^2)^2-105.9*pi*(121.*pi^2+686.)*cos(4.937*x)*exp(-50.*(.3430+121.*pi^2)*t/(121.*pi^2+686.))/(.3430+121.*pi^2)^2-206.6*pi*(169.*pi^2+686.)*cos(5.834*x)*exp(-50.*(.3430+169.*pi^2)*t/(169.*pi^2+686.))/(.3430+169.*pi^2)^2-366.3*pi*(225.*pi^2+686.)*cos(6.732*x)*exp(-50.*(.3430+225.*pi^2)*t/(225.*pi^2+686.))/(.3430+225.*pi^2)^2+0.5616e-3*sinh(0.8367e-1*x-.2928)*t+0.1123e-4*Heaviside(t)*sinh(0.8367e-1*x-.2928))*exp(-50.00*t)

(23)

``


 

Download n-h-ie.mwn-h-ie.mw

Why this event dose'nt work ?
S(t) is a state , a parameter
dsolve(...,numeric,events = [[[s(t), a*arcsinh(2/a) < s(t)], halt]]);

Hello everyone,

 

I am currently trying to plot lines from different lists.

I got 3 lists with points and another 3 lists with points (Connect each point from one list with the other), and another list with my x-axis.

 

I tried something like that

(nply in this case is 4)

for i from 1 to nply do

sigma1P1[i] := display(line([grenzeu[i], sigma1unter[i]], [grenzeo[i], sigma1ober[i]])):

sigma2P1[i] := display(line([grenzeu[i], sigma2unter[i]], [grenzeo[i], sigma2ober[i]])): 

tau12P1[i] := display(line([grenzeu[i], tau12unter[i]], [grenzeo[i], tau12ober[i]])):

end do:
plot:-display(sigma1P1,sigma2P1,tau12P1);

The for loop creates 3 tables with 4 line plots, but the plot:-display(sigma1P1,sigma2P1,tau12P1);

gives me this Error message:

Error, `plot` does not evaluate to a module

Have anyone an idea how to get these 3 table with plots in one plots?

Plot_problem.mw

And if yes is it possible to implement this in a EMbedded Plot Window?

 

Many thanks in advance!

 

 

 

Hi everyone, i got problems with animation: how can i avoid the overlapping of designed bodies in a 2D animation? Thanks everyone!

Hello everyone, 

         Anyone with the solutions to the error code "Error, unable to compute coeff" should please help. 

         Attached below is the code.

         Thanking you in anticipations for your prompt response. 

Hpm_1.mw

Good evening!!!

Let me briefly describe the problem I've faced recently.

The program (attached) deals with a rather complicated function f depending on parametrs eps1, eps2, eps3, eps4 and variable w. The aim is to expand the function f(w1) into Taylor series with respect to all parametrs (eps1, eps2, eps3, eps4) in order to study its asymptotic behavior as function depending only on k; 0<k<1.

I decided to use mtaylor-function for that problem, which (as I've understood) is the only one to be applied in such cases, but the result was rather unsatisfactory, an error: 

Error, (in gcd/LinZip) input must be polynomials over the integers

Programm code: (1)-(12) only announcing functions....(((, see below
 

f := proc (w) options operator, arrow; -B1+(A1-C1)*w+(B1-D1)*w^2-A1*w^3 end proc

proc (w) options operator, arrow; -B1+(A1-C1)*w+(B1-D1)*w^2-A1*w^3 end proc

(1)

f1 := proc (w) options operator, arrow; A1-C1+(2*B1-2*D1)*w-3*A1*w^2 end proc

proc (w) options operator, arrow; A1-C1+(2*B1-2*D1)*w-3*A1*w^2 end proc

(2)

w1 := (B1-D1+sqrt((B1-D1)^2+3*A1*(A1-C1)))/(3*A1)

(1/3)*(B1-D1+(B1^2-2*B1*D1+D1^2+3*A1^2-3*A1*C1)^(1/2))/A1

(3)

f(w1)

-B1+(1/3)*(A1-C1)*(B1-D1+(B1^2-2*B1*D1+D1^2+3*A1^2-3*A1*C1)^(1/2))/A1+(1/9)*(B1-D1)*(B1-D1+(B1^2-2*B1*D1+D1^2+3*A1^2-3*A1*C1)^(1/2))^2/A1^2-(1/27)*(B1-D1+(B1^2-2*B1*D1+D1^2+3*A1^2-3*A1*C1)^(1/2))^3/A1^2

(4)

s := eps4*sin(l*tau)+(4*(l*sqrt(k/(1-k))+l*eps3)+2*l*((1-2*k)/sqrt(k*(1-k))+eps1))/l^2

eps4*sin(l*tau)+(4*l*(k/(1-k))^(1/2)+4*l*eps3+2*l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/l^2

(5)

A1 := (2*(l*sqrt(k/(1-k))+l*eps3)+l*((1-2*k)/sqrt(k*(1-k))+eps1))/s

(2*l*(k/(1-k))^(1/2)+2*l*eps3+l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/(eps4*sin(l*tau)+(4*l*(k/(1-k))^(1/2)+4*l*eps3+2*l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/l^2)

(6)

A1 := (2*(l*sqrt(k/(1-k))+l*eps3)+l*((1-2*k)/sqrt(k*(1-k))+eps1))/s

(2*l*(k/(1-k))^(1/2)+2*l*eps3+l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/(eps4*sin(l*tau)+(4*l*(k/(1-k))^(1/2)+4*l*eps3+2*l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/l^2)

(7)

B1 := 4/s^2

4/(eps4*sin(l*tau)+(4*l*(k/(1-k))^(1/2)+4*l*eps3+2*l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/l^2)^2

(8)

C1 := (((1-2*k)/sqrt(k*(1-k))+eps1)^2+(-(1-2*k)/sqrt(k*(1-k))+eps2)^2)/s^2

(((1-2*k)/(k*(1-k))^(1/2)+eps1)^2+(-(1-2*k)/(k*(1-k))^(1/2)+eps2)^2)/(eps4*sin(l*tau)+(4*l*(k/(1-k))^(1/2)+4*l*eps3+2*l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/l^2)^2

(9)

D1 := (2*((1-2*k)/sqrt(k*(1-k))+eps1))*(-(1-2*k)/sqrt(k*(1-k))+eps2)/s^2

2*((1-2*k)/(k*(1-k))^(1/2)+eps1)*(-(1-2*k)/(k*(1-k))^(1/2)+eps2)/(eps4*sin(l*tau)+(4*l*(k/(1-k))^(1/2)+4*l*eps3+2*l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/l^2)^2

(10)

l := 1

1

(11)

f(w1)

-4/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^2+(1/3)*((2*(k/(1-k))^(1/2)+2*eps3+(1-2*k)/(k*(1-k))^(1/2)+eps1)/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)-(((1-2*k)/(k*(1-k))^(1/2)+eps1)^2+(-(1-2*k)/(k*(1-k))^(1/2)+eps2)^2)/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^2)*(4/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^2-2*((1-2*k)/(k*(1-k))^(1/2)+eps1)*(-(1-2*k)/(k*(1-k))^(1/2)+eps2)/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^2+(16/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1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^(1/2)+2*eps1)^2-2*((1-2*k)/(k*(1-k))^(1/2)+eps1)*(-(1-2*k)/(k*(1-k))^(1/2)+eps2)/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^2+(16/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^4-16*((1-2*k)/(k*(1-k))^(1/2)+eps1)*(-(1-2*k)/(k*(1-k))^(1/2)+eps2)/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^4+4*((1-2*k)/(k*(1-k))^(1/2)+eps1)^2*(-(1-2*k)/(k*(1-k))^(1/2)+eps2)^2/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^4+3*(2*(k/(1-k))^(1/2)+2*eps3+(1-2*k)/(k*(1-k))^(1/2)+eps1)^2/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^2-3*(2*(k/(1-k))^(1/2)+2*eps3+(1-2*k)/(k*(1-k))^(1/2)+eps1)*(((1-2*k)/(k*(1-k))^(1/2)+eps1)^2+(-(1-2*k)/(k*(1-k))^(1/2)+eps2)^2)/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^3)^(1/2))^3/(2*(k/(1-k))^(1/2)+2*eps3+(1-2*k)/(k*(1-k))^(1/2)+eps1)^2

(12)

assume(0 < k and k < 1)

mtaylor(f(w1), [eps1, eps2, eps3, eps4], 2)

Error, (in gcd/LinZip) input must be polynomials over the integers

 

``


Wish you could give some advice on how to improve the situation.

Thanks a lot in advance.

Download res2.mw

 

 

I am having some issues with NLPSolve (the code follows). As far as I can tell from the documentation, what is entered is syntactically correct.

 

with(Optimization)
[ImportMPS, Interactive, LPSolve, LSSolve, Maximize, Minimize, 

  NLPSolve, QPSolve]
nlc:={0<=d*(c-a) + c*(b-d), 0<=d*(c-e)+ c*(f-d), 0>=f*(e-a)+e*(b-f), (b-d)<=d*(c-a)+c*(b-d),(f-d)<=d*(c-e)+c*(f-d),(b-f)>=f*(e-a)+e*(b-f),(c-a)<=d*(c-a) + c*(b-d), (c-e)<=d*(c-e)+ c*(f-d), (e-a)>=f*(e-a)+e*(b-f),(c-a)+(b-d)<=d*(c-a) + c*(b-d), (c-e)+(f-d)<=d*(c-e)+ c*(f-d), (e-a)+(b-f)>=f*(e-a)+e*(b-f),2*(c-a)+(b-d)<=d*(c-a) + c*(b-d), 2*(c-e)+(f-d)<=d*(c-e)+ c*(f-d), 2*(e-a)+(b-f)>=f*(e-a)+e*(b-f)}

p:=2*(f-a)*(d-b) - [(d-b)*(c-a) + (d-f)*(e-c) + (f-b)*(e-a)]

NLPSolve(p,nlc)
Error, (in Optimization:-NLPSolve) non-numeric result encountered
 

Any help is much appreciated.

When I finished the following code, I can not export the .eps file for the densityplot

 

 

restart; t := 1; a[1] := 0; a[2] := 2; a[4] := 0; a[5] := 1; a[6] := -1; a[8] := 0; g := t*a[3]+x*a[1]+y*a[2]+a[4]; h := t*a[7]+x*a[5]+y*a[6]+a[8]; f := g^2+h^2+a[9]; a[3] := -(3*a[1]^3+a[1]*a[2]^2+3*a[1]*a[5]^2-a[1]*a[6]^2+2*a[2]*a[5]*a[6])/(3*(a[1]^2+a[5]^2)); a[7] := -(3*a[1]^2*a[5]+2*a[1]*a[2]*a[6]-a[2]^2*a[5]+3*a[5]^3+a[5]*a[6]^2)/(3*(a[1]^2+a[5]^2)); a[9] := (3*(a[1]^6+3*a[1]^4*a[5]^2+3*a[1]^2*a[5]^4+a[5]^6))/(a[1]*a[6]-a[2]*a[5])^2; u := (4*(2*a[1]^2+a[5]^2))/f-8*(g*a[1]+h*a[5])^2/f^2; with(plots); plot3d(u, x = -20 .. 20, y = -20 .. 20, axes = frame, labels = ["x", "y", "z"], labeldirections = ["horizontal", "horizontal", "horizontal"], labelfont = ["TIMES", 16], style = patchnogrid); densityplot(u, x = -10 .. 10, y = -10 .. 10, axes = frame, labels = ["x", "y"], labeldirections = ["horizontal", "horizontal"], labelfont = ["TIMES", 16], colorstyle = HUE, style = patchnogrid); contourplot(u, x = -5 .. 5, y = -5 .. 5, labels = ["x", "y"], labeldirections = ["horizontal", "horizontal"], labelfont = ["TIMES", 16])

Hi

Two sets of ordered pairs (i.e. A and B) are calculated in a problem.

A = {[0.5, 3.15], [1, 4.87], [1.5, 6.56], [2, 8.22]}

B = {[0.5, 3.67], [1, 4.94], [1.5, 5.29], [2, 5.93]}

Two control points are considered to check the validity of interpolated polynomials as follows:

- Control point for A:

  Calculated by interpolation [1.75, 7.3959] ... Exact amount [1.75, 7.3971]

- Control point for B:

  Calculated by interpolation [1.75, 5.4981] ... Exact amount [1.75, 5.6225]

The calculated polynomial via interpolation for sets A and B are plotted for independent variable between 0.5 and  2. The plot of interpolated polynomial for A is a curve without local extremum. However ordered pairs in B show that the polynomial should be a strictly increasing function, but the plot of interpolated polynomial for B has many local extremums. By increasing ordered pairs in B, the local extremums are increased. Moreover, the control point for B shows that the interpolated polynomial is not reliable. 

The more exact ordered pairs for B are presented in below. If more ordered pairs are required for interpolation, you can use them.

{[0.75, 4.1457],[1.25, 4.9448],[1.75,5.62]}

How can I find the best curve fitting for ordered pairs in B?

Thank you for taking your time

First 810 811 812 813 814 815 816 Last Page 812 of 2427