Carl Love

Carl Love

28035 Reputation

25 Badges

12 years, 320 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are answers submitted by Carl Love

If you want Q on the vertical axis versus B on the horizontal axis, then do

plot([B, Q, Q= 1..5], labels= ['B', 'Q']);

That should be

derivative:= D(f);

Maple can verify the identities that you gave, but you need to enter them with the correct syntax. This syntax is somewhat different from (and more precise than) the syntax used in your textbook. The rules include the following:

  • All letters are lowercase.
  • Function arguments always go in parentheses.
  • Exponents go after the closing parenthesis.
  • Explicit multiplication operators should be used.

Here are your two examples:

combine(cos(5*x)^2 - sin(5*x)^2);

     cos(10*x)

expand(tan(3*x));

     (3*tan(x)-tan(x)^3)/(1-3*tan(x)^2)

So what are combine and expand? The combine command tends to reduce the exponents and raise the coefficients of the arguments. The expand command tends to reduce the coefficients of the arguments and raise the exponents.

Use fsolve to solve your equation. I would've done it, but I'm not going to retype your expression. So, next time, post the expression in plaintext or post it as a worksheet with a link.

Your Question is about Maple and not about Maple TA, MapleSim, etc. Do not check off all the boxes next time; it's disrespectful.

Your optimization problem can be solved in the following sense. There are real nonnegative values of A and B such that your objective function is real. We will minimize it over those values of A and B.

theta:= Complex(1,1):
z:= theta^3-3*(A*theta^2+B):
S1:= solve({evalc(Im(z)) = 0});

     S1 := {A = 1/3}

eval(z, S1);

     -3*B-2

Now it is clear that this expression has no lower bound for nonnegative B. So the answer is -infinity.

 

Using the package LargeExpressions, I was able to simplify your expression to one that fits as a single long line on my monitor, using the normal font size. It won't fit on one line in this MaplePrimes post, but that's irrelevant.

As John has shown, the first step is to select the nontrivial branch of the piecewise. A clean way to do this (I consider using op to do this "dirty") is to add t >= theta to the integral's assuming clause. (I also removed nu > 0 because it's superfluous since it's implied by the limits of integration.)

Then I used LargeExpressions:-Veil to rename each LaguerreL subexpression.

 

restart:

J:=
     int(
          Statistics:-PDF(InverseGaussianDistribution(alpha/nu, alpha^2), t-theta)*
          Statistics:-PDF(GammaDistribution(kappa,tau), nu),
          nu= 0..infinity
     )
     assuming t >= theta, t > 0, alpha > 0, kappa > 0, tau > 0
;

