The function

110 Reputation

4 Badges

3 years, 54 days

MaplePrimes Activity


These are questions asked by The function

Hello everybody, 

So, i managed to use the examples of https://www.mapleprimes.com/questions/233343-Drawing-Of-Complex-Numbers-On-A-Complex-grid- to get to a figure that works for me. If there is a better way, i would love to hear about it. 

I believe the question does not need translation because it is very clear due to the other examples that have been done before example 3. 

The real question is: how to combine these parameters to form the right figure? The parameters are in the red box in the 3rd picture. 


 

#Toegepaste Wiskunde Deel 2
#Hoofdstuk 6
#Paragraaf 1
NULL

#Voorbeeld 1

plots:-inequal([2 <= x and x <= 7, 1 <= y and y <= 4], x = 0 .. 7, y = 0 .. 7)

 

plots:-inequal([1 <= y and y <= 4, 2 <= x and x <= 7], x = 0 .. 7, y = 0 .. 7)

 

#Voorbeeld 2

plots:-inequal([0 <= x and x <= 4, 0 <= y and y <= sqrt(x)], x = 0 .. 5, y = 0 .. 5)

 

plots:-inequal([0 <= y and y <= 2, y^2 <= x and x <= 4], x = 0 .. 5, y = 0 .. 5)

 

#Voorbeeld 3

plots:-inequal([0 <= x and x <= 2, (1/2)*x <= y and y <= 3*x*(1/2)], x = 0 .. 4, y = 0 .. 4)

 

plots:-inequal([0 <= y and y <= 1, 2*y*(1/3) <= x and x <= 2*y], x = 0 .. 5, y = 0 .. 5)

 

Download Toegepaste_Wiskunde_Deel_2_Hoofdstuk_6.mw

Hello, 

Ive followed the examples, and yet not the result the book gave. The question before this one, same type, and i did get the right answer there. 

Would you have a clue why it is not going as planned? 

Translation: "Through a resistancewire with the measured resistance R= (1.5+-0.5)Ohm goes an electric current with the measured strength I= (2.5+-0.05)A, During a timespan of t=(10+-0.5)s develops an amount of heat Q=RI^2*t. Give the estimate of the maximum relative deviation in Q."

Here i got the right answer of .42, and yet when doing the exact same thing in assignment 4, i got the wrong answers. 

Translation: "Two bodies with mass M and m have a massmidpointdistance r. For the gravitational force between these bodies counts: F=y*M*m/r^2, at which y is the gravitational constant. Give an estimation of the maximum realative deviation in F on ground of the following measurementdata: M=(7.0+-0.05)kg, m=(2.0+-0.02)kg and r=(5.0)+-0.05)m."

I had the answer -0.0029. The books says its wrong, but i cant see what i did wrong. 

Translation of the example: "According to the law of Ohm the currentstrength in the stream(/current)circle(circuit) with tension(voltage) U and resistance R is equal to I=U/R. For a given currentcircle((part of a)circuit) is given: U=(30.0+-0.05)Volt and R=(2.5+-0.03)Ohm. Determine the maximum absolute and relative deviation in I. 

Solution

The maximum absolute deviation in I is

This gives the currentstrength:

The maximum realtive deviation in I is: .... or about 1.4%"

Could somebody tell me what i am doing wrong?

Thank you!

Greetings,

The Function

#opdracht 3

R := 1.5; A := 2.5; t := 10; Q := R*A^2*t

1.5

 

2.5

 

10

 

93.750

(1)

NULL

restart

Q := R*A^2*t

R*A^2*t

(2)

diff(R*A^2*t, R)

A^2*t

(3)

diff(R*A^2*t, A)

2*R*A*t

(4)

diff(R*A^2*t, t)

R*A^2

(5)

NULL

R := 1.5; A := 2.5; t := 10

1.5

 

2.5

 

10

(6)

.5*A^2*t+2*R*A*t*0.5e-1+.5*R*A^2

39.6875

(7)

Q := R*A^2*t

93.750

(8)

39.6875/(93.750)

.4233333333

(9)

#Opdracht 4

restart

M := 7; m := 2; r := 5; F := y*M*m/r^2

7

 

2

 

5

 

(14/25)*y

(10)

restart

diff(y*M*m/r^2, M)

y*m/r^2

(11)

diff(y*M*m/r^2, m)

y*M/r^2

(12)

diff(y*M*m/r^2, r)

-2*y*M*m/r^3

(13)

M := 7; m := 2; r := 5; y := 9.81

7

 

2

 

5

 

9.81

(14)

0.5e-1*y*m/r^2+0.2e-1*y*M/r^2+(-2*y*M*m/r^3)*0.5e-1

-0.1569600000e-1

(15)

F := y*M*m/r^2

5.493600000

(16)

-0.1569600000e-1/(5.493600000)

-0.2857142857e-2

(17)

NULL

Download Mapleprimes_Question_Book_2_Paragraph_5.13_Question_4.mw

