Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

how this integro-differential equation can be solved?
any assumption or suggestion is appreciated. tnx in advance

restart

eq:=diff(y(x),x)=y(x)+exp(x)*exp(-3*x)/2+int(exp(x+t)*y(t),t=0..x);

IC:=y(0)=1;

diff(y(x), x) = y(x)+(1/2)*exp(x)*exp(-3*x)+int(exp(x+t)*y(t), t = 0 .. x)

 

y(0) = 1

(1)

eq2:=g(x)=int(exp(x+t)*y(t),t=0..x);

g(x) = int(exp(x+t)*y(t), t = 0 .. x)

(2)

IC_2:=eval(eq2,[x=0,y=1])

g(0) = 0

(3)

sys:={diff(eq2,x),subs(rhs(eq2)=lhs(eq2),eq)}

{diff(g(x), x) = int(exp(x+t)*y(t), t = 0 .. x)+exp(2*x)*y(x), diff(y(x), x) = y(x)+(1/2)*exp(x)*exp(-3*x)+g(x)}

(4)

dsolve(sys union {IC,IC_2},numeric)

Error, (in dsolve/numeric/process_input) input system must be an ODE system, got independent variables {t, x}

 

Download integro-diffrential_problem.mw

Hey all Maple experts.I could really use some help with  diff,D,Diff

restart

interface(version)

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

(1)

with(Physics[Vectors])

NULL

CompactDisplay(A_(x, y, z, t), `ϕ`(x, y, z, t), v_(x, y, z, t), F_(x, y, z, t), v__x(x, y, z, t), v__y(x, y, z, t), v__z(x, y, z, t), A__x(x, y, z, t), A__y(x, y, z, t), A__z(x, y, z, t), quiet)

macro(Av = A_(x, y, z, t), `ϑ` = `ϕ`(x, y, z, t), Vv = v_(x, y, z, t), Fv = F_(x, y, z, t))

show, ON, OFF, kd_, ep_, Av, vartheta, Vv, Fv

(2)

Fv = q*('-VectorCalculus[Nabla](`ϑ`)'-(diff(Av, t))+`&x`(Vv, `&x`(VectorCalculus[Nabla], Av)))

F_(x, y, z, t) = q*(-Physics:-Vectors:-Nabla(varphi(x, y, z, t))-(diff(A_(x, y, z, t), t))+Physics:-Vectors:-`&x`(v_(x, y, z, t), Physics:-Vectors:-Curl(A_(x, y, z, t))))

(3)

Av = A__x(x, y, z, t)*_i+A__y(x, y, z, t)*_j+A__z(x, y, z, t)*_k, Vv = v__x(x, y, z, t)*_i+v__y(x, y, z, t)*_j+v__z(x, y, z, t)*_k, F_(x, y, z, t) = F__x*_i+F__y*_j+F__z*_k

A_(x, y, z, t) = A__x(x, y, z, t)*_i+A__y(x, y, z, t)*_j+A__z(x, y, z, t)*_k, v_(x, y, z, t) = v__x(x, y, z, t)*_i+v__y(x, y, z, t)*_j+v__z(x, y, z, t)*_k, F_(x, y, z, t) = F__x*_i+F__y*_j+F__z*_k

(4)

subs[eval](A_(x, y, z, t) = A__x(x, y, z, t)*_i+A__y(x, y, z, t)*_j+A__z(x, y, z, t)*_k, v_(x, y, z, t) = v__x(x, y, z, t)*_i+v__y(x, y, z, t)*_j+v__z(x, y, z, t)*_k, F_(x, y, z, t) = F__x*_i+F__y*_j+F__z*_k, F_(x, y, z, t) = q*(-Physics[Vectors][Nabla](varphi(x, y, z, t))-(diff(A_(x, y, z, t), t))+Physics[Vectors][`&x`](v_(x, y, z, t), Physics[Vectors][Curl](A_(x, y, z, t)))))

