Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

iterator operator

Please login with a confirmed email address before reporting spam

Hi there,

I am working with comsol 5.3, and I would like to define a force using mathematical series.
My question is how to write this on a force field on comsol (matlab code) :

S=0;
for i=1:100
S=S+f(i);
end

With f is a given function.

2 Replies Last Post May 24, 2017, 6:12 a.m. EDT
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago May 23, 2017, 8:12 a.m. EDT
Hello Achref,
COMSOL offers the sum operator to perform such summations. See Reference Manual, version 5.3, page 239 and 251.
Best regards,
Jeff
Hello Achref, COMSOL offers the sum operator to perform such summations. See Reference Manual, version 5.3, page 239 and 251. Best regards, Jeff

Please login with a confirmed email address before reporting spam

Posted: 8 years ago May 24, 2017, 6:12 a.m. EDT
Thank you this was really helpful
Thank you this was really helpful

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.