Minimization of a summation of two functions with respect to two constrained variables

I have a question regarding the minimization of a function, which is a summation of two separate functions, with a discrete list for one of the variables.

$S[a,c]= \sqrt{\sum_{b=0,4,8,12,16}{(f[b]-g[b,c,a])^2}}$

$f[b]$ is linear function with one variable , However $g[b,c,a]$ is a complex number function

and note that there are also constraints, $0<c<1$ and $0<a<5$

My question is, how do I first perform the summation then minimize the function $S[a,c]$ to optimize the variable $a$ and $c$ on the function.

Is there anyway I can used the NMinimize option?

I tried using this built in operator and it gives me an error which says that the objects are of unequal length.

Any help regarding this problem would be appreciated.

• Hi Jonathan and welcome! To make the most of Mma.SE start by taking the tour now. It will help us to help you if you write an excellent question. Edit if improvable, show due diligence, give brief context, include minimal working example of code and data in formatted form. As you receive give back, vote and answer questions, keep the site useful, be kind, correct mistakes and share what you have learned. – rhermans Jul 5 '18 at 13:31