MaplePrimes Questions

Hi,

I have a system of differential equations with boundary conditions:

diff(S(t), t) = -K(t)*S(t)/N, diff(K(t), t) = K(t)*S(t)/N, where S(T)=10, K(T)=20; If I would like to solve this system backward in time, is it right to re-write the system of original diff. equations in the following way:

diff(S(t), t) = K(t)*S(t)/N, diff(K(t), t) = -K(t)*S(t)/N and S(0)=10, K(0)=20 ( I simply changed the sign of the right hand of the equations and changed the boundary conditions to the inotoal ones).

Thanks,

Dmitry

 

 

Hi everyone,

restart:with(plots):

lambda1:=(S+sqrt(S^2+4*alpha))/(2);

lambda2:=(S-sqrt(S^2+4*alpha))/(2);

plot3d({lambda1,lambda2}, S=-10..10, alpha=-5..5, contours=50,grid=[100,100]);

plot([subs(alpha=-5,lambda1),subs(alpha=-4,lambda1),subs(alpha=-3,lambda1),subs(alpha=-2,lambda1)

,subs(alpha=-1,lambda1),subs(alpha=-0.5,lambda1),subs(alpha=0.0,lambda1),subs(alpha=0.5,lambda1)

,subs(alpha=1,lambda1),subs(alpha=2,lambda1),subs(alpha=3,lambda1),subs(alpha=4,lambda1)

,subs(alpha=5,lambda1),subs(alpha=-5,lambda2),subs(alpha=-4,lambda2),subs(alpha=-3,lambda2)

,subs(alpha=-2,lambda2),subs(alpha=-1,lambda2),subs(alpha=-0.5,lambda2),subs(alpha=0.0,lambda2)

,subs(alpha=0.5,lambda2),subs(alpha=1,lambda2),subs(alpha=2,lambda2),subs(alpha=3,lambda2)

,subs(alpha=4,lambda2),subs(alpha=5,lambda2)],S=-10...10,axes=box,color=[red,green]);

contourplot({lambda1,lambda2}, S=-10..10, alpha=-5..5, contours=50,grid=[100,100]);

 

 

How to minimize the disconnect in the 3d plot and countourplot to get a smooth plot?

 

I am trying to illustrate the chain rule for multivariet functions

 

diff(f(u(x,y),v(x,y),x)

 

The Maple responce is D1(f)(u(x,y),v(x,y)*(partial of u(x,y) wrt x) +..etc

 

I would like to replace the D- notation with the standard notation for the "partial of f wrt u" for obvious reasons - this is what students are familar with. The convert cmnd Doe Not Work in this case.

 

Similarly the cmnd diff(u(x,y),v(x,y),x,x) gives rise to D1,D11, D12 symbols which I would likee to convert to standard partial notation.

 

All this is a BIG DEAL when trying to illstrate the chain rule in Cal III.

 

Joe Salacuse

Mathematics

Kettering University

I need to get rid of the type "constant" for gamma. In Maple, gamma is defined as Euler's constant by default. While it is easy enough to unprotect(gamma) and then get rid of its value, Maple will refuse to solve an equation for gamma, as it remains of type constant even after deassigning it. So I need to regain gamma as a variable.

Some may feel this is an unwise thing to do. But it actually is not: I am writing a document involving physics, and gamma is the accepted symbol for the relativistic energy. I cannot avoid using that, lest mass confusion ensues (this involves students). I really don't want to write gammar instead. Euler's constant, otoh, does not figure at all in my document.

Note that I need a solution that works in Maple 15 and later as I am working in a heterogeneous environment as far as Maple versions are concerned.

Thanks in advance,

Mac Dude

 

Obviously, that  f:=x->x^3  is the same function as  g:=t->t^3 . But

f:= x-> x^3;  g:= t-> t^3;

is(f=g);

 

Worse yet

f:= x-> x^3;  g:= x-> x^3;

is(f=g);

When attempting to use algsubs with a subscripted expression involving powers I am running into a problem.

I have assigned a numerical value to n, and I have a symbol subscripted with n+1 and raised to a power.

In the original expression I have a factor of the form: P^q + R_n^q which I should like to replace with the symbol B.

> n:= 2

> P^q + R_(n+1)^q

> algsubs(P^q + R_(n+1)^q = B, %)

This last input leads to the error message:

Error, (in algsubs) no variables appearing rationally in pattern.

If I attempt to use algsubs on a subscripted symbol which is not raised to a power, the result works. Is there a cure?

Thanks in advance.

Find the product of the square root of all prime numbers less than 100.
Hint: The function isprime determines the primality of an integer.

Define a set with elements that are the powers of 13 modulo 100 for exponents ranging from 1 to 1000. Is 5 a member of the set? Why is it beneficial to use a set instead of a list?
Hint: You can determine the set by using one statement if you use the seq command.

Contrast the behavior of functions and expressions by performing the following commands.
a)Define a function f equal to x^3 and Define an expression g equal to x^3
b) Evaluate f and g at 2.
c) Evaluate f and g at y.
d )Assign the value 2 to x. Evaluate f and g.

