Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

Cannot extract data from two datasets properly

Please login with a confirmed email address before reporting spam

I'm using COMSOl 4.4 LiveLink with Matlab (R2012b).

I've run a time-dependent simulation with two studies, where I've implemented a stop condition for the first time-dependent study, and then used the solution from the first study as the initial condition for the second study.

The problem I'm having is that the first solution contains 44 time points, while the second solution contains 197 time points. When I load the model into Matlab and try to use mphglobal, for instance, to extract data from the second data set, it only gives me the first 44 time points' worth of data. Am I missing something?

When I access the solution information of the model using mphsolutioninfo(model), it shows me that the two datasets have the proper size (see below):

>> info.sol3

ans =

dataset: {'dset3' 'dset4'}
study: 'std2'
sequencetype: 'SolverSequence'
values: {[1x197 double]}
parameters: {'t'}
mapheaders: {'t' 'Inner' 'Outer'}
map: [197x3 double]

>> info.sol1

ans =

dataset: 'dset1'
study: 'std1'
sequencetype: 'SolverSequence'
values: {[1x44 double]}
parameters: {'t'}
mapheaders: {'t' 'Inner' 'Outer'}
map: [44x3 double]

Any suggestions?

Thanks

Dave

1 Reply Last Post 19 dic 2014, 11:16 GMT-5

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 19 dic 2014, 11:16 GMT-5
I figured out a workaround for this - I just need to explicitly specify the solution number when using mphglobal or mpheval.

For example, to extract the time points from the 197-point dataset, I can use:

time = mphglobal(model,'t','dataset','dset3','solnum',1:197)

I'm not sure why the default isn't to include all of the possibles 'solnum' values for the given dataset...

Dave

I figured out a workaround for this - I just need to explicitly specify the solution number when using mphglobal or mpheval. For example, to extract the time points from the 197-point dataset, I can use: time = mphglobal(model,'t','dataset','dset3','solnum',1:197) I'm not sure why the default isn't to include all of the possibles 'solnum' values for the given dataset... Dave

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.