C_R

1960 Reputation

19 Badges

5 years, 279 days

MaplePrimes Activity


These are questions asked by C_R

I am looking for something like that but in 3d.

My question is twofold:

- What, in general, are "good" ways to do this? I am surprised that I haven't found anything better than the Boing Ball. Patterns of billard balls might be an alternative if the balls are well oriented at the start of an animation/simulation.

- How can spheres be patterned in Maple? I looked at: plots,obsolete,sphereplot(deprecated), plottools,sphere, and plots,conformal and MaplePrimes for examples but did not find anything to build on. 

Patterns that might not be too complicated to implement:

  • globe with meridians and chessboard pattern,
  • ball with a punched belt,
  • ball with 2 or 3 crossed belts
  • ...

Any thoughts on this topic?

Update: Change of orientation of the angular velocity while the sphere is spinning is an important visualisation aspect. I added this to the title.

I was about to update an older discussion with the information that the context pannel now contains an entry "Normalized Expanded".

I only remember that I was participating with another user.

So, I tried C_R AND other_user in the search field. This gives an error.

A space as an implict AND operator does also not work.

Example: Exanding the left hand side below to the right hand side

Unit('kg'*'m'/'s'^2) = Unit('kg')*Unit('m')/Unit('s')^2;

Such functionality would be useful for manipulating rational functions whose coefficients have units that can otherwise only be simplified by substituting new dimensionless independent variables as dicussed here.

Is there statement that can be mapped over an expression that identifies all subsexpressions with units and expands them to a products of units?

Probably not possible but also desireable: A variant that expands derived physical quantities to a product of base units as for example Newton to base units: Unit('N') = Unit('kg')*Unit('m')/Unit('s')^2;

Unit('N') = Unit('kg')*Unit('m')/Unit('s')^2;

Edit: Example from the link above on Unit expressions with compound units

``

Example that cannot be simplified

H(s) = 60.*Unit('m'*'kg'/('s'^2*'A'))/(.70805*s^2*Unit('kg'^2*'m'^2/('s'^3*'A'^2))+144.*s*Unit('kg'^2*'m'^2/('s'^4*'A'^2))+0.3675e-4*s^3*Unit('kg'^2*'m'^2/('s'^2*'A'^2)))

H(s) = 60.*Units:-Unit(m*kg/(s^2*A))/(.70805*s^2*Units:-Unit(kg^2*m^2/(s^3*A^2))+144.*s*Units:-Unit(kg^2*m^2/(s^4*A^2))+0.3675e-4*s^3*Units:-Unit(kg^2*m^2/(s^2*A^2)))

(1)

simplify(%)

H(s) = 60.*Units:-Unit(m*kg/(s^2*A))/(.70805*s^2*Units:-Unit(kg^2*m^2/(s^3*A^2))+144.*s*Units:-Unit(kg^2*m^2/(s^4*A^2))+0.3675e-4*s^3*Units:-Unit(kg^2*m^2/(s^2*A^2)))

(2)

After expansion of Unit expression (here done by hand) simplifcationis possible with other Maple commands

H(s) = 60.*Unit('m')*Unit('kg')/((.70805*s^2*Unit('kg')^2*Unit('m')^2/(Unit('s')^3*Unit('A')^2)+144.*s*Unit('kg')^2*Unit('m')^2/(Unit('s')^4*Unit('A')^2)+0.3675e-4*s^3*Unit('kg')^2*Unit('m')^2/(Unit('s')^2*Unit('A')^2))*Unit('s')^2*Unit('A'))

H(s) = 60.*Units:-Unit(m)*Units:-Unit(kg)/((.70805*s^2*Units:-Unit(kg)^2*Units:-Unit(m)^2/(Units:-Unit(s)^3*Units:-Unit(A)^2)+144.*s*Units:-Unit(kg)^2*Units:-Unit(m)^2/(Units:-Unit(s)^4*Units:-Unit(A)^2)+0.3675e-4*s^3*Units:-Unit(kg)^2*Units:-Unit(m)^2/(Units:-Unit(s)^2*Units:-Unit(A)^2))*Units:-Unit(s)^2*Units:-Unit(A))

(3)

