HP Forums

Full Version: HP PRIME -- How to plot a phase Bode plot ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Hi,

I want to create a program that is able to plot a curve without phase discontinuities on +/- pi rad... So The use of the ARG() command is not enough ... The classic tricks that I use with GNUPLOT can not be used here ...

Here is a description of what I'd like to get:

- first ask for transfer function F(s)(with input command)

F(s)= (1+10*s)^2/(1+s)^3 for example...

- use the subst cmd to replace 's' by 'i*ALOG(X)' where X is the pulsation in rad/s. So I can plot for Xmin <LOG(X)< Xmax

- create the F1 var function ready to plot in Function APP...
F1(X)=phase(X)...
where phase(X) is something like

phase(X)=ARG(F(i*ALOG(X))+2k*PI

The difficulty is to calculate k ...

On Gnuplot I look continuously during plotting process at ARG(f(xold))-ARG(f(x)) and if a jump occurs I increment or decrement k according to the sign of the jump...

Another idea is to use CAS command zero or solve and save all roots of arg(F(X))=+/-Pi in list L1

then create F1(X)=F1(X)+-2*PI*Heaviside(X-L1(n))in a loop for n=1 to size(L1)...

I'm looking for advice and assistance for such a program...

Thank you in advance if someone just spend a little time on this little problem ;o)