cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

ODE and Power Spectral Density

AliErbay
1-Newbie

ODE and Power Spectral Density

Hello ,

I was not sure if it is o.k to post my question here since it contains some aspects of electrical enginnering.

In my worksheet there are some questions about mathcad usage and some mathematical problems(PSD and per-unit value in Ode solve block )

Regards

6 REPLIES 6

Is there PSD function? because i saw it mentioned in some thread, but i could not find it from Mathcad Help

Ali Erbay wrote:

Hello ,

I was not sure if it is o.k to post my question here since it contains some aspects of electrical enginnering.

In my worksheet there are some questions about mathcad usage and some mathematical problems(PSD and per-unit value in Ode solve block )

Regards

Some comments, and (maybe) a few answers.

1) posting almost anything anywhere is fine.

2) From the worksheet:

  • You define wbase as equal to w, then divide by it, (creating 1) why bother?

  • Odesolve is a wrapper around the command line solvers. It does a command line (rkfixed, rkadapt, . . ) then does a spline fit to the vectors from that solver to create a function. Since you're looking for a vector anyway, I'd use rkfixed, but setting it up can be a challenge for newbies (AND oldies too!)

  • You don't need to define a range variable (t) for a plot; Mathcad will assign values from -10 to 10 to an unassigned variable in the ordinate of a plot.

  • I have seen discussions about power spectral densities, in topics discussing Fourier transforms. Search with those terms. I can find no direct function of psd in versio 14 help.

  • One of the new things (in version 14 and above) is the ability to write sol(w) := Odesolve(t,200). Thiis will allow you to solve the equation over and over for different values of frequency. (Is that what you meaant by, "How can i treat inside of cos function when dealing with per-unit?"

  • One last question: Have you considered A Laplace Transform solution?

Hello again

- I need to define everything in equations in p.u to get result in p.u ( at least this is what i know )

So i define wbase, Ubase and Ibase and convert all other values to their p.u values.

if i make cos( w/wbase * t ) basically it means cos(t) , this would be wrong , unit of the argument is seconds

but strangely if i do that i get a periodic solution which i expect.

if i leave it cos (w*t) which seems correct now , gives me damped oscillation result that i dont expect from this ODE

And i dont want to solve this for different frequency, because the forcing frequency is the supply voltage's frequency 50 hz in this case

This is a equation for a non-linear circuit which behaves chaoticly for both certain initial conditions and circuit parameters. I need to estimate PSD and draw phase plane diagram for different conditions.

- Is there a way to make sol(t) a vector for given range of t ? it seems impossible to make a range variable with non-integer step size into a vector. I am a bit new to mathcad but i dont really see advantage of using range variable instead of vector/array. I mean the concept of range variable.

Regards

PhilipOakley
5-Regular Member
(To:AliErbay)

Hi,

I've been tring to get MathCAD to allow additional units to be defined, such as PUs (per Unit), and other dimensions.

They are very important for two reasons, both social engineering - everyone likes 'percent of rated' which is what PUs are, and they make the matrix maths much more stable as you can raise matrices to powers without the numbers exploding or vanishing too quickly.

They also work despite transformer galvanic isolation in the ESI (electrical supply industry) - one unit of power being fed down a transmission line at its rated voltage and current, no matter how many transformetr voltage level changes.

I'm reading this as a 50Hz transmission system, at 63.5kV, 131Amp : 8.32MW.

I'm quessing that the 11th power is simply an implied voltage limiter (it only works well if used in PUs - see rasing to powers above - it clips at unity) that is slightly beyond the 10th harmonic in a THD (Total Harmonic Distortion) calculation. It is possible to get mathcad to add a real limiter see some of the old work by Tom Gutma on the old collab.

I doubt you want any mathematicians discussion on what a 'spectrum' is in n-dimensional matrix spectral theorems (and I'm not the one who knows the answers either, I just know they are lurking out there). So I presume we are talking about normal time domain repetative vaveforms which are them converted to being frequencies, and looking at the amplitude spectrum.

I also presume that the initial transient isn't what you want to analyse - that is because the spectrum will vary depending on how much of the transient you include. That means you should reset the intial u(0) to be approx the peak voltage, so that it starts stable (i.e find the sample point near the end where the voltage reate u'=0, so you can match the t=0 case)

Having done / understood all that, you can now do the PSD (Power Spectral Density) of your wave form. You should have no initial transient, and you should be able to see nice repetition of the waveform. If you get it right, you should be able to change the settings so that you have much smaller steps, but only capture one or two cycles (note the transient decay may mean you want a few more cycles so you can check the initial conditions match the end conditions).

You now simply 'copy' the one cycle of voltage samples to the FFT/fft routine.

One of them produces the voltage amplitude at each spot frequency. You can tell by doubling the number of samples (per cycle), and getting the same result.

The other produces root power 'density', that is, it has fancy normalisation factors [most folk can't see the problem] that are based on the number of samples, rather than the frequency range.

The PSD will (essentially) be in Volts per root Hz, that is, if V^2/R is calculated you get Power/unit bandwidth, or power density. Obviously you need to convert to your choice of PU bandwidth (is it in PU (Watts|Volts) per [Hz|PU BW] ?).

Sccond aside : the normalilsation argument partly depends on how wide band noise is defined/simulated/aliased, and assumptions about band limited signals.

hello again ,

i changed per-unit calculation , now i calculate its per-unit after the odesolve. ( I hope in this way i will get the correct solution after odesolve without any mixup)

i turned sol(t) into a vector by deciding odesolve's npoints by myself.

and i added FFT and PSD but i dont know if they are correct or not. ( for example scales in graphs )

Could you check if i am on the right track?

I found PSD calculation from this forum posted by jmgiraud here. http://communities.ptc.com/message/86528#86528 PSD unk.mcd file

Regards

I've tried to put units to your problem. Take a look, compare it to your last post. You may need to alter some numbers; I made some guesses.

I've used CFFT instead of cfft for the fourier transform; the only difference is the normalizing factor. (I keep an example around to remind myself.)

As far as power spectral density goes, I'm at a loss. I've seen examples, but nothing that made it clear.

Luck!!

Top Tags