Preben Alsholm

13728 Reputation

22 Badges

20 years, 251 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@FKil Isn't it as simple as the following or am I misunderstanding something?

sm:=Optimization:-Maximize(eval(-N/(b*h)+((-EI*(diff(u(x), x, x)))*.5)*h/(0.10e-10*Iice), F = 1), x = 0 .. l);
eq:=sm[1]*F=sigma[t];
solve(eq,F);

@acer Thanks for the explanation.
A comment:
map(eval,M+K);
does seem to evaluate all elements.

@acer Thanks for the explanation.
A comment:
map(eval,M+K);
does seem to evaluate all elements.

@Divhhh The time is given by the line integral


where s is arclength and v is velocity. From conservation of energy we have
1/2*m*v^2+m*g*y = C = 0 (if v = 0 at y = 0).
Thus v = sqrt(-2*g*y).
If the curve is given parametrically by x = x(u), y = y(u) (avoiding the use of t in order not to get confused), then ds/du = sqrt(x'(u)^2+y'(u)^2). Thus time spent on the curve (with u = 0 .. u0) is given by:

T = int( sqrt(x'(u)^2+y'(u)^2)/sqrt(-2*g*y(u)), u = 0..u0).
In Maple:

restart;
a := 1; b := -1:
g := 9.81:
eq1 := r*(u-sin(u)) = a; eq2 := r*(cos(u)-1) = b;
sol := fsolve({eq1, eq2}, {r, u});
r0,u0:=op(subs(sol,[r,u]));
x := u->r0*(u-sin(u));
y := u->r0*(cos(u)-1);
plot([x(u),y(u),u=0..u0]);
Int(sqrt(diff(x(u),u)^2+diff(y(u),u)^2)/sqrt(-2*g*y(u)),u=0..u0);
evalf(%);

@Divhhh The time is given by the line integral


where s is arclength and v is velocity. From conservation of energy we have
1/2*m*v^2+m*g*y = C = 0 (if v = 0 at y = 0).
Thus v = sqrt(-2*g*y).
If the curve is given parametrically by x = x(u), y = y(u) (avoiding the use of t in order not to get confused), then ds/du = sqrt(x'(u)^2+y'(u)^2). Thus time spent on the curve (with u = 0 .. u0) is given by:

T = int( sqrt(x'(u)^2+y'(u)^2)/sqrt(-2*g*y(u)), u = 0..u0).
In Maple:

restart;
a := 1; b := -1:
g := 9.81:
eq1 := r*(u-sin(u)) = a; eq2 := r*(cos(u)-1) = b;
sol := fsolve({eq1, eq2}, {r, u});
r0,u0:=op(subs(sol,[r,u]));
x := u->r0*(u-sin(u));
y := u->r0*(cos(u)-1);
plot([x(u),y(u),u=0..u0]);
Int(sqrt(diff(x(u),u)^2+diff(y(u),u)^2)/sqrt(-2*g*y(u)),u=0..u0);
evalf(%);

A change of variable works for both:

G:=Int(x*exp(-x)*exp(-exp(-x)), x = -infinity .. infinity);
IntegrationTools:-Change(G,{x=-ln(u)});
value(%);
V:=Int((x-gamma)^2*exp(-x)*exp(-exp(-x)), x = -infinity .. infinity);
IntegrationTools:-Change(V,{x=-ln(u)});
value(%);


It might help to see my answer to your previous question "Get derivative":

http://www.mapleprimes.com/questions/146447-Get--Derivative

Correct, it doesn't. Not all integrals can be expressed in analytical form. This may be one of very many.

@geri23 You forgot part of the code.
After the assignment to res I had the lines (see above):
sol:=subs(res,[T1(t),T2(t)]);
plot(sol,t=0..10,10..20);
#Numerical solution:
resnum:=dsolve(sys,numeric);
plots:-odeplot(resnum,[[t,T1(t)],[t,T2(t)]],0..10);

@geri23 Did you execute my code exactly as written and did it not work? (Copy the entire code into a fresh worksheet).
And didn't you get graphs in both the analytical and the numeric case?

@geri23 Analytical and numerical solutions for a specific example:

restart;
eq1:=C1*diff(T1(t),t)=U12*(T2(t)-T1(t))+U13*(T3(t)-T1(t))+H1(t);
eq2:=C2*diff(T2(t),t)=U21*(T1(t)-T2(t))+U23*(T3(t)-T2(t))+H2(t);
ics:=T1(0)=Ta, T2(0)=Tb;
#The specific example:
params:={C1=25,C2=25,U12=40,U21=40,U13=20,U23=20,Ta=20,Tb=10,H1=(t->600), H2=(t->300),T3=(t->-5)};
#You can make H1, H2, T3 more interesting by making them not constant, e.g. making them periodic functions with period 24 hours. You need to think about what your unit of time is (second, minute, hour or what).
#The concrete system including initial conditions:
sys:=eval({eq1,eq2, ics},params);
#Analytical solution:
res:=dsolve(sys);
sol:=subs(res,[T1(t),T2(t)]);
plot(sol,t=0..10,10..20);
#Numerical solution:
resnum:=dsolve(sys,numeric);
plots:-odeplot(resnum,[[t,T1(t)],[t,T2(t)]],0..10);

@geri23 The syntax is wrong. Assuming that all the constants are known and the outside temperature T3(t) is known as a function of time (may vary according to time of day) the following will work:

eq1:=C1*diff(T1(t),t)=U12*(T2(t)-T1(t))+U13*(T3(t)-T1(t))+H1(t);
eq2:=C2*diff(T2(t),t)=U21*(T1(t)-T2(t))+U23*(T3(t)-T2(t))+H2(t);
ics:=T1(0)=Ta, T2(0)=Tb;
res:=dsolve({eq1,eq2, ics});

We need to see the set of ODEs.

@geri23 From your description it seems to me that the system would be something like:

C1*diff(T1(t),t)=U12*(T2(t) -T1(t))+ U01*(Tout -T1(t))+ H1(t);
C2*diff(T2(t),t)=U12*(T1(t) -T2(t))+ U02*(Tout -T2(t))+H2(t);


where Tout is the outside temperature and the constants Uij > 0, Ci > 0. You didn't say what H1(t) or H2(t) were, but they must be heating sources inside the two rooms. In order to solve the system, you need information about those:  Are they in fact known constants?
To solve the system you need the initial values of T1 and T2.
dsolve should be able to solve this linear system with no problem (certainly no problem if H1 and H2 are constants).

@Kivo69 The integral in this problem won't go away by differentiation.
Maybe replacing the integrand with a series expansion about xi would at least initially be interesting:

IntegrationTools:-GetIntegrand(eq3);
series(%,zeta=xi,2);
convert(%,polynom);
Int(%,zeta=0..1);
value(%);
eq3a:=evalindets(eq3,specfunc(anything,Int),x->u);
#I haven't had time to look further


First 174 175 176 177 178 179 180 Last Page 176 of 230