factor(H(s) = 60.*Units:-Unit(m)*Units:-Unit(kg)/((.70805*s^2*Units:-Unit(kg)^2*Units:-Unit(m)^2/(Units:-Unit(s)^3*Units:-Unit(A)^2)+144.*s*Units:-Unit(kg)^2*Units:-Unit(m)^2/(Units:-Unit(s)^4*Units:-Unit(A)^2)+0.3675e-4*s^3*Units:-Unit(kg)^2*Units:-Unit(m)^2/(Units:-Unit(s)^2*Units:-Unit(A)^2))*Units:-Unit(s)^2*Units:-Unit(A)))

H(s) = 1632653.061*Units:-Unit(s)^2*Units:-Unit(A)/(Units:-Unit(m)*Units:-Unit(kg)*s*(19266.66666*s*Units:-Unit(s)+3918367.346+.9999999999*s^2*Units:-Unit(s)^2))

(4)

normal(H(s) = 60.*Units:-Unit(m)*Units:-Unit(kg)/((.70805*s^2*Units:-Unit(kg)^2*Units:-Unit(m)^2/(Units:-Unit(s)^3*Units:-Unit(A)^2)+144.*s*Units:-Unit(kg)^2*Units:-Unit(m)^2/(Units:-Unit(s)^4*Units:-Unit(A)^2)+0.3675e-4*s^3*Units:-Unit(kg)^2*Units:-Unit(m)^2/(Units:-Unit(s)^2*Units:-Unit(A)^2))*Units:-Unit(s)^2*Units:-Unit(A)))

H(s) = 60.*Units:-Unit(s)^2*Units:-Unit(A)/(Units:-Unit(m)*Units:-Unit(kg)*s*(.70805*s*Units:-Unit(s)+144.+0.3675e-4*s^2*Units:-Unit(s)^2))

(5)

Normalization to a dimensionless equation expression (that still has units) by a scaling factor with units

Sc := Unit('s')^3*Unit('A')/(Unit('m')*Unit('kg'))

Units:-Unit(s)^3*Units:-Unit(A)/(Units:-Unit(m)*Units:-Unit(kg))

(6)

(H(s) = 60.*Units[Unit](s)^2*Units[Unit](A)/(Units[Unit](m)*Units[Unit](kg)*s*(.70805*s*Units[Unit](s)+144.+0.3675e-4*s^2*Units[Unit](s)^2)))*(1/Sc)

Units:-Unit(m)*Units:-Unit(kg)*H(s)/(Units:-Unit(s)^3*Units:-Unit(A)) = 60./(Units:-Unit(s)*s*(.70805*s*Units:-Unit(s)+144.+0.3675e-4*s^2*Units:-Unit(s)^2))

(7)

Rewriting the left hand side

(proc (x) options operator, arrow; x = convert(x, units, m/V) end proc)(Sc)

Units:-Unit(s)^3*Units:-Unit(A)/(Units:-Unit(m)*Units:-Unit(kg)) = Units:-Unit(m/V)

(8)

isolate(Units[Unit](s)^3*Units[Unit](A)/(Units[Unit](m)*Units[Unit](kg)) = Units[Unit](m/V), Unit('m'))

Units:-Unit(m) = Units:-Unit(s)^3*Units:-Unit(A)/(Units:-Unit(m/V)*Units:-Unit(kg))

(9)

subs(Units[Unit](m) = Units[Unit](s)^3*Units[Unit](A)/(Units[Unit](m/V)*Units[Unit](kg)), Units[Unit](m)*Units[Unit](kg)*H(s)/(Units[Unit](s)^3*Units[Unit](A)) = 60./(Units[Unit](s)*s*(.70805*s*Units[Unit](s)+144.+0.3675e-4*s^2*Units[Unit](s)^2)))

H(s)/Units:-Unit(m/V) = 60./(Units:-Unit(s)*s*(.70805*s*Units:-Unit(s)+144.+0.3675e-4*s^2*Units:-Unit(s)^2))

(10)

Magnitude plot

abs(H(s)/Units[Unit](m/V) = 60./(Units[Unit](s)*s*(.70805*s*Units[Unit](s)+144.+0.3675e-4*s^2*Units[Unit](s)^2)))

abs(H(s))/Units:-Unit(m/V) = 60./(Units:-Unit(s)*abs(s*(.70805*s*Units:-Unit(s)+144.+0.3675e-4*s^2*Units:-Unit(s)^2)))

(11)

H(s) = H(f), s = I*omega, omega = 2*Pi*f

