Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2010年11月22日 GMT-5 10:29
There must be a way to implement a function of two variables in COMSOL . . .
Has anyone done this before? Is there anyone who can help me?
There must be a way to implement a function of two variables in COMSOL . . .
Has anyone done this before? Is there anyone who can help me?
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2010年11月22日 GMT-5 10:43
I don't use the MatLab Link, but at least this would be the way to solve this problem. Working with COMSOL under MatLab. Then you should be able to use the buitl-in interpolation funtions of MatLab.
I don't use the MatLab Link, but at least this would be the way to solve this problem. Working with COMSOL under MatLab. Then you should be able to use the buitl-in interpolation funtions of MatLab.
Ivar KJELBERG
COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2010年11月22日 GMT-5 14:50
Hi
have you read the chapter on "Analytical Functions" in the user "guide.pdf" of the 3.5a doc ?
--
Good luck
Ivar
Hi
have you read the chapter on "Analytical Functions" in the user "guide.pdf" of the 3.5a doc ?
--
Good luck
Ivar
Magnus Ringh
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2010年11月23日 GMT-5 07:28
Hi,
It is possible to define a function of two variables using an interpolation function defined in a text file using the spreadsheet data format: the first column contains the values for the first input argument, the second column contains the values for the seond input argument, and the third column contains the function's value. Each row then contains a set of two input arguments and the corresponding function value:
x1 y1 f(x1,y1)
x2 y2 f(x2,y2)
...
The Spreadsheet data format is documented in the File Formats chapter of the COMSOL Multiphysics Reference Guide for version 4. I recommend using version 4, where you can get a preview plot by clicking the Plot button. COMSOL Multiphysics then shows a surface plot of the function in the Graphics window so that you can see the effects of the various interpolation and extrapolation options before using the function in the model.
Best regards,
Magnus Ringh, COMSOL
Hi,
It is possible to define a function of two variables using an interpolation function defined in a text file using the spreadsheet data format: the first column contains the values for the first input argument, the second column contains the values for the seond input argument, and the third column contains the function's value. Each row then contains a set of two input arguments and the corresponding function value:
x1 y1 f(x1,y1)
x2 y2 f(x2,y2)
...
The Spreadsheet data format is documented in the File Formats chapter of the COMSOL Multiphysics Reference Guide for version 4. I recommend using version 4, where you can get a preview plot by clicking the Plot button. COMSOL Multiphysics then shows a surface plot of the function in the Graphics window so that you can see the effects of the various interpolation and extrapolation options before using the function in the model.
Best regards,
Magnus Ringh, COMSOL
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2011年4月28日 GMT-4 15:00
x y f(x,y)......
i have given in the above format and its showing the following error
Error: 6080
Interpolation grid axis values must be sorted in ascending order in each dimension
Exception:
com.femlab.jni.FlNativeException: Non monotonous interpolation grid
Messages:
Non monotonous interpolation grid
Stack trace:
at interpolator.cpp, row 408, ()
at com.femlab.xmesh.Xmesh.addElems(Native Method)
at com.femlab.xmesh.Xmesh.addElems(Unknown Source)
at com.femlab.commands.MeshExtendCommand.c(Unknown Source)
at com.femlab.commands.MeshExtendCommand.r(Unknown Source)
at com.femlab.commands.MeshExtendCommand.evalOnServer(Unknown Source)
at com.femlab.commands.FlCommand.runServerCode(Unknown Source)
at com.femlab.server.ServerProxy.eval(Unknown Source)
at com.femlab.commands.FlCommand.a(Unknown Source)
at com.femlab.commands.FlCommand.eval(Unknown Source)
at com.femlab.commands.a.a(Unknown Source)
at com.femlab.util.CoreUtil.meshExtend(Unknown Source)
at com.femlab.api.client.Solver.solve(Unknown Source)
at com.femlab.api.client.SolveModel.a(Unknown Source)
at com.femlab.api.client.SolveModel.a(Unknown Source)
at com.femlab.api.client.x.a(Unknown Source)
at com.femlab.gui.FlProgressThread.run(Unknown Source)
at com.femlab.util.j.run(Unknown Source)
at com.femlab.util.ae.run(Unknown Source)
x y f(x,y)......
i have given in the above format and its showing the following error
Error: 6080
Interpolation grid axis values must be sorted in ascending order in each dimension
Exception:
com.femlab.jni.FlNativeException: Non monotonous interpolation grid
Messages:
Non monotonous interpolation grid
Stack trace:
at interpolator.cpp, row 408, ()
at com.femlab.xmesh.Xmesh.addElems(Native Method)
at com.femlab.xmesh.Xmesh.addElems(Unknown Source)
at com.femlab.commands.MeshExtendCommand.c(Unknown Source)
at com.femlab.commands.MeshExtendCommand.r(Unknown Source)
at com.femlab.commands.MeshExtendCommand.evalOnServer(Unknown Source)
at com.femlab.commands.FlCommand.runServerCode(Unknown Source)
at com.femlab.server.ServerProxy.eval(Unknown Source)
at com.femlab.commands.FlCommand.a(Unknown Source)
at com.femlab.commands.FlCommand.eval(Unknown Source)
at com.femlab.commands.a.a(Unknown Source)
at com.femlab.util.CoreUtil.meshExtend(Unknown Source)
at com.femlab.api.client.Solver.solve(Unknown Source)
at com.femlab.api.client.SolveModel.a(Unknown Source)
at com.femlab.api.client.SolveModel.a(Unknown Source)
at com.femlab.api.client.x.a(Unknown Source)
at com.femlab.gui.FlProgressThread.run(Unknown Source)
at com.femlab.util.j.run(Unknown Source)
at com.femlab.util.ae.run(Unknown Source)
Ivar KJELBERG
COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2011年4月28日 GMT-4 15:15
Hi
the grid data must be ordered in increasing order if I remember right X first, Y after then f(x,y) pls check as as usual, I could be 50% off.
Try to save a data txxt file i.e. one from a material or a postprocessing plot and compare (2 dimensional)
--
Good luck
Ivar
Hi
the grid data must be ordered in increasing order if I remember right X first, Y after then f(x,y) pls check as as usual, I could be 50% off.
Try to save a data txxt file i.e. one from a material or a postprocessing plot and compare (2 dimensional)
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2011年4月28日 GMT-4 15:42
i have given it like
x y f...with x in ascending order and now the error is
Error: 9048
Format of data file is not correct.
It should contain grid and data values separated by lines starting with %
Exception:
com.femlab.util.FlException: Format of data file is not correct
Messages:
Format of data file is not correct
Stack trace:
at com.femlab.api.server.InterpElem.a(Unknown Source)
at com.femlab.api.server.InterpElem.toElemSyntaxes(Unknown Source)
at com.femlab.api.server.InterpElem.toElemSyntaxes(Unknown Source)
at com.femlab.api.server.XFem.toElemSyntax(Unknown Source)
at com.femlab.commands.MeshExtendCommand.<init>(Unknown Source)
at com.femlab.util.CoreUtil.meshExtend(Unknown Source)
at com.femlab.api.client.Solver.solve(Unknown Source)
at com.femlab.api.client.SolveModel.a(Unknown Source)
at com.femlab.api.client.SolveModel.a(Unknown Source)
at com.femlab.api.client.x.a(Unknown Source)
at com.femlab.gui.FlProgressThread.run(Unknown Source)
at com.femlab.util.j.run(Unknown Source)
at com.femlab.util.ae.run(Unknown Source)
i have given it like
x y f...with x in ascending order and now the error is
Error: 9048
Format of data file is not correct.
It should contain grid and data values separated by lines starting with %
Exception:
com.femlab.util.FlException: Format of data file is not correct
Messages:
Format of data file is not correct
Stack trace:
at com.femlab.api.server.InterpElem.a(Unknown Source)
at com.femlab.api.server.InterpElem.toElemSyntaxes(Unknown Source)
at com.femlab.api.server.InterpElem.toElemSyntaxes(Unknown Source)
at com.femlab.api.server.XFem.toElemSyntax(Unknown Source)
at com.femlab.commands.MeshExtendCommand.(Unknown Source)
at com.femlab.util.CoreUtil.meshExtend(Unknown Source)
at com.femlab.api.client.Solver.solve(Unknown Source)
at com.femlab.api.client.SolveModel.a(Unknown Source)
at com.femlab.api.client.SolveModel.a(Unknown Source)
at com.femlab.api.client.x.a(Unknown Source)
at com.femlab.gui.FlProgressThread.run(Unknown Source)
at com.femlab.util.j.run(Unknown Source)
at com.femlab.util.ae.run(Unknown Source)
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2011年4月28日 GMT-4 15:43
i have given it like
x y f...with x in ascending order and now the error is
Error: 9048
Format of data file is not correct.
It should contain grid and data values separated by lines starting with %
Exception:
com.femlab.util.FlException: Format of data file is not correct
Messages:
Format of data file is not correct
Stack trace:
at com.femlab.api.server.InterpElem.a(Unknown Source)
at com.femlab.api.server.InterpElem.toElemSyntaxes(Unknown Source)
at com.femlab.api.server.InterpElem.toElemSyntaxes(Unknown Source)
at com.femlab.api.server.XFem.toElemSyntax(Unknown Source)
at com.femlab.commands.MeshExtendCommand.<init>(Unknown Source)
at com.femlab.util.CoreUtil.meshExtend(Unknown Source)
at com.femlab.api.client.Solver.solve(Unknown Source)
at com.femlab.api.client.SolveModel.a(Unknown Source)
at com.femlab.api.client.SolveModel.a(Unknown Source)
at com.femlab.api.client.x.a(Unknown Source)
at com.femlab.gui.FlProgressThread.run(Unknown Source)
at com.femlab.util.j.run(Unknown Source)
at com.femlab.util.ae.run(Unknown Source)
i have given it like
x y f...with x in ascending order and now the error is
Error: 9048
Format of data file is not correct.
It should contain grid and data values separated by lines starting with %
Exception:
com.femlab.util.FlException: Format of data file is not correct
Messages:
Format of data file is not correct
Stack trace:
at com.femlab.api.server.InterpElem.a(Unknown Source)
at com.femlab.api.server.InterpElem.toElemSyntaxes(Unknown Source)
at com.femlab.api.server.InterpElem.toElemSyntaxes(Unknown Source)
at com.femlab.api.server.XFem.toElemSyntax(Unknown Source)
at com.femlab.commands.MeshExtendCommand.(Unknown Source)
at com.femlab.util.CoreUtil.meshExtend(Unknown Source)
at com.femlab.api.client.Solver.solve(Unknown Source)
at com.femlab.api.client.SolveModel.a(Unknown Source)
at com.femlab.api.client.SolveModel.a(Unknown Source)
at com.femlab.api.client.x.a(Unknown Source)
at com.femlab.gui.FlProgressThread.run(Unknown Source)
at com.femlab.util.j.run(Unknown Source)
at com.femlab.util.ae.run(Unknown Source)
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2012年4月23日 GMT-4 02:58
I had a similar problem trying to input values from a Cristy and Johnson table.
Turned out my problem(I got the first error message you got) was that there was one variable with a repeated value but different function value, ie
x1 f(x1)
1 5
1 6
You might want to go through your table in matlab or excel and just check you don't have any repeated values freaking the fit program out. You may have x in ascending order but if there's a repeated y value it might screw it up.
Did you sort this out? I need to do the same thing with 2 interpolations over a phase change.
I had a similar problem trying to input values from a Cristy and Johnson table.
Turned out my problem(I got the first error message you got) was that there was one variable with a repeated value but different function value, ie
x1 f(x1)
1 5
1 6
You might want to go through your table in matlab or excel and just check you don't have any repeated values freaking the fit program out. You may have x in ascending order but if there's a repeated y value it might screw it up.
Did you sort this out? I need to do the same thing with 2 interpolations over a phase change.