F__x*_i+F__y*_j+F__z*_k = q*(-(diff(varphi(x, y, z, t), x))*_i-(diff(varphi(x, y, z, t), y))*_j-(diff(varphi(x, y, z, t), z))*_k-(diff(A__x(x, y, z, t), t))*_i-(diff(A__y(x, y, z, t), t))*_j-(diff(A__z(x, y, z, t), t))*_k+(-v__y(x, y, z, t)*(diff(A__x(x, y, z, t), y))+v__y(x, y, z, t)*(diff(A__y(x, y, z, t), x))+v__z(x, y, z, t)*(diff(A__z(x, y, z, t), x))-v__z(x, y, z, t)*(diff(A__x(x, y, z, t), z)))*_i+(-v__z(x, y, z, t)*(diff(A__y(x, y, z, t), z))+v__z(x, y, z, t)*(diff(A__z(x, y, z, t), y))+v__x(x, y, z, t)*(diff(A__x(x, y, z, t), y))-v__x(x, y, z, t)*(diff(A__y(x, y, z, t), x)))*_j+(v__y(x, y, z, t)*(diff(A__y(x, y, z, t), z))-v__y(x, y, z, t)*(diff(A__z(x, y, z, t), y))-v__x(x, y, z, t)*(diff(A__z(x, y, z, t), x))+v__x(x, y, z, t)*(diff(A__x(x, y, z, t), z)))*_k)

(5)

map(Component, F__x*_i+F__y*_j+F__z*_k = q*(-(diff(varphi(x, y, z, t), x))*_i-(diff(varphi(x, y, z, t), y))*_j-(diff(varphi(x, y, z, t), z))*_k-(diff(A__x(x, y, z, t), t))*_i-(diff(A__y(x, y, z, t), t))*_j-(diff(A__z(x, y, z, t), t))*_k+(-v__y(x, y, z, t)*(diff(A__x(x, y, z, t), y))+v__y(x, y, z, t)*(diff(A__y(x, y, z, t), x))+v__z(x, y, z, t)*(diff(A__z(x, y, z, t), x))-v__z(x, y, z, t)*(diff(A__x(x, y, z, t), z)))*_i+(-v__z(x, y, z, t)*(diff(A__y(x, y, z, t), z))+v__z(x, y, z, t)*(diff(A__z(x, y, z, t), y))+v__x(x, y, z, t)*(diff(A__x(x, y, z, t), y))-v__x(x, y, z, t)*(diff(A__y(x, y, z, t), x)))*_j+(v__y(x, y, z, t)*(diff(A__y(x, y, z, t), z))-v__y(x, y, z, t)*(diff(A__z(x, y, z, t), y))-v__x(x, y, z, t)*(diff(A__z(x, y, z, t), x))+v__x(x, y, z, t)*(diff(A__x(x, y, z, t), z)))*_k), 1)

F__x = -v__y(x, y, z, t)*(diff(A__x(x, y, z, t), y))*q+v__y(x, y, z, t)*(diff(A__y(x, y, z, t), x))*q+v__z(x, y, z, t)*(diff(A__z(x, y, z, t), x))*q-v__z(x, y, z, t)*(diff(A__x(x, y, z, t), z))*q-(diff(varphi(x, y, z, t), x))*q-(diff(A__x(x, y, z, t), t))*q

(6)

collect(F__x = -v__y(x, y, z, t)*(diff(A__x(x, y, z, t), y))*q+v__y(x, y, z, t)*(diff(A__y(x, y, z, t), x))*q+v__z(x, y, z, t)*(diff(A__z(x, y, z, t), x))*q-v__z(x, y, z, t)*(diff(A__x(x, y, z, t), z))*q-(diff(varphi(x, y, z, t), x))*q-(diff(A__x(x, y, z, t), t))*q, [q, v__x(x, y, z, t), v__y(x, y, z, t), v__z(x, y, z, t)])

F__x = (v__y(x, y, z, t)*(diff(A__y(x, y, z, t), x)-(diff(A__x(x, y, z, t), y)))+(diff(A__z(x, y, z, t), x)-(diff(A__x(x, y, z, t), z)))*v__z(x, y, z, t)-(diff(varphi(x, y, z, t), x))-(diff(A__x(x, y, z, t), t)))*q

(7)

convert(F__x = (v__y(x, y, z, t)*(diff(A__y(x, y, z, t), x)-(diff(A__x(x, y, z, t), y)))+(diff(A__z(x, y, z, t), x)-(diff(A__x(x, y, z, t), z)))*v__z(x, y, z, t)-(diff(varphi(x, y, z, t), x))-(diff(A__x(x, y, z, t), t)))*q, Diff)

F__x = (v__y(x, y, z, t)*(Diff(A__y(x, y, z, t), x)-(Diff(A__x(x, y, z, t), y)))+(Diff(A__z(x, y, z, t), x)-(Diff(A__x(x, y, z, t), z)))*v__z(x, y, z, t)-(Diff(varphi(x, y, z, t), x))-(Diff(A__x(x, y, z, t), t)))*q

