Quantcast
Channel: parametric sweep, parametric-sweep - Latest Discussions - COMSOL Forums
Viewing all 51 articles
Browse latest View live

Parametric Sweep over parameter dependent range

$
0
0
Hello All,

I am new to COMSOL and need some help. I believe this is a simple issue but I can not seem to fix it. I am trying to do a parametric sweep over two variables X and Y. I am seeing X to be range(1,10,100). I would like to set Y to be a function of X such that for Y I have: range(a*X+b, (c-b)/5, a*X+c) where (c-b)/5 just allows for a fixed number of measurements between the end points.

When I use this it does not seem to update the new Y values for each new X, any ideas?

Kind Regards,
Jack

Variable Dependent Parametric Sweep

$
0
0
Hello Everyone,

I have been stuck with this issue for sometime now and cannot seem to find a way around it! I am trying to run a parametric sweep over two variables (e.g X and Y). I have defined X to have the range: range(1,1,10). I would like to define the Y range in terms of the current X value such as:

range(0.1*X,0.1,0.5*X)

This is only a simplified version of the dependency I would like to use as I thought a clearer model would be easier to explain. The actual section of my script is:

model.study('std1').create('batsw', 'BatchSweep');
model.study('std1').feature('batsw').label('Batch Sweep - JACK');
model.study('std1').feature('batsw').set('sweeptype', 'filled');
model.study('std1').feature('batsw').setIndex('pname', 'L', 0);
model.study('std1').feature('batsw').setIndex('plistarr', '', 0);
model.study('std1').feature('batsw').setIndex('punit', 'mm', 0);
%model.study('std1').feature('batsw').setIndex('pname', 'L', 0);
%model.study('std1').feature('batsw').setIndex('plistarr', '', 0);
%model.study('std1').feature('batsw').setIndex('punit', '', 0);
model.study('std1').feature('batsw').setIndex('plistarr', 'range(L_min,L_step,L_max)', 0);
model.study('std1').feature('batsw').setIndex('pname', 'D', 1);
model.study('std1').feature('batsw').setIndex('plistarr', '', 1);
model.study('std1').feature('batsw').setIndex('punit', 'mm', 1);
%model.study('std1').feature('batsw').setIndex('pname', 'D', 1);
%model.study('std1').feature('batsw').setIndex('plistarr', '', 1);
%model.study('std1').feature('batsw').setIndex('punit', '', 1);

model.study('std1').feature('batsw').setIndex('plistarr', 'range(0.1*L,0.01,0.5*L)' , 1 ) ; % This is the line!!

model.study('std1').feature('batsw').set('useaccumtable', 'off');
model.study('std1').feature('batsw').set('maxallow', '6');
model.study('std1').feature('batsw').set('synchsolutions', 'on');

Export to file node in parametric sweep

$
0
0
Dear all,

I'm investigating eigenfrequencies of a plate with different properties using a parametric sweep. However, I have difficulties exporting the data for post-processing. Currently, I use the export to file node nested in the parametric sweep. The problem is the exported data only picks the number of modes calculated in the first solution (while all modes are calculated). For example, when the first solution has 2 eigenfrequencies, the data exports also only the first two eigenfrequencies for every parametric solutions, while in my case more eigenfrequencies are present at further parametric solutions.

Any suggestions on how to export all data (to matlab), either with the export to file node or any other method?

Thanks in advance,
Dennis


Extra information: I'm using the export to file node because the parametric investigation takes some time and I would like to run it at night. I do not use the accumulated probe table since this method seemed to take 15-30 minutes to export to a file after each loop (21 x 16 point probe grid with 2 expressions), while export data does this almost instantly. Sadly, the classkit license I work with does not have the Livelink for matlab.

EDIT (28-07-2015): It seems manually inputting the parameter range from highest to lowest gives all solutions in this case. However, this seems clumsy, since you don't know which parameter value gives the most solutions (although you can predict this usually).

distribution of resistance through a wire

$
0
0
Hello everyone
I have run a simulation for calculating the resistance of a piece of wire using EC physics . however the resulted plot shows the distribution of voltage over the wire. I changed the Expression into V/sqrt(ec.Jix*ec.Jix+ec.Jiy*ec.Jiy+ec.Jiz*ec.Jiz), so that I get the distribution of the resistance and also I calculated the resistance using this term and over a surface integration.
As I calculated the value of resistance over different wire sizes (a parametric sweep), I'd like to use the player option to show the resistance distribution through various sizes.
now the problem is, when I click on play I only get the potential distribution, not the resistance (V/sqrt(ec.Jix*ec.Jix+ec.Jiy*ec.Jiy+ec.Jiz*ec.Jiz)).
could anyone help me, how can I relate them all together??

Regards

Parametric sweep and geometry change

$
0
0
a,b,theta_a and theta_b are global geometry parameters. theta_a = 2/a, and theta_b = 2/b. a,b,theta_a, and theta_b are all used in geometry creation.

