BOverdorp

35 Reputation

One Badge

8 years, 283 days

MaplePrimes Activity


These are replies submitted by BOverdorp

@Carl Love 

Thank you for your solution, the read statement works like I want it to. However, it will not accept the restart command which is in the .mpl file. Is there a way to clear all variabeles the second time it runs the file?

@tomleslie 

I wasn't clear in my problem statement, sorry for that. However, you interpreted my question correctly.

I found another solution, (similar to yours).

restart; with(plots);
 a := -1/2; b := 1/2; c := -2; d := 2; n := 20; 
g := proc (x) options operator, arrow; value(Int(sigma(t), t = 0 .. x)) end proc; 
sigma := proc (z) options operator, arrow; 2*sqrt(2*h^2-4*z^2)*z/h^2 end proc; 
h := i/n; 
f := proc (z) if z < 0.2 then 1 elif z = 0.2 then 1 else (z+1) end if end proc
for i from 1 to n do  
an2[i] := plot(f(i/(n))*sigma(z),z=-1/(2)*h..1/(2)*h,view=[a..b,c..d], color=AQUAMARINE):
an3[i] := plot( 2*g(x),x = 0 .. (1/2)*h,view = [a .. b, c .. d], color = RED)
end do:
p := plots[display]([seq(an2[i], i = 1 .. n)], insequence = true); 
q := plots[display]([seq(an3[i], i = 1 .. n)], insequence = true); 
display(p, q)

 

@acer 

I don't quite understand your question, however, I rewrote your answer to:

plots[animate](plot, [piecewise(h > 1, tau[1], tau[2]), piecewise(h > 1, z = -(1/2)*J .. (1/2)*J, z = -(1/2)*h .. (1/2)*h), color = piecewise(h > 1, red, blue), legend = shear*stress], h = 0 .. 1+1/sqrt(3), frames = 51)

and it works! Thank you very much for your answer, I didn't know you could use piecewise like that. Moreover I didn't expect reactions so fast, thanks again. Graduation is one step closer ;)

@Kitonum 

Thanks for your reply, and yes, both b and J are specified. However, using the script you proposed, they are played simultaniously. I want them to be played successively.

for 0<h<1 plot tau[2] 

for 1<h<1+1/sqrt(3) plot tau[1]

So I want one plot with a range of 0<h<1+1/sqrt(3), which has both functions (successively). 

 

Page 1 of 1