(8)

convert(F__x = (v__y(x, y, z, t)*(diff(A__y(x, y, z, t), x)-(diff(A__x(x, y, z, t), y)))+(diff(A__z(x, y, z, t), x)-(diff(A__x(x, y, z, t), z)))*v__z(x, y, z, t)-(diff(varphi(x, y, z, t), x))-(diff(A__x(x, y, z, t), t)))*q, D)

F__x = (v__y(x, y, z, t)*((D[1](A__y))(x, y, z, t)-(D[2](A__x))(x, y, z, t))+((D[1](A__z))(x, y, z, t)-(D[3](A__x))(x, y, z, t))*v__z(x, y, z, t)-(D[1](varphi))(x, y, z, t)-(D[4](A__x))(x, y, z, t))*q

(9)

 
Hello everyone, in the result of this command execution process, it appears that the symbols for partial derivatives and derivatives in equation (8) are displayed incorrectly. What should I do?

Download error_display.mw

I am trying to compute partial derivatives of some complicated expression which include summations. First, I noticed that sum behaves differently if I use 1D vs. 2D math. Why?

Questions:
  1. Partial derivative of a summation: why is it not just 2*X[i]?
  2. Partial derivative of a double summation: how to define the nested structure of a double summation with j<>i?
  3. System of n+1 equations: how to define and solve for it?

For 3., each i equation is the partial derivative of my complicated expression with summations with respect to X[i], where i ranges from 1 to n. The last equation is the partial derivative with respect to X_r (a fixed variable).

Thanks.

restart

A := sum(X[i]^2, i = 1 .. n); eq[1] := diff(A, X[i]) = 0

sum(X[i]^2, i = 1 .. n)

 

sum(2*X[i], i = 1 .. n) = 0

(1)

B__wrong := sum(sum((X__r*w+X[i])*(X__r*w+X[j]), j = 1 .. n), i = 1 .. n); B__correct := 'sum(sum((X__r*w+X[i])*(X__r*w+X[j]), j = 1 .. n), i = 1 .. n)'

n^2*X__r^2*w^2+sum(sum(X__r*w*X[j]+X[i]*X[j], j = 1 .. n)+n*X__r*w*X[i], i = 1 .. n)

 

sum(sum((X__r*w+X[i])*(X__r*w+X[j]), j = 1 .. n), i = 1 .. n)

(2)

eqs := seq(eq[i], i = 1 .. n); vars := seq(X[i], i = 1 .. n)

Error, range bounds in seq must be numeric or character

 

Error, range bounds in seq must be numeric or character

 
 

NULL

Download equations_with_summations.mw

On some occasions I have seen output like this

where the user name is replaced by a placeholder.
How to achieve this?

Let P(u,v) = -u⁴+88u³v-146u²v²+88uv³-v⁴+2u²+40uv+2v²-1, with P(u,v)=0,

and u0 = sqrt(2)/6 i,  v0 = -sqrt(2)/6 i. We see that P(u0,v0)=0.

Direct substitution of implicitdiff(P(u,v),v,u) at u0, v0 leads to 0/0.

For obtaining the true value of dv/du at (u0,v0) we have written in Maple:

solve(limit(subs(v=v0+k*(u-u0), implicitdiff(P(u,v),v,u)), u=u0)-k, k);

There are two solutions: 49/113 - 72*sqrt(2)/113*I, and 49/113 + 72*sqrt(2)/113*I.

However we were unable to determine the true value of d²v/du² at (u0,v0).

QUESTION:  How to determine it?

Hi. I'm comparing two 7x3-man teams lists. I can see there are at least 2 teams that have common members, new[1] and past[4], new[4] and past[3]. There may be others but the chat gpt code below doesn't definitively find any of them.

common.mw

The company library with all the good stuff has passed a 100 Mb size, and I wonder if it is possible to find out, which parts of the library that use most of the storage space?

After exertion with ordinary differential equations now relaxation:

Determine the formation law, limit and sum limit for
u_n+3=(13/12)*u_n+2 - (3/8)*u_n+1 + (1/24)*u_n .
Starting values ​​u_1=0, u_2=1, u_3=1.

We’re thrilled to announce the launch of our new Student Success Platform! Over the past several months, our academic team has dedicated itself to understanding how we can better support institutions in addressing their concerns around student retention rates. The numbers tell a concerning story: In the U.S., nearly 25% of first-year undergraduates don’t complete their studies, and in STEM fields, the numbers are even higher. In both STEM programs and non-STEM programs with math gateway courses, struggles with math are often a key reason students do not, or cannot, continue their studies. This has a profound impact on both the students’ futures and the institution’s revenue and funding.

