Ask Your Question

Rongcui Dong's profile - activity

2023-12-23 16:43:43 +0100 received badge  Famous Question (source)
2020-11-09 04:13:26 +0100 received badge  Notable Question (source)
2019-06-27 07:47:47 +0100 received badge  Self-Learner (source)
2019-01-04 16:18:57 +0100 received badge  Famous Question (source)
2017-10-19 11:29:35 +0100 received badge  Famous Question (source)
2017-06-07 14:13:26 +0100 received badge  Popular Question (source)
2017-05-22 21:41:07 +0100 received badge  Famous Question (source)
2017-05-09 09:15:01 +0100 received badge  Famous Question (source)
2016-10-19 20:58:25 +0100 received badge  Notable Question (source)
2016-06-01 20:16:33 +0100 received badge  Popular Question (source)
2016-05-20 19:59:51 +0100 received badge  Notable Question (source)
2016-03-16 19:41:55 +0100 received badge  Notable Question (source)
2016-03-16 19:41:55 +0100 received badge  Popular Question (source)
2016-02-11 22:57:48 +0100 received badge  Popular Question (source)
2015-11-23 01:58:57 +0100 received badge  Popular Question (source)
2015-11-23 01:58:57 +0100 received badge  Notable Question (source)
2014-08-20 23:58:33 +0100 commented question Are there transfer function, state space, and bode plots?

I'm sorry, but I can read nothing other than English and Chinese...

2014-08-20 20:20:07 +0100 answered a question Are there transfer function, state space, and bode plots?

There seems to be something like that in numpy/scipy, I will check that out.

UPDATE: Now I use Sage/Sympy to derive the symbolic function, and convert the numerator and denominator to coefficients of polynomials, and create LTI systems in Scipy to use functions like LTI.bode(), signal.convolve(), etc. Also, I really can't read most of your answers.

2014-08-20 20:19:38 +0100 commented answer Are there transfer function, state space, and bode plots?

Thanks, but I know how to do that. I am just not sure if there is an automatic way to help me do the s=I*omega and 20*log(abs(H),10) etc.

2014-08-20 20:18:12 +0100 commented answer Are there transfer function, state space, and bode plots?

I know how to plot if I type in the function manually. I am just trying to find a way so that I don't need to type lots of 20*log(abs(H),10) or H.subs(s=I*omega) things, they are all repetitive.

2014-08-20 17:27:26 +0100 commented answer Are there transfer function, state space, and bode plots?

Sorry, I can't read this...

2014-08-20 15:37:23 +0100 received badge  Student (source)
2014-08-20 15:06:30 +0100 asked a question Are there transfer function, state space, and bode plots?

I am looking for something like tf(), ss(), and bode() in control package of Octave, but I don't see them in sage. Are there any equivalents?

2014-08-20 15:04:39 +0100 received badge  Commentator
2014-08-20 15:04:39 +0100 commented answer How to Change Ticks for Y axis Only?

For example(not tested), xx = np.logspace(1,100,1000) yy = np.linspace(-180,180,1000) list_plot(xx,yy,scale=semilogx,ticks=[None, 30])

2014-08-02 03:26:16 +0100 received badge  Teacher (source)
2014-08-02 03:26:16 +0100 received badge  Self-Learner (source)
2014-07-26 23:12:36 +0100 answered a question How to Change Ticks for Y axis Only?

OK, I solved it by adding

 ticks=[None, 30]

to the arguments of plot. There is one example in 2D Plotting page on manual, but it does not say it changes the Y axis and that None does not change the axis. A little bit unclear.

2014-07-26 23:07:48 +0100 asked a question How to Change Ticks for Y axis Only?

I have a script plotting two numpy arrays using list_plot on semilogx scale. I am plotting angle on Y axis so I want 30/60/90 ticks, but I don't know how to change ticks on Y axis only without typing in anything about x axis. I can't find information about this on sage manual.

2014-07-23 00:37:23 +0100 commented answer Absolute value of complex numbers in 3D plot