The answers from the book dont make any sense after using their solution. Its not producing the expected results. 

This is the translation by the way: "A battery that has a voltage U, is in series with a resistor R, and a condenser with capacity C. The current strength on a given time "t" in this circuit is given by i=i(t)=U/R*e^-(t/R*C). Determine R and C based on the data given in table 5.6, the current is U=100V."

Greetings,

The Function


 

restart

U := 100

100

(1)

R := 4900

4900

(2)

C := 20*(1/1000)

1/50

(3)

"v(t):=U/(R)*(e)^(-(t/(R*C)))"

proc (t) options operator, arrow, function_assign; U*exp(-t/(R*C))/R end proc

(4)

v(.1)

0.2038734923e-1

(5)

NULL

data := LinearAlgebra:-Transpose(`<,>`(`<|>`(.1, .2, .3, .4, .5), `<|>`(7.36, 2.7, .99, .37, .13)))

Matrix(%id = 18446746712187741238)

(6)

plot(data, style = point)

 

X := data[() .. (), 1]; Y := data[() .. (), 2]

Vector(5, {(1) = .1, (2) = .2, (3) = .3, (4) = .4, (5) = .5})

 

Vector[column](%id = 18446746712187761598)

(7)

sumX := add(X); sumY := add(Y); sumX2 := add(x^2, `in`(x, X)); sumXY := X.Y

1.5

 

11.55

 

.55

 

1.78600000000000003

(8)

eq1 := numelems(X)*a+b*sumX = sumY; eq2 := a*sumX+b*sumX2 = sumXY

5*a+1.5*b = 11.55

 

1.5*a+.55*b = 1.78600000000000003

(9)

solve({eq1, eq2}, {a, b})

{a = 7.347000000, b = -16.79000000}

(10)

``

Download Mapleprimes_Question_Book_2_Paragraph_5.12_Question_5.mw

Hello everybody! 

Since least squares is not fully understood by me all that well, and the way my Dutch book throws me into the deep whitout really showing how things are done, i decided to look for some videos on Least Squares in Maple on YouTube. Well, i did found one, but then this happened. "Error, (in sum) summation variable previously assigned, second argument evaluates to 1 = 1 .. 5" I just want to go further with the video, but now im stuck and i have no clue how to go on. 

https://youtu.be/8zh73UrJW6M?t=948 This is the video at the moment the part where i get stuck is shown. 

I really like these sort of videos while they really do help out. I think its great. 

This is my maple worksheet:


 

with(Statistics); with(CurveFitting); with(LinearAlgebra); with(Optimization); with(plots); interface(imaginaryunit = I)

I

(1)

"f(x):=b[0]+(&sum;)(b[k]*sin(k*x))"

proc (x) options operator, arrow, function_assign; b[0]+sum(b[k]*sin(k*x), k = 1 .. 5) end proc

(2)

X := [seq(3.*k*(1/10), k = 1 .. 10)]

[.3000000000, .6000000000, .9000000000, 1.200000000, 1.500000000, 1.800000000, 2.100000000, 2.400000000, 2.700000000, 3.000000000]

(3)

Y := map(proc (x) options operator, arrow; x^2 end proc, X)

[0.9000000000e-1, .3600000000, .8100000000, 1.440000000, 2.250000000, 3.240000000, 4.410000000, 5.760000000, 7.290000000, 9.000000000]

(4)

F := CurveFitting:-LeastSquares(X, Y, x, curve = f(x))

HFloat(9.017880939782968)-HFloat(7.700034497920161)*sin(x)-HFloat(3.0589327899122045)*sin(2.*x)-HFloat(1.6899646233017431)*sin(3.*x)-HFloat(1.40247653582845)*sin(4.*x)-HFloat(0.82531550630546)*sin(5.*x)

(5)

smartplot(HFloat(9.017880939782968)-HFloat(7.700034497920161)*sin(x)-HFloat(3.0589327899122045)*sin(2.*x)-HFloat(1.6899646233017431)*sin(3.*x)-HFloat(1.40247653582845)*sin(4.*x)-HFloat(0.82531550630546)*sin(5.*x))

 

display(data, plot(f(x), x = 0 .. 3))

Warning, expecting only range variable x in expression b[0]+b[1]*sin(x)+b[2]*sin(2*x)+b[3]*sin(3*x)+b[4]*sin(4*x)+b[5]*sin(5*x) to be plotted but found names [b[0], b[1], b[2], b[3], b[4], b[5]]

 

Error, (in plots:-display) expecting plot structure but received: data

 

data := LinearAlgebra:-Transpose(`<,>`(`<|>`(.3000000000, .6000000000, .9000000000, 1.200000000, 1.500000000, 1.800000000, 2.100000000, 2.400000000, 2.700000000, 3.000000000), `<|>`(0.9000000000e-1, .3600000000, .8100000000, 1.440000000, 2.250000000, 3.240000000, 4.410000000, 5.760000000, 7.290000000, 9.000000000)))

Matrix(%id = 18446746050376108382)