From what we’re hearing from institutions and instructors, one of the most pressing issues is the lack of readiness among first-year students, particularly in math courses. With larger class sizes and students arriving with varying levels of preparedness, instructors face challenges in providing the personalized support that is essential. Additionally, many students don’t fully utilize existing resources, such as office hours or TA sessions, which increases their risk of falling behind and ultimately dropping out.

Our new Student Success Platform is designed to tackle these issues head-on. It combines all of our existing tools with exciting new features to help students succeed on their own terms—without adding to instructors' already busy workloads. The early feedback has been fantastic, and we can’t wait for you to see the impact it can make.

You can read more about the Student Success Platform here: https://www.maplesoft.com/student-success-platform/

 

If we calculating it take to much time but if we make a procedure it will be more effectable for such example, i want the exact and approximat and error

restart

with(PDEtools)

with(LinearAlgebra)

NULL

with(inttrans)

with(SolveTools)

undeclare(prime)

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

(1)

NULL

eq := diff(y(x, t), `$`(t, 2))+(1+x)*(diff(y(x, t), x))-y(x, t) = 2*y(x, t)^3

diff(diff(y(x, t), t), t)+(1+x)*(diff(y(x, t), x))-y(x, t) = 2*y(x, t)^3

(2)

eq1 := laplace(eq, t, s)

s^2*laplace(y(x, t), t, s)-s*y(x, 0)+laplace(diff(y(x, t), x), t, s)*x-laplace(y(x, t), t, s)-(D[2](y))(x, 0)+laplace(diff(y(x, t), x), t, s) = 2*laplace(y(x, t)^3, t, s)

(3)

eq2 := subs({y(x, 0) = 1, (D[2](y))(x, 0) = 1}, eq1)

s^2*laplace(y(x, t), t, s)-s+laplace(diff(y(x, t), x), t, s)*x-laplace(y(x, t), t, s)-1+laplace(diff(y(x, t), x), t, s) = 2*laplace(y(x, t)^3, t, s)

(4)

eq3 := s^2*laplace(y(x, t), t, s) = s-laplace(diff(y(x, t), x), t, s)*x+1+laplace(diff(y(x, t), x), t, s)+2*laplace(y(x, t)^3, t, s)+laplace(y(x, t), t, s)

s^2*laplace(y(x, t), t, s) = s-laplace(diff(y(x, t), x), t, s)*x+1+laplace(diff(y(x, t), x), t, s)+2*laplace(y(x, t)^3, t, s)+laplace(y(x, t), t, s)

(5)

eq4 := expand(eq3/s^2)

laplace(y(x, t), t, s) = 1/s-laplace(diff(y(x, t), x), t, s)*x/s^2+1/s^2+laplace(diff(y(x, t), x), t, s)/s^2+2*laplace(y(x, t)^3, t, s)/s^2+laplace(y(x, t), t, s)/s^2

(6)

NULL

"u[0](x):=invlaplace(1/s+1/(s^2),s,x)"

proc (x) options operator, arrow, function_assign; invlaplace(1/s+1/s^2, s, x) end proc

(7)

u[0](x)

1+x

(8)

n := N

N

(9)

k := K

K

(10)

f := proc (u) options operator, arrow; u^3 end proc

proc (u) options operator, arrow; u^3 end proc

(11)

for j from 0 to 3 do A[j] := subs(lambda = 0, (diff(f(seq(sum(lambda^i*u[i](x), i = 0 .. 20), m = 1 .. 2)), [`$`(lambda, j)]))/factorial(j)) end do

(1+x)^3

 

3*(1+x)^2*u[1](x)

 

3*(1+x)*u[1](x)^2+3*(1+x)^2*u[2](x)

 

u[1](x)^3+6*(1+x)*u[1](x)*u[2](x)+3*(1+x)^2*u[3](x)

(12)

A[0]

(1+x)^3

(13)

y[0] := 1+x

1+x

(14)

y[1] := invlaplace(2*laplace(A[0], x, s)/s^2, s, x)-invlaplace(x*laplace(diff(y[0], x), x, s)/s^2, s, x)+invlaplace(laplace(y[0], x, s)/s^2, s, x)-invlaplace(laplace(diff(y[0], x), x, s)/s^2, s, x)

