Effacer les filtres
Effacer les filtres

How do I combnine a plot of a colored velocity field in my FEM solution?

2 vues (au cours des 30 derniers jours)
Christoffer Eriksson
Christoffer Eriksson le 13 Juin 2017
Hi! I am trying to plot my FEM solution U of size Nx1 and in the plot I want to include the convective field I use with colored arrows corresponding to the magnitude of the flow.
Can anyone help me with this?
Best, Christoffer

Réponses (1)

Dimitris Iliou
Dimitris Iliou le 15 Juin 2017
Assuming that you have a similar workflow to the following example:
the results are plotted on a figure, which means that you can actually use the figure handle to plot the arrows on top of your solution.
For example, if you run the above example in Simulink and you use the plot extension link, a new figure window will be created.
Then, by running a script like:
[x,y] = meshgrid(0:0.02:0.2,0:0.02:0.2);
u = cos(x).*y;
v = sin(x).*y;
figure(gcf)
subplot(2,1,1)
hold on
quiver(x,y,u,v)
you should be able to overlay the quiver plot on top of the Solenoid Extension subplot.
You could use a similar workflow, to overlay the convective field you use on top of the FEM solution.

Catégories

En savoir plus sur Vector Fields dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by