C_R

3717 Reputation

21 Badges

6 years, 197 days

MaplePrimes Activity


These are answers submitted by C_R

For your example it is possible to execute a Maple command within Flow

convert(1000*Unit('Omega'), units, Unit('`kΩ`'))

To preserve the value one (i.e. "1") in front of kOhm

convert(evalf(1000*Unit('Omega')), units, Unit('`kΩ`'))

Supported prefixes can be found here.

If you execute

expr:=(c[2]+x)^3+a; 
printlevel:=100;  
simplify(expr)

you can see that simplify/size is called nummerous times but only after simplify/normal has been called which expands expr to
x^3+3*x^2*c[2]+3*x*c[2]^2+c[2]^3+a

Then simplify/size is applied

--> enter \`simplify/size\`, args = x^3+3*x^2*c[2]+3*x*c[2]^2+c[2]^3+a

So, simplify tries to reduce the size of the above expression but not of the original.

Expanding with the normal command at the toplevel of the simpify logic seems to be a design descision.

 

f(x) = 1+c__1*g(x)+c__2*g(x)^2

f(x) = 1+c__1*g(x)+c__2*g(x)^2

(1)

g(x) = A*B/x

g(x) = A*B/x

(2)

subs(g(x) = A*B/x, f(x) = 1+c__1*g(x)+c__2*g(x)^2)

f(x) = 1+c__1*A*B/x+c__2*A^2*B^2/x^2

(3)

diff(f(x) = 1+c__1*A*B/x+c__2*A^2*B^2/x^2, x)

diff(f(x), x) = -c__1*A*B/x^2-2*c__2*A^2*B^2/x^3

(4)

subs(isolate(g(x) = A*B/x, A), diff(f(x), x) = -c__1*A*B/x^2-2*c__2*A^2*B^2/x^3)

diff(f(x), x) = -c__1*g(x)/x-2*c__2*g(x)^2/x

(5)

algsubs((rhs = lhs)(g(x) = A*B/x), diff(f(x), x) = -c__1*A*B/x^2-2*c__2*A^2*B^2/x^3)

diff(f(x), x) = (-2*c__2*g(x)^2-c__1*g(x))/x

(6)

NULL


Update: As someone who has never mastered algsubs, all I can say is that (as I read the algsubs documentation) it should have worked.  Maybe someone else can say why swapping sides was needed to make it work. I would be interested to learn.

Update2: From the algsubs help page: 

The function algsubs performs an algebraic substitution, replacing occurrences of a with b in the expression f.

I.e. lhs is replaced with rhs.

Download with_and_wo_algsubs.mw

If working with equations instead of assignments to names g and f is an option you could do

g(x) = 1+c__1/x+c__2/x^2+c__3/x^3

g(x) = 1+c__1/x+c__2/x^2+c__3/x^3

(1)

f(x) = 1-1/g(x)

f(x) = 1-1/g(x)

(2)

diff(f(x) = 1-1/g(x), x)

diff(f(x), x) = (diff(g(x), x))/g(x)^2

(3)

diff(g(x) = 1+c__1/x+c__2/x^2+c__3/x^3, x)

diff(g(x), x) = -c__1/x^2-2*c__2/x^3-3*c__3/x^4

(4)

subs(diff(g(x), x) = -c__1/x^2-2*c__2/x^3-3*c__3/x^4, diff(f(x), x) = (diff(g(x), x))/g(x)^2)

diff(f(x), x) = (-c__1/x^2-2*c__2/x^3-3*c__3/x^4)/g(x)^2

(5)

NULL

Download with_eqn.mw

You could insert a table like in the attached where the borders are set to none and the width of the first row sets the indent

NULL

 

``

• 

My text

NULL

• 

 

NULL

• 

 

 

 

` `

Download Bullet.mw

I assume that "simplify" without options on this complex expression has too many cases to be examined by the underling algorithm.

Try alternatively

simplify(exprB, exp)

 

The intersection of the two expressions is a surface
 

plot3d(1/5*b^2 - 1/5*b*x - 1/5*x^2, b = -4 .. 4, x = -4 .. 4)

intersectplot plots "intersection of 2 surfaces in 3-D" which is a curve

Try this

plot3d([b, b^2/4, -b/2], b = -4 .. 4, thickness = 5, color = red, style = line)

The Custom Component Template has a section to define ports and it has a section to preview the code. To place ports, (dummy) variables for signals must be defined in the equation list "eq" of the template.

Modelica code with port definitions can be copied after previewing the code.

The latest version of the template allows some customization. There is probably no need to disassemble already existing components.

 

Not the exact desired but shorter
 

restart;

with(LinearAlgebra):

interface(imaginaryunit=j):

Amat := Matrix(2, 2, [[-0.1428571428*K__D, -0.1081971238], [376.9911185, 0]]);

Matrix(2, 2, {(1, 1) = -.1428571428*`#msub(mi("K"),mi("D",fontstyle = "normal"))`, (1, 2) = -.1081971238, (2, 1) = 376.9911185, (2, 2) = 0})

(1)

Eigenvalues(Amat);

Vector[column](%id = 18446744074196840070)

(2)

`~`[`@`(`@`(identify, expand), factor)](Vector(2, {(1) = -0.7142857140e-1*`#msub(mi("K"),mi("D",fontstyle = "normal"))`+0.2000000000e-9*sqrt(0.1275510203e18*`#msub(mi("K"),mi("D",fontstyle = "normal"))`^2-0.1019733868e22), (2) = -0.7142857140e-1*`#msub(mi("K"),mi("D",fontstyle = "normal"))`-0.2000000000e-9*sqrt(0.1275510203e18*`#msub(mi("K"),mi("D",fontstyle = "normal"))`^2-0.1019733868e22)}))

Vector[column](%id = 36893489817495032044)

(3)


 

Download Q20230110_m1_short.mw

For both expressions, when plotted separately, smartplot seems to determine the range with the criteria that values become complex. For me it looks like that assumptions are ignored.


 

smartplot(`assuming`([sqrt((1/3)*x*(2-x))], [0 <= x and x <= 1]))

 

`assuming`([smartplot(1-sqrt((-x^2+1)*(1/3)))], [0 <= x and x <= 1])

 

NULL


 

Download smartplot.mw

The main difference in your results comes from the cross section you need to rotate. I have done this in the attached document. Note that the width b is defined in the y-direction and the height in the z-direction (see the help page).  Alternatively, you can also orient the direction of gravity in the z-direction. Below you can see the effect of the elastic coordinates, which "only" contribute to 25% less deflection than expected.  

EC1 is a valuable option if you are interested in fast calculations and resonnant frequencies. In the linear case (small deflections) these are only about half of the 25% higher than expected.

Konzola-_rotated.msim

inserts a new execution group before the cursor.

For pasted text you could try F3 to split the text at the postition of the cursor.

from the menu should also work.

 

Expand the document block (right click where the red cross is then show command) reveals that fsolve was used which stops at the first root encountered.

 

First 14 15 16 17 18 Page 16 of 18