(1/10)*x^2*(x^3+5*x^2+10*x+10)-(1/2)*x^3+(1/6)*x^2*(x+3)-(1/2)*x^2

(15)

y[1] := expand((1/10)*x^2*(x^3+5*x^2+10*x+10)-(1/2)*x^3+(1/6)*x^2*(x+3)-(1/2)*x^2)

(1/10)*x^5+(1/2)*x^4+(2/3)*x^3+x^2

(16)

"u[1](x) :=y[1]  "

proc (x) options operator, arrow, function_assign; y[1] end proc

(17)

NULL

A[1]

3*(1+x)^2*((1/10)*x^5+(1/2)*x^4+(2/3)*x^3+x^2)

(18)

y[2] := invlaplace(2*laplace(A[1], x, s)/s^2, s, x)-invlaplace(x*laplace(diff(y[1], x), x, s)/s^2, s, x)+invlaplace(laplace(y[1], x, s)/s^2, s, x)-invlaplace(laplace(diff(y[1], x), x, s)/s^2, s, x)

(1/840)*x^4*(7*x^5+63*x^4+212*x^3+476*x^2+672*x+420)-(1/60)*x^4*(x^3+6*x^2+10*x+20)+(1/420)*x^4*(x^3+7*x^2+14*x+35)-(1/60)*x^3*(x^3+6*x^2+10*x+20)

(19)

y[2] := expand(%)

(1/120)*x^9+(3/40)*x^8+(5/21)*x^7+(7/15)*x^6+(17/30)*x^5+(1/12)*x^4-(1/3)*x^3

(20)

" u[2](x):=y[2]"

proc (x) options operator, arrow, function_assign; y[2] end proc

(21)

A[2]

3*(1+x)*((1/10)*x^5+(1/2)*x^4+(2/3)*x^3+x^2)^2+3*(1+x)^2*((1/120)*x^9+(3/40)*x^8+(5/21)*x^7+(7/15)*x^6+(17/30)*x^5+(1/12)*x^4-(1/3)*x^3)

(22)

y[3] := invlaplace(2*laplace(A[2], x, s)/s^2, s, x)-invlaplace(x*laplace(diff(y[2], x), x, s)/s^2, s, x)+invlaplace(laplace(y[2], x, s)/s^2, s, x)-invlaplace(laplace(diff(y[2], x), x, s)/s^2, s, x)

(1/10810800)*x^5*(7623*x^8+99099*x^7+518778*x^6+1634490*x^5+3647930*x^4+5167305*x^3+4221360*x^2+900900*x-1081080)-(1/25200)*x^5*(21*x^6+210*x^5+750*x^4+1680*x^3+2380*x^2+420*x-2100)+(1/831600)*x^5*(63*x^6+693*x^5+2750*x^4+6930*x^3+11220*x^2+2310*x-13860)-(1/25200)*x^4*(21*x^6+210*x^5+750*x^4+1680*x^3+2380*x^2+420*x-2100)

(23)

y[3] := expand(y[3])

(286/945)*x^9+(131/336)*x^8+(1/7)*x^10+(17/70)*x^7-(1/40)*x^6-(1/20)*x^5+(1/12)*x^4+(1091/23100)*x^11+(11/15600)*x^13+(11/1200)*x^12

(24)

NULL

addingterm := y[0]+y[1]+y[2]+y[3]

1+x+(37/60)*x^5+(2/3)*x^4+(1/3)*x^3+x^2+(2351/7560)*x^9+(781/1680)*x^8+(101/210)*x^7+(53/120)*x^6+(1/7)*x^10+(1091/23100)*x^11+(11/15600)*x^13+(11/1200)*x^12

(25)


 

Download aproximate_and_exact_solution.mw

a table like that

 

there is four formula for calculate them which i know them by name of author the first one is adomian second one is (BiazarShafiofAdomian) which one member of mableprimes write code for me,but i don't know how use for all kind function maybe in future i upload this program for fix this issue, the third one is by zhao which is i think i easy for calculate just  i need someone one to wite the program and do some test for some example i  upload some picture in case for getting algorithm to writting and have some example for testing  so  lets see who can do this algorithm is very usfule when we solve ODE or PDE by LDM, also last method is by taking integral have a good method, in this question this algorithm is zhao which is usfull one

Hi!

I am using a proceure to conpute de integral of a function by he Simpson's rule. My function is defined from a function and a procedure, but I am getting the error  "Error, (in w) invalid input: hfun2 expects its 1st argument, t, to be of type numeric, but received (1/10)*i+1/20"

