function obj = to_sp_object(x)
    % convert x to sympy object
    if isa(x, 'double')
        if isreal(x)
            obj = sympy__double2sym(x);
        else
            if ~isscalar(x)
                error("不支持的输入：复数 double 仅支持标量");
            end
            sp = sympy__sp;
            re = sympy__double2sym(real(x));
            im = sympy__double2sym(imag(x));
            obj = re + im * sp.I;
        end
    elseif isa(x, 'sympy.Base')
        obj = getObj(x);
    else
        error("不支持的输入：参数必须是double或者Symbol对象");
    end
end