H(s) = H(f), s = I*omega, omega = 2*Pi*f

(12)

subs(H(s) = H(f), s = I*omega, omega = 2*Pi*f, abs(H(s))/Units[Unit](m/V) = 60./(Units[Unit](s)*abs(s*(.70805*s*Units[Unit](s)+144.+0.3675e-4*s^2*Units[Unit](s)^2))))

abs(H(f))/Units:-Unit(m/V) = 60./(Units:-Unit(s)*abs((2*I)*Pi*f*((4.448809357*I)*f*Units:-Unit(s)+144.-0.14700e-3*Pi^2*f^2*Units:-Unit(s)^2)))

(13)

plot(rhs(abs(H(f))/Units[Unit](m/V) = 60./(Units[Unit](s)*abs((2*I)*Pi*f*((4.448809357*I)*f*Units[Unit](s)+144.-0.14700e-3*Pi^2*f^2*Units[Unit](s)^2)))), f = 0*Unit('Hz') .. 10*Unit('Hz'), labels = [f/Unit('Hz'), lhs(abs(H(f))/Units[Unit](m/V) = 60./(Units[Unit](s)*abs((2*I)*Pi*f*((4.448809357*I)*f*Units[Unit](s)+144.-0.14700e-3*Pi^2*f^2*Units[Unit](s)^2))))])

 

 


Download Expansion_of_Unit_command_and_simplification_to_m_per_V.mw

The attached integral is plotted quite quickly, but the search for the maximum and for the inverses of function values takes time. Can the search be accelerated or is the integrand simply too complicated?

Int(22.89730452*exp(-3.373250126*10^6*x^2)*sqrt(2)*(erf(1298.701299*sqrt(2)*(sqrt(2.500000000*10^(-7)-x^2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*sqrt(2)*(sqrt(2.500000000*10^(-7)-x^2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3, method = _d01ajc)

Int(22.89730452*exp(-3373250.126*x^2)*2^(1/2)*(erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3, method = _d01ajc)

(1)

plot(Int(22.89730452*exp(-3373250.126*x^2)*2^(1/2)*(erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3, method = _d01ajc), y = 0 .. .25)

 

unapply(int(op(1 .. 2, Int(22.89730452*exp(-3373250.126*x^2)*2^(1/2)*(erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3, method = _d01ajc))), y)

proc (y) options operator, arrow; int(22.89730452*exp(-3373250.126*x^2)*2^(1/2)*(erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3) end proc

(2)

CodeTools:-Usage(Optimization:-Maximize(proc (y) options operator, arrow; int(22.89730452*exp(-3373250.126*(x^2))*(2^(1/2))*(erf(1298.701299*(2^(1/2))*((0.2500000000e-6-x^2)^(1/2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*(2^(1/2))*((0.2500000000e-6-x^2)^(1/2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3) end proc, 0 .. .15))

[HFloat(0.0356073228322897), Vector[column](%id = 36893490875463313756)]

(3)

CodeTools:-Usage(fsolve((proc (y) options operator, arrow; int(22.89730452*exp(-3373250.126*(x^2))*(2^(1/2))*(erf(1298.701299*(2^(1/2))*((0.2500000000e-6-x^2)^(1/2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*(2^(1/2))*((0.2500000000e-6-x^2)^(1/2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3) end proc)-0.5e-2, 0 .. .15, maxsols = 2, method = subdivide))

0.2456248637e-1, 0.9863751363e-1

(4)

Download slow_maximize_and_fsolve.mw

Here is the layout challenge: Whenever the value of a physical quantity is one as in

mass = 1* Unit('kg')

automatic simplification removes the one and the output displays

Desired would be which reads better (in particular when used inline in text passages).

Using the Empty Symbol

mass = ``(1)*Unit('kg')

an expression with parenthesis is obtained (that can be removed in subsequent calculations with the expand command) which looks worse than my current workaround of using floats

(Introducing floats in expressions is not always acceptable)
So the idea would be to use the empty symbol for initial parameter definition in textbook style layout and remove it with expand in subsequent calculations.

Any other symbol that prints as "1" that can be removed in later calculations by Maple commands is welcome as well. It should be better than

mass=`#mrow(mo("1"));`*Unit('kg');
subs(`#mrow(mo("1"));` = 1, %);

 

1 2 3 4 5 6 7 Last Page 3 of 24