As you can see in the attaxhed file, I have tried several ways to compute the integral but always returns the above error. Please, can yo help me?

Thanks

forum.mw

Over the last few days, I’ve been creating worksheets on oscillators to support my class’s understanding of these fundamental physics concepts. I wanted to share one of these worksheets that I found particularly useful for illustrating energy exchange and motion dynamics.

A simple pendulum is a classic physics example that exhibits periodic motion. It consists of a mass m (called a bob) attached to a string or rod of length L, which swings back and forth under the influence of gravity. When the bob is displaced from its equilibrium position and released, it swings back and forth under the influence of gravity.
To derive the equation of motion, we can examine the forces acting on the pendulum bob and use Newton’s second law.

Period of a Pendulum:

• 

Frequency (f) "-" the number of cycles the pendulum completes in one second. Measued in hertz ("Hz)."

f = 1/T

• 

Period ("T) -" the time it takes the pendulum to complete one cycle. Measued in seconds (s).

T = 2*Pi*sqrt(L/g)

This period depends only on the length Land gravitational acceleration "g,"meaning it is independent of the amplitude for small oscillations.

What is the period and the frequency of a single pendulum that is 70 cm long on the earth and on the moon?

L := .7; g__earth := 9.8; g__moon := 1.6

.7

 

9.8

 

1.6

(1)

T__earth := 2*Pi*sqrt(L/g__earth); f__earth := L/T__earth

1.679251909

 

.4168522878

(2)

T__moon := 2*Pi*sqrt(L/g__moon); f__moon := L/T__moon

4.155936442

 

.1684337597

(3)

The above image is taken from https://www.researchgate.net/publication/365297210_Scientific_counterfactuals_as_make-believe

1. 

Forces on the Pendulum Bob:

The main forces acting on the bob are:

• 

The gravitational force"`f__g`=mg, "acting vertically downward.

• 

The tension Tauin the string, acting along the string toward the pivot point.

2. 

Components of the Gravitational Force:

Since the pendulum swings in an arc, it’s helpful to resolve the gravitational force into two components:

• 

Radial Component (along the string): This component, "`f__y`=mgcostheta ," is countered by the tension in the string and does not contribute to the pendulum’s motion.

• 

Tangential Component (perpendicular to the string): This component, f__z = -`mgsin&theta;`(restoring force), acts along the arc of the pendulum’s swing and is responsible for its motion.

3. 

Applying Newton's Second Law
Since the tangential component of the gravitational force causes the pendulum’s motion, we can apply Newton's second law in the tangential direction:``

f__X = ma__x

Substituting for f__x and the tangential acceleration a__xNULL

m*(diff(s(t), t, t)) = -`mgsin&theta;`

where diff(s(t), t, t) = a__x and a__x = diff(x, t, t)

Now, we want to write everything in terms of θ

s = `L&theta;`

we obtain:

diff(theta(t), t, t) = -g*`sin&theta;`/L

Small-Angle Approximation

For small angles (typically) theta  , the approximation

`&approx;`(sin(theta), theta)(where theta is in radians) can be used. This simplifies the equation:

diff(theta(t), t, t) = -g*theta/L

This equation is now in the form of a simple harmonic oscillator

diff(theta(t), t, t) = -omega^2*theta

where omega = sqrt(g/L)is the angular frequency of the pendulum.

restart; with(plots); with(DEtools)

L := 1; m := .2; g := 9.8

1

 

.2

 

9.8

(4)

T := 2*Pi*sqrt(L/g)

2.007089924

(5)

omega := sqrt(g/L)

3.130495168

(6)

ODE__1 := diff(theta(t), t, t)+omega^2*theta = 0; IC := theta(0) = A, (D(theta))(0) = 0

diff(diff(theta(t), t), t)+9.799999997*theta(t) = 0

 

theta(0) = A, (D(theta))(0) = 0

(7)

sol := dsolve({IC, ODE__1}, theta(t))

theta(t) = A*cos((1/100000)*97999999970^(1/2)*t)

(8)

plot_1 := subs(A = 0.873e-1, sol); plotsresult := plot([rhs(plot_1)], t = 0 .. 2, color = [red])

 

`&theta;_t` := rhs(subs(A = 0.873e-1, sol)); v_t := diff(`&theta;_t`, t)

0.873e-1*cos((1/100000)*97999999970^(1/2)*t)

 

-0.8730000000e-6*97999999970^(1/2)*sin((1/100000)*97999999970^(1/2)*t)

(9)

T := (1/2)*m*L^2*v_t^2; V := m*g*L*(1-cos(`&theta;_t`)); H := T+V

0.7468864200e-2*sin((1/100000)*97999999970^(1/2)*t)^2

 

1.96-1.96*cos(0.873e-1*cos((1/100000)*97999999970^(1/2)*t))

 

0.7468864200e-2*sin((1/100000)*97999999970^(1/2)*t)^2+1.96-1.96*cos(0.873e-1*cos((1/100000)*97999999970^(1/2)*t))

(10)

energy_plot := plot([eval(T), eval(V), eval(H)], t = 0 .. 5, color = [red, blue, green], legend = ["Kinetic Energy", "Potential Energy", "Total Energy"], title = "Energy Exchange in Simple Pendulum", labels = ["Time (s)", "Energy (Joules)"])

 

directionfield := DEplot([diff(theta(t), t) = v(t), diff(v(t), t) = -omega^2*theta(t)], [theta(t), v(t)], t = 0 .. 20, theta = -20 .. 20, v = -40 .. 40, arrows = medium, title = "Direction Field for Simple Harmonic Oscillator", axes = boxed, color = navy)

sol1 := dsolve({ODE__1, theta(0) = 3, (D(theta))(0) = 0}, theta(t)); sol2 := dsolve({ODE__1, theta(0) = 6.5, (D(theta))(0) = 0}, theta(t)); sol3 := dsolve({ODE__1, theta(0) = -8, (D(theta))(0) = 0}, theta(t)); sol4 := dsolve({ODE__1, theta(0) = 9.7, (D(theta))(0) = 2.5}, theta(t))

theta(t) = 3*cos((1/100000)*97999999970^(1/2)*t)

 

theta(t) = (13/2)*cos((1/100000)*97999999970^(1/2)*t)

 

theta(t) = -8*cos((1/100000)*97999999970^(1/2)*t)

 

theta(t) = (25000/9799999997)*97999999970^(1/2)*sin((1/100000)*97999999970^(1/2)*t)+(97/10)*cos((1/100000)*97999999970^(1/2)*t)

(11)

theta1 := rhs(sol1); theta2 := rhs(sol2); theta3 := rhs(sol3); theta4 := rhs(sol4)

3*cos((1/100000)*97999999970^(1/2)*t)

 

(13/2)*cos((1/100000)*97999999970^(1/2)*t)

 

-8*cos((1/100000)*97999999970^(1/2)*t)

 

(25000/9799999997)*97999999970^(1/2)*sin((1/100000)*97999999970^(1/2)*t)+(97/10)*cos((1/100000)*97999999970^(1/2)*t)

(12)

v1 := diff(theta1, t); v2 := diff(theta2, t); v3 := diff(theta3, t); v4 := diff(theta4, t)

-(3/100000)*97999999970^(1/2)*sin((1/100000)*97999999970^(1/2)*t)

 

-(13/200000)*97999999970^(1/2)*sin((1/100000)*97999999970^(1/2)*t)

 

(1/12500)*97999999970^(1/2)*sin((1/100000)*97999999970^(1/2)*t)

 

(5/2)*cos((1/100000)*97999999970^(1/2)*t)-(97/1000000)*97999999970^(1/2)*sin((1/100000)*97999999970^(1/2)*t)

(13)

phase_plot := plot([[eval(theta1, t = tval), eval(v1, t = tval), tval = 0 .. 20], [eval(theta2, t = tval), eval(v2, t = tval), tval = 0 .. 20], [eval(theta3, t = tval), eval(v3, t = tval), tval = 0 .. 20], [eval(theta4, t = tval), eval(v4, t = tval), tval = 0 .. 20]], style = line, title = "Phase Portrait for Simple Harmonic Oscillator", labels = ["x (Displacement)", "v (Velocity)"], color = ["red", "blue", "green", "orange"], axes = boxed)

display(directionfield, phase_plot)

 

theta_at_1_sec := subs(t = 1, A = 0.873e-1, rhs(sol)); evalf(theta_at_1_sec)

0.873e-1*cos((1/100000)*97999999970^(1/2))

 

-0.8729462437e-1

(14)
 

NULL

Download Simple_Pendulum.mw

Hi,
I have an equation and I want to solve it parametrically to find x , but I couldn't do that with "solve" command. (I know x should be  real and positive). What should I do?
Root_of.mw

this example is easiest one for getting solution but i can't collect each part and do like elite i can do each part seperatly but it take to much time i want collect solution and do by easier way if possible this is a laplace adomian decomposition methd which contain adomian polynomial too i want upgrade the code, can any one help the  process for get better vision of this topic 
i do upload some picture and my mw. for more undrestanding

and please can any one explan why when i take laplace why is write D[2](u)(x, 0) must be D[1]?

restart

with(inttrans)

with(PDEtools)

with(LinearAlgebra)

NULL

with(SolveTools)

undeclare(prime)

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

(1)

with(PDEtools)

declare()

`Declared :`

 

u(x, t)*`to be displayed as`*u

 

`The prime differentiation variable has not been declared yet`

 

`Displayed derivatives and declared functions will be copied and pasted "as they were entered"`

(2)

declare(u(x, t))

u(x, t)*`will now be displayed as`*u

(3)

eq := diff(u(x, t), `$`(t, 2))+u(x, t)^2-(diff(u(x, t), x))^2 = 0

diff(diff(u(x, t), t), t)+u(x, t)^2-(diff(u(x, t), x))^2 = 0

(4)

NULL

eqs := laplace(eq, t, s)

s^2*laplace(u(x, t), t, s)-(D[2](u))(x, 0)-s*u(x, 0)+laplace(u(x, t)^2, t, s)-laplace((diff(u(x, t), x))^2, t, s) = 0

(5)

solve({eqs}, {laplace(u(x, t), t, s)})

{laplace(u(x, t), t, s) = (s*u(x, 0)+(D[2](u))(x, 0)-laplace(u(x, t)^2, t, s)+laplace((diff(u(x, t), x))^2, t, s))/s^2}

(6)

subs({u(x, 0) = 0, (D[2](u))(x, 0) = exp(x)}, %)

{laplace(u(x, t), t, s) = (exp(x)-laplace(u(x, t)^2, t, s)+laplace((diff(u(x, t), x))^2, t, s))/s^2}

(7)

eq3 := invlaplace(%, s, t)

{u(x, t) = exp(x)*t-(int(u(x, _U1)^2*(t-_U1), _U1 = 0 .. t))+int((diff(u(x, _U1), x))^2*(t-_U1), _U1 = 0 .. t)}

(8)

NULL

NULL

NULL

"u[0](x,t):=exp(x)*t"

proc (x, t) options operator, arrow, function_assign; exp(x)*t end proc

(9)

n := N

N

(10)

k := K

K

(11)

f := proc (u) options operator, arrow; u^2 end proc

proc (u) options operator, arrow; u^2 end proc

(12)

for j from 0 to 3 do A[j] := subs(lambda = 0, (diff(f(seq(sum(lambda^i*u[i](x, t), i = 0 .. 20), m = 1 .. 2)), [`$`(lambda, j)]))/factorial(j)) end do

(exp(x))^2*t^2

 

2*exp(x)*t*u[1](x, t)

 

u[1](x, t)^2+2*exp(x)*t*u[2](x, t)

 

2*u[1](x, t)*u[2](x, t)+2*exp(x)*t*u[3](x, t)

(13)

NULL

NULL

n := N

N

(14)

k := K

K

(15)

f := proc (u) options operator, arrow; (diff(u, x))^2 end proc

proc (u) options operator, arrow; (diff(u, x))^2 end proc

(16)

for j from 0 to 3 do B[j] := subs(lambda = 0, (diff(f(seq(sum(lambda^i*u[i](x, t), i = 0 .. 20), m = 1 .. 2)), [`$`(lambda, j)]))/factorial(j)) end do

(exp(x))^2*t^2

 

2*exp(x)*t*(diff(u[1](x, t), x))

 

(diff(u[1](x, t), x))^2+2*exp(x)*t*(diff(u[2](x, t), x))

 

2*(diff(u[1](x, t), x))*(diff(u[2](x, t), x))+2*exp(x)*t*(diff(u[3](x, t), x))

(17)

"#` know we need find all term of  u[0]=exp(x)*t` #` u`[1]=-invlaplace(1/(s^(2))(`A__0`+`B__0`))  u[2]=-invlaplace(1/(s^(2))(`A__1`+`B__1`))   ans so on ... at end i want collect all of them and find final result even if is aproximate and want do test of pde too "

NULL

Download explananing_of_get_solution.mw

First 59 60 61 62 63 64 65 Last Page 61 of 2217