Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 26527

Problem of using femtime() in COMSOL 3.5a

$
0
0
Hello all,

I use femtime() in matlab to solve a dynamic FE problem as follow:

fem.sol = femtime(fem,'Tlist',tspan);
where tspan is an equally distributed time list. tspan = [t0,t1,t2,...tn].

Now, I am trying to break this long time list into a for-loop

for ii = 1:length(tspan)
u0 = fem.sol.u(:,end);
u_dot0 = fem.sol.u(:,end);
fem_temp = fem;
fem_temp.sol = femsol({u0 u_do0},'tlist',tspan(ii-1));
fem_temp = femtime(fem_temp,'init',u0,[tspan(ii-1) tspan(ii)]);
fem.sol = femsol({[fem.sol.u fem_temp.sol.u(:,end)] [fem.sol.ut fem_temp.sol.ut(:,end)},'tlist',[fem.time.tlist tspan(ii)]);
end

However, the for-loop is not equivalent to the original command, because I get totally different results for the same input.

Is it the correct to add initial conditions like this? How to add initial velocity to femtime()?

Thanks

Dan

Viewing all articles
Browse latest Browse all 26527

Trending Articles