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

2 visualizaciones (últimos 30 días)
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

Respuestas (1)

Dimitris Iliou
Dimitris Iliou el 15 de Jun. de 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.

Categorías

Más información sobre Vector Fields en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by