Lars Gregersen
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2011年9月12日 GMT-4 08:05
Hi
The LiveLink for Matlab contains a function mphgetu that you can use to extract the solution vector.
You can manipulate the solution vector and return it to Comsol using the methods described under setU() in the API Reference Guide.
Lars Gregersen
Comsol Denmark
Hi
The LiveLink for Matlab contains a function mphgetu that you can use to extract the solution vector.
You can manipulate the solution vector and return it to Comsol using the methods described under setU() in the API Reference Guide.
Lars Gregersen
Comsol Denmark
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2011年9月13日 GMT-4 03:32
Thanks for your reply, I will look into those functions today.
Thanks for your reply, I will look into those functions today.
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2011年11月16日 GMT-5 11:29
I actually have the solution data saved to a mat file and I want to put it into a solution object and view it with the mphplot command, but I DO NOT want to run the solution again in COMSOL because it's a fairly lengthy solution. Here's what I'm trying to do...
Run the code until it gets to the model.sol('sol1').runAll command (to avoid running the solution). Then I run the lines
for i=1:1:length(tlist)
model.sol('sol1').setU(i,U(:,i));
end
model.sol('sol1').setPValues(tlist);
model.sol('sol1').createSolution;
everything but the createSolution method seems to work, but there's problems with createSolution (NullPointerException). Is this a good approach to doing this?
Thanks for any help,
-Matt
I actually have the solution data saved to a mat file and I want to put it into a solution object and view it with the mphplot command, but I DO NOT want to run the solution again in COMSOL because it's a fairly lengthy solution. Here's what I'm trying to do...
Run the code until it gets to the model.sol('sol1').runAll command (to avoid running the solution). Then I run the lines
for i=1:1:length(tlist)
model.sol('sol1').setU(i,U(:,i));
end
model.sol('sol1').setPValues(tlist);
model.sol('sol1').createSolution;
everything but the createSolution method seems to work, but there's problems with createSolution (NullPointerException). Is this a good approach to doing this?
Thanks for any help,
-Matt
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2011年11月16日 GMT-5 13:23
I can't tell if your approach will eventually work (I doubt it).
But I can tell you that plotting results in matlab from a .mat file is much faster than the mphplot command. It's better to work with the matlab plot command and your .mat file than trying to "upload" your .mat in a comsol model and working with the slow mphplot command.
I can't tell if your approach will eventually work (I doubt it).
But I can tell you that plotting results in matlab from a .mat file is much faster than the mphplot command. It's better to work with the matlab plot command and your .mat file than trying to "upload" your .mat in a comsol model and working with the slow mphplot command.
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2013年12月12日 GMT-5 15:27
This thread is old, but I ll risk it anyway.
I want to be able to put data back into a solution object so i can use the integration methods from comsol on the mesh. I know I can also juggle with the numerical integration of matlab (trapz() for example), but it is more elegant to make comsol do it, since it has all the dimensions, geometry and mesh already there.
So, anybody found a solution on how to create a solution object with a given data?
( what I do is combine the data from two different datasets with matlab, then i want to integrate certain quantities on this new data set, it has the same number of everything than the original 2).
Thanks!
This thread is old, but I ll risk it anyway.
I want to be able to put data back into a solution object so i can use the integration methods from comsol on the mesh. I know I can also juggle with the numerical integration of matlab (trapz() for example), but it is more elegant to make comsol do it, since it has all the dimensions, geometry and mesh already there.
So, anybody found a solution on how to create a solution object with a given data?
( what I do is combine the data from two different datasets with matlab, then i want to integrate certain quantities on this new data set, it has the same number of everything than the original 2).
Thanks!