Hi all,
I've got this code but the second if statement does not seem to work within the for cycle... If I write it outside the cycle it works... Can you help me with this??? 
 
Dec := {1, 4}; Var := {2, 3, 5, 6}; n[1] := 4; n[2] := 3; n[3] := 2; n[4] := 3; n[5] := 4; n[6] := 2; Ut := {1, 2, 3}; pa[2] := {1}; pa[3] := {1, 2}; pau[1] := {3}; pa[5] := {4}; pau[2] := {5}; pa[6] := {4, 5}; pau[3] := {4, 6}; J := {3, 5, 6};
m := numelems(Ut); n := numelems(`union`(Dec, Var)); j := numelems(J);

if member(n, J) then A[n] := {`union`(pa[n], `intersect`(pau[3], {n}))}; jcur := j-1 end if

for i from n-1 to 1 do if member(i, J) then A[i] := `union`(`union`(A[i+1], pa[i]), `intersect`(pau[jcur], {i})); jcur := j-1 else A[i] := `union`(A[i+1], `intersect`(pa[i], {i})) end if end do

Thanks in advance
manuele

Dear Maple enthusiasts,

I was debugging a piece of Maple code I wrote with 3 for loops in it, because Maple kept running infinitely when I executed the worksheet. I found out that in the inner most loop Maple was getting stuck on integrating a function with a discontinuity. However, at the same time I noticed another flaw, namely that it was integrating the negative part of that same function as well as the positive. I had forgotten to implement that Maple should only integrate the positive part of the function. 

So I thought the easiest way for Maple to integrate the function would be to use piecewise() to get rid of the negative part and then integrate the piecewise function. To test this, I temporarily changed the integration interval so that no discontinuity would be present. However, Maple runs for an infinite amount of time when it tries to integrate the piecewise function. Also, I still don't have a clue how to deal with the discontinuities that occur in the real integration interval (when using piecewise). 

Attached at the bottom of this message is the code taken from the inner most for loop. In italic it shows the "problem section" with the piecewise function. The plots were there to help me visualise the functions and what's happening. They'll be removed in the final code.

Can someone help me to try and get the integration of the piecewise function to work? The integration interval in the code is the real integration interval. The discontinuities occur there where peicewise makes the function zero.

Many thanks!

 

restart: with(plots): with(linalg): with(Optimization): with(ListTools):

Average percentage of sunhours per day in a certain month
Sun_jan:=0.735: Sun_feb:=0.715: Sun_mar:=0.67:
Sun_apr:=0.615: Sun_may:=0.64: Sun_jun:=0.56:
Sun_jul:=0.43: Sun_aug:=0.37: Sun_sep:=0.43:
Sun_oct:=0.715: Sun_nov:=0.81: Sun_dec:=0.74:

Constants
I_sc:=1367.7:
H:= 150:
t_D:=0:
lat:=evalf((9+24/60+27/3600)*Pi/180):
lon:=evalf((51/60+12/3600)*Pi/180):
LC:=evalf((lon*180/Pi-0)/15):
alfa_alt:=evalf(-0.83*Pi/180):

H_zeni:=1.2:
H_azi:=3.6:
N:=116:

E_year:=0:

Initialise all necessary collector and radiation variables

I_o:=evalf(I_sc*(1+0.0333*cos((2*Pi*N)/365))):
delta:=evalf(arcsin(0.39795*cos(0.98563*(N-173)*Pi/180))):
x_input:=(2*Pi*(N-1))/365.242:
EOT:=x->evalf(0.258*cos(x)-7.416*sin(x)-3.648*cos(2*x)-9.228*sin(2*x)):
ts_input:=t->t+EOT(x_input)/60-LC-t_D:
omega:=ts->15*(ts-12)*Pi/180:
omega_set:=evalf((arccos((sin(alfa_alt)-sin(lat)*sin(delta))/(cos(lat)*cos(delta))))):
ts_rise:=evalf(-(omega_set*180/Pi)/15+12):
ts_set:=evalf((omega_set*180/Pi)/15+12):
t_rise:=ts_rise-EOT(x_input)/60+LC+t_D:
t_set:=ts_set-EOT(x_input)/60+LC+t_D:
t_noon:=12-EOT(x_input)/60+LC+t_D:
alfa_elev:=omega->evalf(arcsin(sin(delta)*sin(lat)+cos(delta)*cos(lat)*cos(omega))):
theta:=alfa_elev->Pi/2-alfa_elev:
alfa_azitest:=evalf(arccos((sin(delta)*cos(lat)-cos(delta)*cos(omega(ts_input(t)))*sin(lat))/cos(alfa_elev(omega(ts_input(t)))))):

