Search code examples
maximawxmaximamathcad

How to convert Mathcad formula to WxMaxima


I'd like to convert a Mathcad formula to WxMaxima which calculates Fourier transform of two signals.

Fourier1

Fourier2

The problem is I haven't used Mathcad software until now. My primary operating system is Linux and as far as I know it is quite difficult to install Mathcad software in Linux.

So I decided to use WxMaxima and here is what I've tried so far.

N=8;
t=makelist(i,i,0,80);
A1=1;
A2=0;
A3=0.6;
y(t):=A1*sin((2*%pi*t)/(10*N)) + A2*sin((4*%pi*t)/(10*N)) + A3*sin((6*%pi*t)/(10*N));
wxplot2d ( [y(t)] , [t,0, 20] );

From the Mathcad formula t looks like a range. So I decided to use a list t.

y(t) function looks fine but when I try to plot this function using wxplot2d I get an error message about plotting range.

wxmaxima error

Any ideas about how to convert this Mathcad formula to WxMaxima? Thanks.

Citation :

Giovanni Schgör. Segnali analogici e segnali numerici


Solution

  • Apparently, the issue was that I didn't know about how to assign numerical values to variables.

    Also I've learned how to plot discrete data using Maxima.

    I should be able to get the result that I want with the changes below.

    N:8;
    t:makelist(i,i,0,80);
    A1:1;
    A2:0;
    A3:0.6;
    y(t):=A1*sin((2*%pi*t)/(10*N)) + A2*sin((4*%pi*t)/(10*N)) + A3*sin((6*%pi*t)/(10*N));
    points:makelist([i/10,y(i)], i, 1, 80);
    wxplot2d([discrete,points]);
    

    sen.png