I am running a parametric sweep for parameters a and b. When I do this the geometry that is created is not correct. The geometry created for each pair of a and b reflect the change in a and b but does not calculate a new theta_a and a new theta_b. Hence my geometry looks weird.

Any help will be greatly appreciated.

Combining parametric and auxiliary sweep

$
0
0
Hello everybody,

I am having some troubles with a quite simple simulation.

I must simulate the behaviour of a thin membrane which is stretched by means of a displacement applied to one of its ends. I would like to sweep increasing values of the applied displacement (let's say, from 0 to 2 mm with a step of 0.2 mm) but I also have to evaluate the influence of geometric parameters (such as the thickness of the membrane, and the dimensions of some other features on it) on the results.

I know that a sweep involving changes in the geometry requires a Parametric Sweep, but to improve the convergence of the simulation I would like to set a "continuation solver" for the displacement parameter. As far as I have understood, the continuation solver can be used only with an Auxiliary Sweep.

Therefore, I would like to know if it possible to combine a Parametric sweep (concerning the geometric parameters) with an auxiliary one (containing the displacement only), or if there is any other way to efficiently tackle this problem. All my attempts have failed (I have tried to put all the parameters in the auxilary sweep, setting the continuation for the displacement, but it did not work since the geometry is actually always the same).

I thank you in advance for your help.

Alberto

How to sweep through different boundary conditions using parametric solver

$
0
0
Hi,

I am investigating the current distribution in water, it requires me to send a voltage into a medium (water) through an electrode and measure through another electrode.
My problem is how to change the boundary condition (i.e. Electric Potential) using parametric sweep. I have tried using using the tag ({pot1}) to reference the parameter names in parametric sweep and using the selections within the parameter value list (grouped the boundary condition using Explicit (Definitions)).

Many thanks,
A.Onilude

Boundary Integration in a Parametric Sweep

$
0
0
Hey all,

I am running a parametric sweep solver across several values for a single constant and I need to be able to output the total force per area on a circle composed of 4 boundaries for each iteration (a boundary integration). My understanding is that the parametric solver by default evaluates global variables (so what I am getting currently is the force per area summed up for all points in the geometry). Is there a syntax (or perhaps a .m file edit) for specifying the parametric solver to integrate the total force per area across those 4 boundaries for each iteration (and output it to a .txt file)?

Thank you!

Cheers,
Gar Waterman
Bucknell University - Biomedical Engineering '11

parametric sweep (old issue, new problem)

$
0
0
Hi all,

I know this issue has been mentioned a few times on the forum, but each one refers to a slightly different aspect and none of them explains the problems I am facing.

The idea is simple - I have got a 2D axysymmetric model and want to run it with a parameter subject to parametric sweep. Problem is it seems that the only thing COMSOL lets me do is see the results for different values of the altered parameter only on a single 3D plot and NONE of the 1D plots I am interested in (only for 3D I get the drop down menu).

So can someone please tell me how to see 1D point graphs for different values of parameter which was altered via parametric sweep and secondly - how to plot them on a single graph? I know I can do it exporting the data, but this will be quite time-consuming and I would expect such functionality to be included in the COMSOL 4.2a.


Thank you in advance,
Mike

How to use parametric sweep by loading parameter values?

$
0
0
Hi,

I have several parameters to add in study settings, as below:

parameter: a1 a2 a3 a4 a5
first set: 1 3 4 5 7
second set: 2 1 3 6 4
...etc.

There are many sets, so I don't want to key in step by step.

My question is how to edit the parameter values file(*.txt form) to load into comsol model?

parametric sweep with charged particle tracing

$
0
0
Hello, i have 2 studies in my model:
1) A study that calculates electric and magnetic fields
2) A study that calculates charged particle tracing only with the fields from 1)

now i would like to parametric sweep a part of my model geometry and see how it affects particle trajectories. to do so i obviously have to create a parametric sweep in study 1) to sweep the e/m fields. this works fine.

my problem is that i dont know how to carry over the sweep of the e/m fields of 1) to the trajectories in 2). when i just create another sweep of the same kind in study 2) it is possible to watch the geometry sweep in the particle tracing plot but the trajectories do not change with the sweep because appearently the sweep of 2) does not affect the e/m fields even though it works fien in the sweep of 1).

any ideas for a parametric sweep of a particle tracing?

about parametric sweep and optimization

$
0
0
I built a reaction model, I want to know the equilibrium states of the reaction at difference concentration of one material. so I use the parametric sweep to calculate the equilibrium results.
but when I want to regress the equilibrium parameter of the reaction with experiment data.
I can't find how to use optimization tools to finish it.
could you please tell me how to use optimization with parametric sweep?
thank you,

Solver Error: Divergence cleaning failed for linear System

