Carl Love

Carl Love

28070 Reputation

25 Badges

13 years, 34 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@BK The relevant DOS/Windows commands are CD and SET PATH=..., but I can't provide any more help than that. As I said, this error has nothing to do with Maple. Perhaps Acer can give a better example. Or, you could get better help on a Windows/DOS forum. A place to start might be a Google search on "how to set dos path".

@BK Since awk is not a standard Windows command but your batch file does run in a command window, I guess that you have some third-party version of awk installed. My guess is that you need to change the batch file so that its first command is to change the working directory (aka folder) so that it is the same as the one from which the batch did work. If I give Maple the command ssystem("dir"), it shows me that the working directory is C:\Program Files\Maple 2016. This is probably not the working directory that you were using when you successfully ran the batch file.

@BK That is an error due to the commands in the batch file. The error has absolutely nothing to do with Maple. It looks like you may be trying to run the Linux command awk on a Windows system. If that is what you're trying to do, it may help if you install a free program named Cygwin.


 

fq:= piecewise(
   p < -5, 0.,
   p < -3, .161711971*(p+5.)^3,
   p < -1, -1.798464149*p^2-.544033315*p+7.541565235-.3076373305*p^3,
   p < 1, 0.809338641e-1*p^3-.6327505649*p^2+.6216802691*p+7.930136430,
   p < 3, 0.7445052690e-1*p^3-.613300552*p^2+.602230257*p+7.936619768,
   p < 5, 0.19182821e-2*p^3+0.39489651e-1*p^2-1.35614035*p+9.894990378,
   p < 7, -0.256603524e-2*p^3+.106754411*p^2-1.69246414*p+10.45553002,
   p < 9, -0.254356370e-2*p^3+.106282509*p^2-1.68916084*p+10.44782231,
   p < 11, -0.2031067084e-1*p^3+.585994401*p^2-6.00656786*p+23.40004343,
   p < 13, 0.4137545813e-1*p^3-1.449647855*p^2+16.38549696*p-58.70419431,
   p < 15, -0.273325019e-1*(p-15.)^3,
   15 <= p, 0.
):
m:= piecewise(1 <= p and p <=9, fq):  


The above is the same input as you had in your posted worksheet. Now all you need to do is

simplify(m);

piecewise(p < 1, 0, p < 3, 0.7445052690e-1*p^3-.613300552*p^2+.602230257*p+7.936619768, p < 5, 0.19182821e-2*p^3+0.39489651e-1*p^2-1.35614035*p+9.894990378, p < 7, -0.256603524e-2*p^3+.106754411*p^2-1.69246414*p+10.45553002, p < 9, -0.254356370e-2*p^3+.106282509*p^2-1.68916084*p+10.44782231, p = 9, 2.00000012864, 9 < p, 0)

That's all there is to it: just simplify(m), like I originally said.


 

Download simplify_nested_piecewise.mw

@dellair Yes, I know what you want!!!  Have you tried the simplify command as I suggested???

@tomleslie What you're missing is that the OP wants a simplified algebraic representation of the nested piecewise expressions; they aren't interested in the plot.

@dellair So, do you understand?

@dellair You defined a variable named m in your posted worksheet. Now you simply need to give the command simplify(m), and then the piecewise will appear exactly the way that you want.

@mschneider Continue to use curly braces {x,y,z} in the solve command. The square brackets [x,y,z] are for the eval command.

Trying to set a limit on the number of cores used by Maple by using the command kernelopts(numcpus= ...) only works if the limit is set immediately after a restart. The documentation implies (by omission) that the limit can be set at any time. See this MaplePrimes thread: http://www.mapleprimes.com/questions/215191-How-To-Limit-The-Number-Of-Processors

The safer alternative to subs is eval, which won't do substitutions that don't make sense mathematically:

eval(t, sol[3]);

@idol050279 The ImportMatrix command will convert a .csv file into a Maple Matrix. See ?ImportMatrix. You may need to use decimal points instead of commas (i.e., 0.05 instead of 0,05).

@Aaeru Michi You ask good questions that I don't know how to answer. Hopefully someone with more expertise in ODEs will join this thread. You may gain some insight by varying the method used by dsolve, for example method= rosenbrock, method= gear.

@Aaeru Michi I wouldn't exactly say that it "works" using mu(0) = 50, because here is the plot of R:

Rather, I'd say that it fails to give an error message.

You have a good point about the singularity (possibly) being removable. We need to figure out how to remove it. I don't have much expertise in this, but I suppose that it would help to have a guess for the value of limit(cot(x)*D(mu)(x), x= 0, right), which I think is the same as limit(D(mu)(x)/x, x= 0, right). Another way of looking at it is that we need the first nonzero term in the series expansion (which is not necessarily a power series) of D(mu)(x). Looking at the plot of D(mu)(x), I'd guess that that term is -x^p, with 0 < p < 1. That wouldn't be good enough to remove the singularity.

@Kitonum Thanks for spotting that. I've corrected the Answer.

First 364 365 366 367 368 369 370 Last Page 366 of 709