C_R

3622 Reputation

21 Badges

6 years, 123 days

MaplePrimes Activity


These are answers submitted by C_R

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.

 

This can have many reasons. To start I would check this

https://faq.maplesoft.com/s/article/Scaling-issues-when-using-high-resolution-monitors-on-a-Windows-machine?language=en_US

Here is a screen shot from my 4k setting (32'' monitor, compatibility settings in the program properties are all default, 150% font scaling in Windows display settings, no special Maple settings).

Do you get the tiny fonts right after starting Maple?

(Display resolution changes during a Maple session could be a cause. E.g. change of monitor).

Hope this helps for a start. If not, you might want to post details of your hardware and operating system settings.

I have noticed an improvement with Windows updates (i.e. i have not seen what you are showing for a while).

For test purposes you could change the display resolution to 2k and check if the font proportions are better.

For the background:

https://www.mapleprimes.com/questions/37691-How-Do-I-Change-The-Background-Colour

Since this one is old and not related to 4K you might want to ask a separate question.

Because there is an infinite number of solutions. Try

solve({sin(x)/x = 0}, AllSolutions = true)

to get the general solution.

For the plot of g, try increasing the number of ploted points with the plot option numpoints.


 

The unit issue is simple to solve once you know it, but less simple to understand (at least it was for me).

I had the same intention to convert a result of the form magnitude_name=value*unit as you.

Cr = (2.532634930*10^(-7))*Unit('F')

Cr = 0.2532634930e-6*Units:-Unit(F)

(1)

This input

convert(Cr = 0.2532634930e-6*Units:-Unit(F), 'units', F, nF)

1000000000*Cr = 253.2634930*Units:-Unit(F)

(2)

converts only the value by the ratio of F/nF=10^9 but leaves the units untouched. This is equivalent to

10^9*(Cr = 0.2532634930e-6*Units[Unit](F))

1000000000*Cr = 253.2634930*Units:-Unit(F)

(3)


If you try instead

convert(Cr = 0.2532634930e-6*Units[Unit](F), 'units', 'nF')

Error, (in convert/units) unable to convert `1` to `nF`

 

Maple throws an error because it can't find on the left hand side a unit to a) compute the ratio to change the value and b) substitute F by nF.
Conversion has to be done piece by piece as you have seen in Tom's answer.

convert(rhs(Cr = 0.2532634930e-6*Units[Unit](F)), 'units', 'nF')

253.2634930*Units:-Unit(nF)

(4)

In other words Maple currently cannot convert a result in the form of an equation.
If you try the context panel (Convert Output Units) on the Output (1) you will get an error. If you try it on

rhs(Cr = 0.2532634930e-6*Units[Unit](F))

0.2532634930e-6*Units:-Unit(F)

(5)

it will work (the right click context menu did not work on my installation 2022.2).

I have already suggested to Maplesoft to make a conversion of such simple equations possible with a simpler command structure and hopefully also with the context panel.

Deriving results in the form of an equation is not uncommon in science and technology.
Good to see that there is annother Maple user who want's to do it.


 

Download Unit_convertion_of_results.mw

I have rewritten your worksheet with equations to see what is substituted in the RMS expression. As you can see, value is not effective and convert,unit_free throws the same error you are encountering. This does not look good either.

Attached is a simple example where piecewise integration of constant functions worked well with units. Test wise, instead of constant functions I tried to integrate squared cosine functions and took the square root of it. This is equivalent to your RMS calculation and worked well. So, it is really strange what you are encountering.

I hope my additional observations can give a clue what is going on.  Or you can use my file to start from scratch.

restart

 

Definition of current functions

eq1 := i__1(t) = piecewise(t < 0.1e-1*Unit('s'), 0*Unit('A'), t >= 0.1e-1*Unit('s'), 3*Unit('A')*cos(2*Pi*t/T))

eq2 := i__2(t) = 3*Unit('A')*cos(2*Pi*t/T)

eq3 := i__3(t) = piecewise(t < 0.1e-1*Unit('s'), 0*Unit('A'), t >= 0.1e-1*Unit('s'), 3*Unit('A')*cos(2*Pi*t/T__3))

param := T = 0.2e-1*Unit('s')

plot(subs(eq1, eq2, param, [i__1(t), i__2(t)]), t = 0 .. .1*Unit('s'), color = [blue, red], legend = [i__1, i__2])

 

Calculation of RMS values

RMS__1 = sqrt((int(i__1(t)^2, t = 0 .. T))/T)

RMS__1 = ((int(i__1(t)^2, t = 0 .. T))/T)^(1/2)

(1)

value(subs(eq1, param, RMS__1 = ((int(i__1(t)^2, t = 0 .. T))/T)^(1/2)))

RMS__1 = 7.071067812*((int(piecewise(t < 0.1e-1*Units:-Unit(s), 0, 0.1e-1*Units:-Unit(s) <= t, 3*Units:-Unit(A)*cos(314.1592654*t/Units:-Unit(s)))^2, t = 0 .. 0.2e-1*Units:-Unit(s)))/Units:-Unit(s))^(1/2)

(2)

convert(rhs(RMS__1 = 7.071067812*((int(piecewise(t < 0.1e-1*Units:-Unit(s), 0, 0.1e-1*Units:-Unit(s) <= t, 3*Units:-Unit(A)*cos(314.1592654*t/Units:-Unit(s)))^2, t = 0 .. 0.2e-1*Units:-Unit(s)))/Units:-Unit(s))^(1/2)), units_free)

Error, (in Tools:-IntegrateExpression) units problem, can't make expression piecewise(t < .1e-1*Units:-Unit(s),0,.1e-1*Units:-Unit(s) <= t,3*Units:-Unit(A)*cos(314.1592654*t/Units:-Unit(s)))^2 unit-free with units [t::Units:-Unit(s)]

 

RMS__2 = sqrt((int(i__2(t)^2, t = 0 .. T))/T)

RMS__2 = ((int(i__2(t)^2, t = 0 .. T))/T)^(1/2)

(3)

simplify(subs(eq2, param, RMS__2 = ((int(i__2(t)^2, t = 0 .. T))/T)^(1/2)))

RMS__2 = 2.121320344*Units:-Unit(A)

(4)

NULL

Download UnitProblem_with_eqs.mw

simple_piecewise_integration_with_units.mw

First 14 15 16 17 18 Page 16 of 18