1
$\begingroup$

I would like to export to .avi the following Manipulate, but I get a strange output (Abort and black screen). Where am I wrong? The Manipulate works fine, but not the exporting. Basically, the output is a black video after a first good frame. I would also like to to make the arrow head smaller and more suitable to the plot, but didn't succeed.

 SetDirectory@NotebookDirectory[];
 epsilon0 = 1/4; 
 zeta0 = 1/4; 
 a = 1;
 b = 1; 
 omega = omeganm[1, 1] - 10^(-10); 
 T = 2 Pi/omega; 
 p0 = 10000; 
 q0 = a^2 b^2 p0/ (B h a b);
 mu = 0.3; (
 k = 7.2*10^7; 
 Erig = 200 10^9; 
 rho = 7800; 
 h = 5*10^-3; 
 B = Erig h^3 /(12 (1 - mu^2)); 
 tau = (rho h a^2 b^2/B)^(1/4);
 alpha = (k/B  a^2 b^2 /4)^(1/4);
 delta = (a^2/b^2);
 omeganm[n_, m_] = Sqrt[Pi^4/tau^4 ((Sqrt[delta] n^2 + m^2/Sqrt[delta])^2 + 4 
 alpha^4/ Pi^4)];
 fnm =  Table[omeganm[n, m]/(2*Pi), {n, 1, 10}, {m, 1, 10}]
 omega11 = omeganm[1, 1] - 10^(-10); 
 T11 = 2 Pi/omega11; 

 etaSerie11a[epsilon_, zeta_, t_] := 
 Sum[2 q0 Sin[
 n Pi 1/2] Sin[
  m Pi 1/2]/(a b tau^4 ((omeganm[n, m] )^2 - omega11^2)) (- 
     omega11/(omeganm[n, m]) Sin[(omeganm[n, m] ) t] + 
  Sin[omega11 t]) (2 Sin[n Pi zeta] Sin[m Pi epsilon]), {n, 1, 
5}, {m, 1, 5}];

Manipulate[
Show[Plot3D[
etaSerie11a[epsilon, zeta, 
 t]/(etaSerie11a[1/2, 1/2, T11/2]), {epsilon, 0, 1}, {zeta, 0, 1},
PlotRange -> {All, All, {-10, 10}}, 
AxesLabel -> {"\[Epsilon]", "\[Zeta]", "z"}, 
PlotLabel -> 
"Plate response (normalized) to a sinusoidal centered force with \
frequency f=" <> ToString[1/T11] <> "Hz", ImageSize -> Large], 
Graphics3D[{Red, Arrowheads[{Automatic, 0.001}], 
Arrow[{{1/2, 
   1/2, (Sin[omega t] 3 Max[etaSerie11a[1/2, 1/2, T11/4]])}, {1/2,
    1/2, 0}}]}]], {t, 0, 6 T11}]

 Export["forzacentro.avi", %]
$\endgroup$
1
$\begingroup$

I made some small changes in your code. I have changed the sum range because it was taking to long to export. The code below works fine, you just have to change the path in the Export function.

epsilon0 = 1/4;
zeta0 = 1/4;
a = 1;
b = 1;
omega = omeganm[1, 1] - 10^(-10);
T = 2 Pi/omega;
p0 = 10000;
q0 = a^2 b^2 p0/(B h a b);
mu = 0.3; (k = 7.2*10^7);
Erig = 200 10^9;
rho = 7800;
h = 5*10^-3;
B = Erig h^3/(12 (1 - mu^2));
tau = (rho h a^2 b^2/B)^(1/4);
alpha = (k/B a^2 b^2/4)^(1/4);
delta = (a^2/b^2);
omeganm[n_, m_] = Sqrt[Pi^4/tau^4 ((Sqrt[delta] n^2 + m^2/Sqrt[delta])^2 + 4 alpha^4/Pi^4)];
fnm = Table[omeganm[n, m]/(2*Pi), {n, 1, 10}, {m, 1, 10}] 
omega11 = omeganm[1, 1] - 10^(-10);
T11 = 2 Pi/omega11;
etaSerie11a[epsilon_, zeta_, t_] := Sum[2 q0 Sin[n Pi 1/2] Sin[m Pi 1/2]/(a b tau^4 ((omeganm[n, m])^2 -omega11^2)) (-omega11/(omeganm[n, m]) Sin[(omeganm[n, m]) t] + Sin[omega11 t]) (2 Sin[n Pi zeta] Sin[m Pi epsilon]), {n, 1, 2}, {m, 1, 2}];
    manipulate = Manipulate[Show[Plot3D[etaSerie11a[epsilon, zeta, t]/(etaSerie11a[1/2, 1/2, T11/2]), {epsilon, 0, 1}, {zeta, 0, 1}, PlotRange -> {All, All, {-10, 10}}, 
AxesLabel -> {"\[Epsilon]", "\[Zeta]", "z"}, 
PlotLabel -> 
"Plate response (normalized) to a sinusoidal centered force with \
frequency f=" <> ToString[1/T11] <> "Hz"], 
Graphics3D[{Red, Arrowheads[{Automatic, 0.001}], 
Arrow[{{1/2, 1/2, (Sin[omega t] 3 Max[etaSerie11a[1/2, 1/2, T11/4]])}, {1/2, 1/2, 0}}]}], ImageSize -> Large], {t, 0, 2 T11}] 
    Export["...\\manipulate.avi",manipulate]
$\endgroup$
  • $\begingroup$ did you change only the sum range? Was that the problem? $\endgroup$ – Andrea G Sep 5 '17 at 14:39
  • $\begingroup$ @AndreaG i changed the sum range and other small things, like the way to export. $\endgroup$ – Diogo Sep 5 '17 at 14:45
  • $\begingroup$ yes I noticed you just gave a name to the Manipulate: however, I wonder if the reason why my code didn't work was the use of % or the high number of Sum range $\endgroup$ – Andrea G Sep 5 '17 at 14:48
  • $\begingroup$ I dont belive it was because of the sum range that it was not working. It was not working because the way to export was given an error Export::errelem: The Export element GraphicsList contains a malformed data structure and could not be exported to AVI format. $\endgroup$ – Diogo Sep 5 '17 at 14:58
  • $\begingroup$ I also had the same error, but that happened when I forgot to rerun the manipulate before running Export when in Export one finds %. I am afraid you made the same mistake. However, I have tried increasing the range of Sum and indeed it seems that it goes back not to work. When the range is (1,3) for both n and m, I get a video that is good and then some frames are missing. Things get worse when the range is (1,4) and so on. Bug? $\endgroup$ – Andrea G Sep 5 '17 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.