Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #7607 > unrolled thread
| Started by | Alexei Boulbitch <Alexei.Boulbitch@iee.lu> |
|---|---|
| First post | 2012-01-06 09:19 +0000 |
| Last post | 2012-01-06 09:19 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: How to plot divergence of gradient as contour plot Alexei Boulbitch <Alexei.Boulbitch@iee.lu> - 2012-01-06 09:19 +0000
| From | Alexei Boulbitch <Alexei.Boulbitch@iee.lu> |
|---|---|
| Date | 2012-01-06 09:19 +0000 |
| Subject | Re: How to plot divergence of gradient as contour plot |
| Message-ID | <je6ea9$q9b$1@smc.vnet.net> |
Hi, Szymon,
In principle there is a special package, VectorAnalysis for that, but in this case it may be faster to make it "by hands". If I understand you right, you would like to make 2D vector operations. Let us first define the 2D gradient and divergence:
grad[f_] := {D[f, x], D[ f, y]};
div[{f_, g_}] := D[f, x] + D[ g, y];
and now define your function and plot. Try this:
f = div[grad[Sin[x + y]]];
ContourPlot[f, {x, -5, 5}, {y, -5, 5}]
Hope this helps. Have fun. Alexei
Hello there,
I am concerning to plot something like that.
ContourPlot[Divergence[Gradient[Sin[x + y]]], {x, -5, 5}, {y, -5, 5}]
Plotting divergence of gradient scalar field.
How can I manage to do that?
Best regards,
Szymon Roziewski
Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG
Office phone : +352-2454-2566
Office fax: +352-2454-3566
mobile phone: +49 151 52 40 66 44
e-mail: alexei.boulbitch@iee.lu<mailto:alexei.boulbitch@iee.lu>
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web