nm

11373 Reputation

20 Badges

13 years, 42 days

MaplePrimes Activity


These are questions asked by nm

How does one adjust the aspect ratio for Maple plot? I actually searched for aspect ratio for Maple on google and not able to find much of anything. Help does not have such phrase. May be it called something else in Maple? The reason I ask, is that when I change the size of bode plot, the aspect ratio become bad. So I need a way to adjust that. Here is an example

restart:
alias(DS=DynamicSystems):
sys:=DS:-TransferFunction(5*s/(s^2+4*s+25)):
DS:-BodePlot(sys,range=0.1..100);

Now if I do

DS:-BodePlot(sys,range=0.1..100,size=[300,"default"]);

I am finding so many problems with Bodeplot in Maple, but this is for another time. I think it needs much more polishing

Maple 18, windows 7

When I do

restart:
alias(DS=DynamicSystems):
sys:=DS:-TransferFunction(5*s/(s^2+4*s+25)):
DS:-BodePlot(sys,output=dualaxis);

I get nice small plot.  with no outer frame filling the whole window



But if I just do

DS:-BodePlot(sys);

The plot is too large. So I tried the size option, but all what this did is reduce the plot size, but left the outer frame filling the whole window:

DS:-BodePlot(sys,size=[400,300]);

 

Is there a way to get the above plot, but either without the outer frame, or have the outerframe fit correctly around the plots?

Maple 18 on window 7

 

Here is one example:

restart;
alias(DS=DynamicSystems):
zeros :=[-1,-2]:
poles :=[0,-4,-6]:
gain  :=5:
sys   :=DS:-TransferFunction(zeros,poles,gain):

now sys above is a transfer function "object". But how would one go about extracting its properties? For example, I'd like to read the actual rational polynomial in s that represents the transfer function, which is embedded inside this oject, but I am not able to find an API to read it. I can only print it to the screen :


DS:-PrintSystem(sys);

But I'd like to assign the  "tf" printed above (the rational polynomial) into a seaprate variable, so I can extract the numerator and denominator if I want to. I have looked and not able to see a way to read this out. I just started learning this package.

Any idea how to look into these system objects? This does nothing:

o:=DS:-PrintSystem(sys);
whattype(o);
o[1];

Using Maple 18. I am looking for a programmable approach, using code. Not a click and point and menu based solution.

 

According to help here  on display, it says "The options parameter can include plot options as described in the plot/option "  and when  I go to the plots/option I see legend there. But when I try to use it, I get an error that plots:-display does not accept the legened option.

I am generating 2 plots, and use display() to show them on one axes. But need to add a legend as well. Is there a correct way to do this? 

restart:
with(DynamicSystems):
with(plots):
sys := TransferFunction(1/(s^2+0.2*s+1)): 
p1:=ResponsePlot(sys, Step(),duration=50,color=red):
p2:=ImpulseResponsePlot(sys,50);
display([p1,p2],axes=boxed, title=`step and impulse reponses`,legend=["step","impulse"]);

Now if I add legend, it fail

display([p1,p2],axes=boxed, title=`step and impulse reponses`,legend=["step","impulse"]);

I am sure I am doing something wrong. How to add legend to display? I can't use plot([...]) since the plots are allready generated by other Maple functions.

 

 

One can write 

restart;
alias(C=binomial);
C(4,2);

or

restart;
C:=binomial;
C(4,2);

and then both work the same. In the first case, the replacement of "C" by "binomial" is done at parsing time before evluator gets hold of the code, while in the second case, the replacement is done at run-time (evaluation).

So alias will be more efficient and more safe, I assume.

Is that all there is to it, or are there other more subtle and important reasons to use alias vs. :=  when one want to bind long name to smaller ones to save on typing.

 

First 188 189 190 191 192 193 194 Last Page 190 of 200