Carl Love

Carl Love

28050 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

You can't extrapolate a numeric BVP solution outside its original boundary points.

@Mac Dude You wrote:

  • I don't think there is a direct way to enforce several parameters to have the same type but allowing different types.

You can control the relationship between procedure parameters by using the parameter modifier depends (which has no relationship to the command depends). See ?parameter_modifiers.

@Joe Riel It takes several minutes for the link to disappear, which means that people will waste even more time by deleting spam that's already been deleted.

On the plus side, I like the code snippet feature, and I think that it works better than the equivalent feature on StackExchange. Now I don't need to worry about spacing between my lines of code.

@Ronan Joe's procedure is not effective. There's a great variety of illegal input that it allows. For example:

myproc([a,b], [c,d], [e,<f>]);
myproc(<1,2,3>, <4,5>, <6>);

To answer the thing that you didn't understand: It works because a listlist is not just a list of lists: each sublist is required to have the same number of elements.

Here's a corrected version of Joe's procedure.

myproc := proc(A,B,C)
local L;
     L := [A,B,C];
     if L :: 'list(algebraic)' then
          # option 1
     elif L :: list([algebraic $ 2]) then
          # option 2
     elif L :: list([algebraic $ 3]) then
          # option 3
     elif L :: 'list(Vector(2, algebraic))' then
          # option 4
     elif L :: 'list(Vector(3, algebraic))' then
          # option 5
     else
          error "unknown types of arguments"
     end if;
end proc:

However, I was under the impression that you wanted the validity of the arguments checked in the procedure header rather than the procedure body. I came up with another way to do that---much simpler than the module method that I posted earlier---and it's posted as my second Answer below.

 

 

@Bryon The wide spacing between the lines is hideous. I'm almost too embarrassed to post my neatly and painstakingly formatted code in a form where it appears so ugly.

Once again, please try to emulate the spacing that's used on StackExchange.

Is Maple an "airy, light" subject? Is this a gossip forum? Is this a forum primarily for children in elementary school who use Maple? No, Maple is a serious topic which deserves a serious forum with an information density that is typical of other academic and scholarly websites.

Uploading a worksheet didn't work for me yesterday, but it seems to work today. I am using the same browser (FireFox) in both instances.

@Carl Love Your lack of a Reply suggests to me that you didn't understand the utter simplicity of the idea that I presented. So here's your entire worksheet done in 10 lines of code, 7 of which are simply defining the numeric values.

Unfortunately, the uploading of worksheets has been totally broken by today's MaplePrimes update. So here is the code as plain text:

restart:
Vals:= [
     varepsilon= [3.0, 18.0877 $ 7] -~ I*~[2.0, 1.1146 $ 7],
     mu=              [2.0, 1.3657 $ 7] -~ I*~[3.0, .2846 $ 7],
     f= [1.184, 8.2 $ 7]*1e9,
     d= [0.50, seq(0.15..0.27, 0.03), 0.31, 0.34]*1e-2 / c,
     c= 3e8
]:
P:= (varepsilon, mu, f, d)-> sqrt(mu/varepsilon)*tanh(I*2*Pi*sqrt(mu*varepsilon)*f*d);

RL:= P-> 20*log[10](abs((P-1)/(P+1)));

(RL@P)~(eval[recurse]([varepsilon, mu, f, d], Vals)[]);

That's all there is to it!

 

 

 

@Joe Riel Yes, definitely, I meant to say that.

The authors should examine carefully how the Notifications flag works on StackExchange. That is the model to emulate. I currently waste so much time checking for replies to my MaplePrimes posts when there are no replies. That problem would be solved if the flag updated automatically, no page refresh needed.

@roman_pearce "Information density is low" is quite an understatement. It's lower by at least a factor of two from what it used to be, which wasn't high.

@Joe Riel Click on the text which appears not to be an active link. That'll take you to the post. There's another example of how the controls are not highlighted.

The new Notifications flag is disfunctional in several ways:

1. The notifications only apply to posts to which I am email subscribed. I don't email subscribe to anything because I don't want all that email! What I want a notification about is when someone replies to a thread that I've participated in. And I want that flag to turn orange automatically when I have a response, not requiring a page refresh!

2. The flag ceases to be orange after it has been opened, regardless of whether I have checked or dismissed the threads.

Please look at and study any StackExchange forum. Notice the vast amount of information that's on one screen? Notice the vast number of flags that update automatically? Anything that you can do to make the look and feel similar to StackExchange would be a great improvement.

@vv The randomize test that I concocted above proves beyond any reasonable doubt that the code intentionally makes a call to Maple's random number generator. So, whether some unintentional randomization is also occurring is irrelevant.

@Joe Riel Your getparams code is missing the closing )] on the seq command.

@annarita It can be done by doing a parametric plot3d for each of the six faces and then assembling the results with plots:-display:

Pz0:= plot3d([x,y,0], x= 0..1, y= 0..1, color= x^2+y^2-0^2):
Pz1:= plot3d([x,y,1], x= 0..1, y= 0..1, color= x^2+y^2-1^2):
Px0:= plot3d([0,y,z], y= 0..1, z= 0..1, color= 0^2+y^2-z^2):
Px1:= plot3d([1,y,z], y= 0..1, z= 0..1, color= 1^2+y^2-z^2):
Py0:= plot3d([x,0,z], x= 0..1, z= 0..1, color= x^2+0^2-z^2):
Py1:= plot3d([x,1,z], x= 0..1, z= 0..1, color= x^2+1^2-z^2):
plots:-display(P||(x,y,z)||(0,1));

This is the basic plot on the (one-dimensional) HUE color scale (the visual spectrum). Many variations are possible using the three-dimensional RGB or HSV color spaces. Additional options to control the grid, transparency, etc., can be added to the end of the display command.

First 377 378 379 380 381 382 383 Last Page 379 of 709