Calculate direct and normal intensity I with mathematical model on time t of day N

a_0:=0.4237-0.00821*(6-H*0.001)^2:
a_1:=0.5055+0.00595*(6.5-H*0.001)^2:
k_HCDmod:=0.2711+0.01858*(2.5-H*0.001)^2:
I_HCDmod:=theta->I_o*(0.95*a_0+0.98*a_1*exp(-(1.02*k_HCDmod)/cos(theta))):

theta_noon:=evalf(theta(alfa_elev(0))):
I_noon:=evalf(I_HCDmod(theta_noon))*3600: Zet I om van W/m² naar J/(m².uur) voor toekomstige integratie
I_HSmod:=evalf(I_noon*sin(((t-t_rise)*Pi)/(t_set-t_rise)));

Calculate the real radiation energy on the collector for a whole clear day N per (m²)

RF_morning:=evalf(sin(alfa_elev(omega(ts_input(t))))*cos(H_zeni)+cos(alfa_elev(omega(ts_input(t))))*sin(H_zeni)*cos(H_azi-alfa_azitest));
plot(RF_morning,t=t_rise-1..t_noon);

RF_afternoon:=evalf((sin(alfa_elev(omega(ts_input(t))))*cos(H_zeni)+cos(alfa_elev(omega(ts_input(t))))*sin(H_zeni)*cos(H_azi-(2*Pi-alfa_azitest))));
plot(RF_afternoon(t),t=t_noon..t_set+1);

I_real:=piecewise(RF_morning>=0 and I_HSmod>=0 and t<=t_noon,RF_morning*I_HSmod,RF_afternoon>=0 and I_HSmod>=0 and t>t_noon,RF_afternoon*I_HSmod);
plot(I_real,t=t_rise-1..t_set+1);

E_clear:=int(I_real,t=t_rise..t_set,numeric=true);

Apply the average sunhours per day to the radiation energy to go get the real I for an average day (same percentage per hour)

if N<=31 then E_av:=E_clear*Sun_jan elif (N>31 and N <=59) then E_av:=E_clear*Sun_feb
elif (N>59 and N <=90) then E_av:=E_clear*Sun_mar elif (N>90 and N <=120) then E_av:=E_clear*Sun_apr
elif (N>120 and N <=151) then E_av:=E_clear*Sun_may elif (N>151 and N <=181) then E_av:=E_clear*Sun_jun
elif (N>181 and N <=212) then E_av:=E_clear*Sun_jul elif (N>212 and N <=243) then E_av:=E_clear*Sun_aug
elif (N>243 and N <=273) then E_av:=E_clear*Sun_sep elif (N>273 and N <=304) then E_av:=E_clear*Sun_oct
elif (N>304 and N <=334) then E_av:=E_clear*Sun_nov elif (N>334 and N <=365) then E_av:=E_clear*Sun_dec end if:

E_av;

ProjOfEigenVector := MatrixMatrixMultiply(BeProjected, (Transpose(OrthoBasis).MatrixInverse(MatrixMatrixMultiply(OrthoBasis, Transpose(OrthoBasis)), method = pseudo).OrthoBasis));

i use definition of this 

# P=(A*B’).inv(B*B’).B

#P=A*(B’).inv(B*B’).B)

however, no matter whatever matrix A pass into this equation in order to project onto B,

it still return the original matrix A

how can this definition be used to project a matrix onto another matrix?

how to correctly to project a matrix onto another matrix

I have an Array that has both floats and pi and e expressions mixed in.  Would like to scan the Array and print the non-floats to the screen.

My if then statement works until I put it into a loop then I get no output.  Puzzled...

> hits := identify(d);
> for i from 1 to 501 do if type(Hits[i], 'float') = false then Hits[i] end if end do;

Hi there,
i am currently using maple5 as a new student in mathematics in the university. I am trying to know how to use maple5 to programme finding roots of quadratic equation. can anyone point me in the right direction?? Perhaps a book or a website on maple5. I know its old version but that's what we are allowed to use in my university and i'm new to this. Thanks

I'm trying to create a small app for Maple Player to graph solids of revolution. When I run the app in the desktop version of Maple T.A it works, but when I move it into the Maple Player App it crashes. Any ideas?

First 1471 1472 1473 1474 1475 1476 1477 Last Page 1473 of 2429