(6)

p1 := plot(data, style = point, color = "green")

 

display(p1, plot(F, x = 0 .. 3), plot(x^2, x = 0 .. 3, color = "black"))

 

with(CurveFitting)

``

CurveFitting[Interactive](X, Y)

9.01788093978297-7.70003449792016*sin(x)-3.0589327899122*sin(2.*x)-1.68996462330174*sin(3.*x)-1.40247653582845*sin(4.*x)-.82531550630546*sin(5.*x)

(7)

smartplot(9.01788093978297-7.70003449792016*sin(x)-3.0589327899122*sin(2.*x)-1.68996462330174*sin(3.*x)-1.40247653582845*sin(4.*x)-.82531550630546*sin(5.*x))

 

with*LinearAlgebra

LinearAlgebra:-LeastSquares({Equate(`~`[f](X), Y)[]}, {seq(b[k], k = 0 .. 5)})

{b[0] = HFloat(9.017880939782952), b[1] = HFloat(-7.700034497920145), b[2] = HFloat(-3.0589327899122054), b[3] = HFloat(-1.6899646233017416), b[4] = HFloat(-1.4024765358284492), b[5] = HFloat(-0.8253155063054547)}

(8)

A, v := LinearAlgebra:-GenerateMatrix(Equate(`~`[f](X), Y), [seq(b[k], k = 0 .. 5)]); LinearAlgebra:-LeastSquares(A, v)

Vector[column](%id = 18446746050376098150)

(9)

Optimization:-LSSolve([v, A])

[2.61443732196701051, Vector[column](%id = 18446746050376094654)]

(10)

Optimization:-LSSolve([seq(f(X[k])-Y[k], k = 1 .. 10)])

Error, (in sum) summation variable previously assigned, second argument evaluates to 1 = 1 .. 5

 

NULL


Thank you very much! 

Greetings,

 

The Function
 

Download Least-Squares_Fitting_in_Maple_video.mw

Now, there are two unknows, and i cant seem to get it right. 

Its "the method of the least squares", and it has gone wrong. How terrible, now ive made many books, but this book always sets me up, you may have guessed it: the Dutch Math book strikes again... 

Ive tried to use a value, it looks like i used the rights steps, but the wrong input, the solution does not give me anything that looks like it is doing the rigth thing. Checking the new formula does not give the solution it is suppose to give. Now i know they mentioned that x=1/I but that does not give the right answer either. 

Okey the question states: "A battery delivers a current I to a circuit with an external(not inside the battery) resistance Ry. The battery has an internal resistance Ri and delivers a source tension (voltage) U. These are the formulas U=(Ry+Ri)*I, of which follows: Ry+Ri=U/I. We state that x= 1/I and then we get Ry+Ri=U*x, of which follows: Ry=U*x-Ri. 

That last formula gives a linear conjunction between x and Ry. There are a couple of measurements done, of which different values of the resistance Ry and the current I is measured (look at table 5.4). The value of x is determined by the smallest squares method." 

While i did not use x instead of I, it made no difference. I was no where close to the results. I think i am misschien something.


`<,>`(`<|>`(1, 1.5, 2, 2.5, 3), `<|>`(1.31, 1.01, .81, .67, .56))

Matrix(%id = 18446745647253576510)

(1)

"f(t):=t/(2);seq(f(t),t=2..6);Sum(f(t),t=2..6)=sum(f(t),t=2..6)"

proc (t) options operator, arrow, function_assign; (1/2)*t end proc

 

1, 3/2, 2, 5/2, 3

 

Sum((1/2)*t, t = 2 .. 6) = 10

(2)

10*(1/5)

2

(3)

convert(`<,>`(1.31, 1.01, .81, .67, .56), `+`)

4.36

(4)

4.36*(1/5)

.8720000000

(5)

`<,>`(1, 1.5, 2, 2.5, 3).`<,>`(1.31, 1.01, .81, .67, .56)

7.80000000000000071

(6)

"f(t):=(t/(2))^(2);seq(f(t),t=2..6);Sum(f(t),t=2..6)=sum(f(t),t=2..6)"

proc (t) options operator, arrow, function_assign; (1/4)*t^2 end proc

 

1, 9/4, 4, 25/4, 9

 

Sum((1/4)*t^2, t = 2 .. 6) = 45/2

(7)

solve([(45/2)*a+10*b = 7.80000000000000071, 2*a+b = 4.36], [a, b])

[[a = -14.32000000, b = 33.00000000]]

(8)

"f(t):=-14.32 t+33"

proc (t) options operator, arrow, function_assign; -14.32*t+33 end proc

(9)

plot(proc (t) options operator, arrow, function_assign; -14.32*t+33 end proc)

 

f(1)

18.68

(10)

``

Maybe someone knows an answer to this. 

Thank you!

Greetings,

The Function 

Download Mapleprimes_Question_Book_2_Paragraph_5.12_Question_3.mw

1 2 3 4 5 6 7 Page 1 of 7