$
0
0
I have the following situation:
- Model with two permanent Magnets (not touching each other)
- Study with Parametric Sweep to move one magnet along the other
- After some steps of the sweep, the solver gives the following error: "Divergece cleaning failed for linear System"
- In the messages window I get for each step some warnings: "Avoided 236 inverted elements by using linear geometry shape order"

As soon as I get the solver errror, the computation is aborted. How do i resolve this issue?

Frequency domain study - changing the force on a point load with frequency

$
0
0
Hi,

I'm having some trouble finding out how to apply a frequency-dependant force.

I have a model where up until now, I've been using a non-varying force of 1N on a point load, then performing the frequency study. To validate a project I am working on, I now need this force to change at each frequency step. The value of this force is in a vector in MATLAB. What I'd like to do is export this vector in some format COMSOL can read, and then 'instruct' COMSOL to vary the force at the point load at each frequency step according to the value of this imported file.

To summarise, I have a frequency study of N steps, and a vector of N length - I want COMSOL to change the point load at X frequency to whatever the value is at X position in the force vector.

How can I achieve this?

I have looked at parametric sweeps but I can't find (or more likely understand) how I can use this to import a csv or txt file from MATLAB. Also, I am under the impression that by using a parametric sweep I would end up with N * N results as COMSOL would run the full frequency study for each value of the parameter I specify. This is entirely undesirable as I can see this taking a long time to process and probably even longer to extract the useful data!

Any help would be greatly appreciated. My Google-Fu has failed me and I have found nothing in the manual that covers this type of study, though I assume a frequency dependent force is not entirely unheard of for people doing acoustic studies?

Many thanks,

Myles

Interrupting Parametric sweep without loosing results

$
0
0
Hi,
i'm running a large parametric sweep which turned out to dramatically slow down during the last few combinations. My machine has been crunching for days now and i'm wondering if there's a way to interrupt the sweep without loosing the results already generated...
anybody tried that before?

thanks, martin

Parametric Sweep gives different results with separate calculations

$
0
0
Hello,

Strange things happened when I use Parametric sweep function today. Initially, I solved a model by setting a parameter as a fixed number ( say "a"). Then I swept this parameters with different values (say "a", "b" , and 'c"). Both calculations converged but when I checked the results, the one from separate calculation ("a" only), is different from the one (with same parameter value "a") obtained from parametric sweep.
I checked several times and redid the modeling for couple of times, but do know the reasons.

Someone also encountered similar problems? Which results should I trust and what might be the reason?
Please advice,
Thanks!

Parameteric vs. Batch vs. Cluster sweeps

$
0
0
Hi,

I have a time-dependent model and I would like to sweep through a range of values of one of the model parameters. The problem is an 'embarrisingly parrallel problem' and very much similar to the example given in this COMSOL blog post:

www.comsol.com/blogs/added-val...task-parallelism-batch-sweeps/

However after much reading on the support pages and in the reference manual, I am still not quite sure how COMSOL handles the various sweep study options:
1. Parametric Sweep
2. Batch Sweep
3. Cluster Sweep

I'm a bit confused because I have managed to use the Batch Sweep to solve the model on our computational cluster. So then how is a Cluster sweep different to a Batch sweep? When is it advantageous to use over the other?

Regards
Amr

Do I need to specify the unit in the parametric sweep

$
0
0
Hi

if I have a variable "a" which is specified as 4[µm] in the global parameters section and in the geometry I have specified [µm] to be the default unit. I wish to do a parametric sweep of it, but do I need to specify the [µm] there as well? like

{1, 2, 3, 4, 5, 6, 7, 8}[µm]

Or is it enough to do write

{1, 2, 3, 4, 5, 6, 7, 8}

The reason I'm asking is that I once forgot to specify the [µm] in the sweep once and it looked like the results were resonable.

Data Sets not Updating on Geometry Parametric Sweep

$
0
0
Hello,

I have a 2D-Axisymmetric model with a Cut Line data set defined by two points, each with r and z coordinates determined by two parameters such that the cut line is always a fixed distance away from an element of the geometry. I have noticed, however, that while the parameters do indeed change in a parametric sweep, the cut line's position does not. Consequently I am unable to generate the plots I need.

Is there a way to force the cut line to update on each iteration of the sweep, or some other way to get around this issue?

Thanks,
Thomas

How to generate scattered field for multiple angle of incidence ( or sum parametric sweep solutions)

$
0
0
Hi all,

i'm working on a scattering problem. I need to find the scattered field over a range of angle of incidence.
I know that i can plot the scattered field for each angle of incidence , but i want to plot the total field for all angle of incidence added together. So basically, i want to find out the total scattered field from multiple plane waves. I figured i could join the results for this parametric sweep, i could obtain the total scattered field, but i'm not sure how do to so in comsol, since i don't have a 2nd dataset. Your help is greatly appreciated!

thanks,

Yuchu
Viewing all 51 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>