OK, the minimal example works... Then I moved forward to approach the original problem (I wanted to plot frequency response) with 1+x+log(abs(i*omega), 10) and another error came up. I will update on original question.

2014-07-22 23:43:09 +0100 asked a question Absolute value of complex numbers in 3D plot

When I try to make a 3d plot with complex numbers in it, such as this one:

plot3d(1+x+abs(i*omega), (x,0,5), (omega,0,5), viewer='tachyon')

I get errors saying

TypeError: unable to coerce to a real number

On another one I got

TypeError: Unable to convert 0.0345000000000000*I to float

Why is this happening?


EDIT: Thanks for slelievre, lambda makes minimal example work. However, the original problem (I wanted to plot frequency responses) gives another error. Here is the original problem:

G_do_ideal_qn = -31.6656111462951*(0.0345000000000000*I*omega - 359.196869250000)/(-0.000389160000000000*omega^2 + 1.03531167486000*I*omega + 180.342274500000)

Tried to plot with

plot3d(lambda omega, V_C: 20*log(abs(G_do_ideal_qn), 10), (omega, 10, 100e3), (V_C, 0, 400))

Gives error

TypeError: unable to simplify to float approximation
2014-07-20 06:11:44 +0100 marked best answer How to Run Entire Worksheet?

Hello,

Now I have many cells of calculation in sagemath worksheet. I am looking for a way to run the entire worksheet at once, and generate result for printing. Any ideas? Thanks!

2014-07-19 02:59:44 +0100 commented answer How Do I Extract Terms Containing Certain Coefficients From A Polynomial?

OK... Well, I searched for all kinds of constructors and omitted this simple way...

2014-07-19 02:58:56 +0100 received badge  Editor (source)
2014-07-19 02:58:17 +0100 commented answer How Do I Extract Terms Containing Certain Coefficients From A Polynomial?

Thank you! When I copied it, it just disappeared...

2014-07-19 01:42:31 +0100 answered a question How Do I Extract Terms Containing Certain Coefficients From A Polynomial?

Thanks for Luca's answer! I am just expanding the code here

p1 = []
for m in p.iterator():
    sum = 0
    for x in (i_L, d, v_g, v_C):
        sum += m({x:0}).is_zero()
    if sum == 1:
        p1.append(m)
p1
2014-07-19 01:40:29 +0100 received badge  Scholar (source)
2014-07-19 01:40:23 +0100 commented answer How Do I Extract Terms Containing Certain Coefficients From A Polynomial?

I found it, it's called _list comprehension_. Thank you!

2014-07-19 01:37:55 +0100 commented answer How Do I Extract Terms Containing Certain Coefficients From A Polynomial?

Also, after I get the list, what should I do next to convert back to polynomial?

2014-07-19 01:36:39 +0100 commented answer How Do I Extract Terms Containing Certain Coefficients From A Polynomial?

Wow, after some careful study, this is indeed a fancy solution which is equivalent to 7 lines of code. What is this syntax called? Is it a standard python feature?

2014-07-19 01:26:10 +0100 commented answer How Do I Extract Terms Containing Certain Coefficients From A Polynomial?

What is that syntax? I don't know about this in python...

2014-07-19 01:22:18 +0100 commented answer How Do I Extract Terms Containing Certain Coefficients From A Polynomial?

Not quite... Yes, i_L and I_L are different. However, it is the lower-case ones that are being preserved: i_L, d, etc. So this is the opposite of what I need... I am reading about pattern match in document, but I have not found useful information yet.

2014-07-18 23:21:38 +0100 asked a question How Do I Extract Terms Containing Certain Coefficients From A Polynomial?

More specifically, I am trying to do small signal analysis on a power system, and I have some polynomial like this:

-D*I_L*Ron - I_L*Ron*d - D*Ron*i_L - Ron*d*i_L + D*V_g + V_g*d + D*v_g + d*v_g + D*V_C/n + V_C*d/n + D*v_C/n + d*v_C/n - V_C/n - v_C/n

I would like to take out terms including one of i_L, d, v_g, v_C, but not more. How can I do this?