Carl Love

Carl Love

26488 Reputation

25 Badges

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

MaplePrimes Activity


These are answers submitted by Carl Love

You asked:

Does anyone know why, if you plot a discontinuous function of one variable, Maple's default behavior is to try to make the function continuous by adding a vertical line segment?

It is not trying to make it continuous; it is assuming that it is continuous. Detecting discontinuities involves significant symbolic processing. The default is to plug values into the expression and evaluate numerically, which is much faster.

I don't know why anyone would anyone would ever want to graph a function this way.

It is not assumed that anyone would want it. The behaviour is a side effect of the numerical technique; it is not intended behaviour.

I couldn't find a place on Maple's Web site to submit a complaint (this is not really a "support question").

From the row of tabs near the top of this (MaplePrimes) page, pull down "More" and select "Submit Software Change Request".

If Maple is installed on a computer, can I change some settings so I don't have to do this?

Yes, it is easy. Add the following line to your initialization file maple.ini:

local plot:= proc({discont:= true}) :-plot(args, :-discont= discont) end proc:

Then the default for discont will be true, and you'll need to specify discont= false on individual plots for which you want to turn off discontinuity checking. (Also see the other suboptions for discont at ?plot,discont .)

Related question: if you plot a discontinuous function of two variables, such as Arg(x,y) (the argument of x + yi; I apologize if this is not the exact syntax)

I am assuming that you mean plot3d(argument(x+I*y), x= -1..1, y= -1..1).

you may see a vertical "cliff" which does not belong in the graph.  I do not blame the Maple people for this - it seems like a difficult issue.  Does anyone know a good way to fix such plots?

Yes, make it a parametric plot in cylindrical coordinates.

plot3d([r, theta, theta], theta= -Pi..Pi, r= 0..1, coords= cylindrical);

That is surprising.

Here's a workaround: Create a calendar by Joining the desired calendar with the Null calendar:

c:= JoinHolidays(Null, Toronto);

Your system of two difference equations can be solved by mapping ztrans and invztrans over the system:


(**)

Eqns:= {y(n+1) + x(n) = 1+2^(n+1), y(n) + 2*x(n+1) = 2 + 2^n}:

(**)

ICs:= {x(0)=1, y(0)=1}:

(**)

eval(map(ztrans, Eqns, n, z), ICs);

{z*ztrans(y(n), n, z)-z+ztrans(x(n), n, z) = z/(z-1)+z/((1/2)*z-1), ztrans(y(n), n, z)+2*z*ztrans(x(n), n, z)-2*z = 2*z/(z-1)+(1/2)*z/((1/2)*z-1)}

(**)

solve(%, map(ztrans, {y(n), x(n)}, n, z));

{ztrans(x(n), n, z) = z/(z-1), ztrans(y(n), n, z) = z/(z-2)}

(**)

map(invztrans, %, z, n);

{x(n) = 1, y(n) = 2^n}

Or it can all be done with a single call to rsolve:

(**)

rsolve({y(n+1) + x(n) = 1+2^(n+1), y(n)+2*x(n+1)=2+2^n, x(0)=1, y(0)=1}, {y(n), x(n)});

{x(n) = 1, y(n) = 2^n}

(**)

 


Download ztrans.mw

From reading your attached file, I think what you want is

for k from 0 to 1 do
     for m from 0 to 4 do
          C[m,k]:= coeff(Eq, Y[k], m) = 0
     end do
end do;

But also see my Reply to your previous version of this Question.

Just take the ln of both sides of each equation, and you then have a simple system of linear equations.


sys:= {2^x*3^y*5^z = 240, 3^x*2^y*5^z = 360,  5^x*3^y*2^z = 1350}, {x,y,z}:

(**)

solve(sys):

(**)

simplify(%);