(1/8)*(-(1/2)*kappa^2*(-t+theta))^(-(1/2)*tau)*Pi*exp((1/2)*alpha^2/(-t+theta))*alpha*(-LaguerreL(-(1/2)*tau, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*cos((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+2)*2^(1/2)*(t-theta)^(1/2)*alpha^2*kappa^3+LaguerreL(-(1/2)*tau, 3/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*cos((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+2)*2^(1/2)*(t-theta)^(1/2)*alpha^2*kappa^3+LaguerreL(-(1/2)*tau, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*cos((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+2)*2^(1/2)*(t-theta)^(1/2)*kappa^3*theta-LaguerreL(-(1/2)*tau, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*cos((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+2)*2^(1/2)*(t-theta)^(1/2)*kappa^3*t+LaguerreL(-(1/2)*tau+1/2, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*sin((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+3/2)*alpha^3*kappa^3-LaguerreL(-(1/2)*tau+1/2, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*sin((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+3/2)*alpha*kappa^3*tau*theta+LaguerreL(-(1/2)*tau+1/2, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*sin((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+3/2)*alpha*kappa^3*tau*t-LaguerreL(-(1/2)*tau+1/2, 3/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*sin((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+3/2)*alpha^3*kappa^3+2*LaguerreL(-(1/2)*tau, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*cos((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+2)*2^(1/2)*(t-theta)^(1/2)*alpha*kappa^2-2*LaguerreL(-(1/2)*tau, 3/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*cos((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+2)*2^(1/2)*(t-theta)^(1/2)*alpha*kappa^2+LaguerreL(-(1/2)*tau+1/2, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*sin((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+3/2)*alpha*kappa^3*theta-LaguerreL(-(1/2)*tau+1/2, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*sin((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+3/2)*alpha*kappa^3*t-3*LaguerreL(-(1/2)*tau+1/2, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*sin((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+3/2)*alpha^2*kappa^2+LaguerreL(-(1/2)*tau+1/2, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*sin((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+3/2)*kappa^2*tau*theta-LaguerreL(-(1/2)*tau+1/2, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*sin((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+3/2)*kappa^2*tau*t+3*LaguerreL(-(1/2)*tau+1/2, 3/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*sin((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+3/2)*alpha^2*kappa^2-LaguerreL(-(1/2)*tau, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*cos((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+2)*2^(1/2)*(t-theta)^(1/2)*kappa+LaguerreL(-(1/2)*tau, 3/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*cos((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+2)*2^(1/2)*(t-theta)^(1/2)*kappa-LaguerreL(-(1/2)*tau+1/2, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*sin((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+3/2)*kappa^2*theta+LaguerreL(-(1/2)*tau+1/2, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*sin((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+3/2)*kappa^2*t+3*LaguerreL(-(1/2)*tau+1/2, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*sin((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+3/2)*alpha*kappa-3*LaguerreL(-(1/2)*tau+1/2, 3/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*sin((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+3/2)*alpha*kappa-LaguerreL(-(1/2)*tau+1/2, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*sin((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+3/2)+LaguerreL(-(1/2)*tau+1/2, 3/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))*sin((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+3/2))/(GAMMA(tau)*sin((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+3/2)*(-t+theta)^3*kappa^3*cos((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+2))

V:= [indets(J, specfunc(LaguerreL))[]];

[LaguerreL(-(1/2)*tau, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta))), LaguerreL(-(1/2)*tau, 3/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta))), LaguerreL(-(1/2)*tau+1/2, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta))), LaguerreL(-(1/2)*tau+1/2, 3/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))]

S:= V=~ LargeExpressions:-Veil[L]~(V);

[LaguerreL(-(1/2)*tau, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta))) = L[1], LaguerreL(-(1/2)*tau, 3/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta))) = L[2], LaguerreL(-(1/2)*tau+1/2, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta))) = L[3], LaguerreL(-(1/2)*tau+1/2, 3/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta))) = L[4]]

J1:= simplify(subs(S, J)) &where <(rhs=lhs)~(S)>;

J1 := `&where`((1/8)*(-(((-L[4]+L[3])*alpha^2+L[3]*(tau-1)*(t-theta))*kappa^2+2*alpha*(L[4]-L[3])*kappa-L[4]+L[3])*sqrt(t-theta)*sin((1/2)*Pi*tau)*(alpha*kappa-1)*GAMMA(-(1/2)*tau+3/2)+kappa*cos((1/2)*Pi*tau)*sqrt(2)*(((L[1]-L[2])*alpha^2+L[1]*(t-theta))*kappa^2-2*alpha*(L[1]-L[2])*kappa+L[1]-L[2])*GAMMA(-(1/2)*tau+2)*(t-theta))*((1/2)*kappa^2*(t-theta))^(-(1/2)*tau)*Pi*exp(-alpha^2/(2*t-2*theta))*alpha/((t-theta)^(7/2)*GAMMA(-(1/2)*tau+2)*cos((1/2)*Pi*tau)*GAMMA(-(1/2)*tau+3/2)*sin((1/2)*Pi*tau)*kappa^3*GAMMA(tau)), {Vector(4, {(1) = L[1] = LaguerreL(-(1/2)*tau, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta))), (2) = L[2] = LaguerreL(-(1/2)*tau, 3/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta))), (3) = L[3] = LaguerreL(-(1/2)*tau+1/2, 1/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta))), (4) = L[4] = LaguerreL(-(1/2)*tau+1/2, 3/2, -(1/2)*(alpha*kappa-1)^2/(kappa^2*(-t+theta)))})})

``

 

Download LargeExpressions.mw

Your integral seems closely related to my current research, which involves simplifying integrals involving distributions and re-expressing them as other distributions*. Did you expect this integral to be another distribution? If so, I'd like to include it as an example in my research.

*Specifically, I'm making a Maple program, which, hopefully, will automatically perform most or all of the transformations in this famous chart.

Simply add option explicit to the solve command.

You need to use the correct Maple derivative and function syntax. Dependent variables either need to be declared or always used with their independent variables.


ecuation:= diff(x(t),t) = -g*cos(x(t))/(v0-g*t*sin(x(t)));

diff(x(t), t) = -g*cos(x(t))/(v0-g*t*sin(x(t)))

Sol1:= dsolve(ecuation);

t-(_C1*g-v0*x(t))/(g*cos(x(t))) = 0

Sol2:= dsolve({ecuation, x(0)=0}, implicit);

t+v0*x(t)/(g*cos(x(t))) = 0

sys:=
     diff(x(t),t) = x(t)*sqrt(x(t)^2+y(t)^2),
     diff(y(t),t) = y(t)*sqrt(x(t)^2+y(t)^2)
;

diff(x(t), t) = x(t)*(x(t)^2+y(t)^2)^(1/2), diff(y(t), t) = y(t)*(x(t)^2+y(t)^2)^(1/2)

dsolve({sys});

[{x(t) = 0}, {y(t) = (y(t)^2)^(1/2)}], [{x(t) = 0}, {y(t) = -(y(t)^2)^(1/2)}], [{x(t) = _C1}, {y(t) = -I*x(t), y(t) = I*x(t)}], [{x(t) = RootOf(-t+Intat(1/RootOf(-(_Z^2/_a^2)^(1/2)*_a+_Z), _a = _Z)+_C1)}, {y(t) = (-x(t)^4+(diff(x(t), t))^2)^(1/2)/x(t), y(t) = -(-x(t)^4+(diff(x(t), t))^2)^(1/2)/x(t)}]

 


Download Deriv_syntax.mw

Add these options to the dsolve command:

method= bvp[midrich], maxmesh= 2^14

Also, here's an easier and much-more-accurate way to get your integral: Add the following ODE and BC to your system that you pass to dsolve:

diff(J(y), y)= E*diff(a(y), y),  J(-h/2) = 0

Then the integral is

1/2/(1+nu)*eval(J(y), aa(h/2));

and you can do away with the for loop and the PolynomialInterpolation.

 

If it's possible to solve at all, then I think that the following will do it:

P:= v-> cos(v)^2 + sin(v)^2 - 1:
V:= [Psi, Theta[1], Theta[2]](t):
U:= [(cos,sin)~(V)[], [x[1], x[2], z[1], z[2]](t)[]]:
thaw([eliminate(subs(U=~ freeze~(U), [[eqsys[], P~(V)[]], U])[])]);

This treats the sin and cos of Psi, Theta[1], and Theta[2] as separate variables and adds three equations based on the Pythagorean identity. So the system becomes a quadratic system of 10 equations in 10 variables. I let this run for over an hour and consume 5 Gig of memory, but I didn't have the patience to let it finish. I suggest replacing several of the parameters with small integers and trying again.

I used your ListParameters to set all parameters to 1, and I got no solution. So I think that there's a good chance that there's no solution.

 

There is a difference in the way Matrices evaluate between your Maple 15 and the current Maple 2016. I don't know the precise details, but you need to add something to VV's command in order for it to work in your Maple. Change

C[p0]:= eval(C[iso], const);

to

C[p0]:= eval(rtable_eval(C[iso]), const);

I have verified that

  • the command that VV gave works in Maple 2016. That is, it produces a fully evaluated numeric Matrix;
  • VV's command by itself doesn't work in Maple 16;
  • and the modified command that I gave works in Maple 16.

It's very difficult for me to describe to you what exactly rtable_eval does. It's a bit mind boggling.

 

You wrote:

The resulotion of plot is not so good, and when I export this plot as jpeg file, quality of resolution deteriotate even more, I mean pixel tear out on zooming the image. How I fix this issue which I guess might be due to wrong way of exporting plot ?

JPEG is not a good format for most plots. JPEG is intended for photos (the P in JPEG stands for Photographic), which have continuous color changes. Plots tend to have crisp, abrupt, discontinuous color changes, especially in the transition from foreground to background. The "pixels tearing out" is JPEG's attempt to convert those abrupt changes into continuous ones.

On the other hand, the G in both PNG and GIF stands for Graphics. These are better than JPEG for most plots.

You had many syntax errors---too many for me to list right now---and your procedure CreaF would've been very inefficient if it had worked. Here's a better way:

f:= (x,y,i,j)-> ((x+j-1)/2^i, (y+2^i-j-1)/2^i):
CreaF:= (i::posint)-> unapply(Vector(2^i-1, j-> f(x,y,i,j)), (x,y)):

And call it like this:

CreaF(2)(.35,.465)[1];

     0.875000000000000e-1, .616250000000000

Note that I changed the call order from your CreaF(2)[1](.35,.465) because I thought that that would generally be more efficient. In other words, CreaF now returns a procedure which returns a Vector as opposed to CreaF returning a Vector of procedures. If you need it to be the latter way, let me know.

Your implementation of Kitonum's Answer is much longer than it needs to be, and takes much more time. Here's my one-liner procedure for it:

DeleteZeroColumns:= (M::Matrix)-> M[.., remove(k-> M[1,k]=0, [$1..op([1,2],M)])]:

This runs in 3 to 4 milliseconds on an 8x3000 Matrix. The code op([1,2],M) returns the number of columns of M.

If the first argument to display is an array of plots, then you'll get a table of plots. If the first argument is a list of plots, then you'll get them all plotted in the same coordinate plane.

First 219 220 221 222 223 224 225 Last Page 221 of 395