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

1 回表示 (過去 30 日間)
Christoffer Eriksson
Christoffer Eriksson 2017 年 6 月 13 日
回答済み: Dimitris Iliou 2017 年 6 月 15 日
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

回答 (1 件)

Dimitris Iliou
Dimitris Iliou 2017 年 6 月 15 日
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.

カテゴリ

Help Center および File ExchangeVector Fields についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by