{x = 2*(ln(5)^2+2*ln(5)*ln(3)-2*ln(2)^2-ln(2)*ln(3))/(ln(5)^2+ln(5)*ln(3)-ln(2)^2-ln(2)*ln(3)), y = (ln(5)^2+3*ln(5)*ln(3)-3*ln(2)^2-ln(2)*ln(3))/(ln(5)^2+ln(5)*ln(3)-ln(2)^2-ln(2)*ln(3)), z = (ln(5)^2+2*ln(5)*ln(2)+ln(5)*ln(3)-ln(2)^2-ln(2)*ln(3)-2*ln(3)^2)/(ln(5)^2+ln(5)*ln(3)-ln(2)^2-ln(2)*ln(3))}

(**)

evalf(%);

{x = 2.82637650486254, y = 1.82637650486254, z = .941362406163020}

(**)

 


Download lin_sys.mw

It seems like the seventh and eighth rows of your Matrix are being converted to lists by CodeGeneration:-Matlab. I have no idea why this is (there are no lists in your input Matrix), but here is a workaround: Change your last command to

Matlab(
     subsop([-1,1]= J, eval([codegen:-optimize](tmp, tryhard), pow= `^`)),
     output = string, defaulttype = numeric
);

I don't have Matlab to test this, so please let me know how this works for you.

y(seq(x[k], k= 1..n))

If x is actually a list, you can do y(x[]).

If you make assumptions such as assume(m>0, m<1), assume(m>2, m<3), etc., that place m between two consecutive integers, then MultiSeries:-multiseries will work.

You need to use one section per slide. So, if you have a section that is too long to fit on one slide, then you need to divide it into multiple sections.

Does n have a definite integer value equal to the number of rows of the Matrix? So the Matrix should be n x J. It is probably i rather than j that is causing the problem.

Also, you should use add instead of sum, and then you don't need the quotes on A[i,j]. Use sum for symbolic summation.

If that doesn't fix the problem, then you'll need to post more of the code.

I think that in general what you are trying to do is impossible. The limit command, unlike int, does not have a procedure option. But if you could rethink your procedure and express it in terms of sum or product then you may be able to use limit.



 

(**)

restart:

(**)

eqn:= arctan(x) + arccos(y/sqrt(y^2+1)) - arctan(4):

(**)

f:= numer(simplify(expand(tan(eqn)))) assuming x>=0, y>=0;

x*y+4*x-4*y+1

(**)

Sol:= [isolve](f);

[{x = -13, y = -3}, {x = 3, y = 13}, {x = 5, y = -21}, {x = 21, y = -5}]

(**)

remove(hastype, Sol, negative);

[{x = 3, y = 13}]

I am somewhat skeptical about isolve's ability to return all the solutions. So, investigating further,

(**)

solve(f,x);

(4*y-1)/(y+4)

(**)

convert(%, parfrac);

4-17/(y+4)

Now it is clear that y = 13 is the only positive integer solution.

 



Download tan_eqn.mw

 

nops([StringTools:-SearchAll("0", sprintf("%d", 2014!))]);

964

Anything between (* and *) is commented out, even if it is multiple lines.

Anything can be a ?symbol (a variable's name) in Maple if you enclose it in back quotes (``), aka accent grave. And symbols can be multiplied with `*`. The multiplication appears as simple juxtaposition when it is printed.

Your original expression is not mathematically correct. It should have a factor of "delta x" on the left side of the equation. Putting it all together, we get this:



(**)

f := x-> x^2; a := 0; b := 1;
for i to 5 do
     print(

          `The answer is `*'f'(x[i])*Delta*x

          = f(a+i*(b-a)/5)*(b-a)/5

     )
end do:

proc (x) options operator, arrow; x^2 end proc

0

1

`The answer is `*f(x[1])*Delta*x = 1/125

`The answer is `*f(x[2])*Delta*x = 4/125

`The answer is `*f(x[3])*Delta*x = 9/125

`The answer is `*f(x[4])*Delta*x = 16/125

`The answer is `*f(x[5])*Delta*x = 1/5

(**)

 



Download fake_mult.mw

First 339 340 341 342 343 344 345 Last Page 341 of 382