New answers tagged

0

A method to solve the original decoupled system : s = NDSolve[{ D[u[x, t], t] == -D[u[x, t], x] - u[x, t], u[x, 0] == 1, u[0, t] == 1}, {u[x, t]}, {x, 0, 4}, {t, 0, 1}] v[x_, t_] = (u[x, t] /. s[[1, 1]]) /. x -> x + 1; w[x_, t_] = (u[x, t] /. s[[1, 1]]) /. x -> x + 2; z[x_, t_] = (u[x, t] /. s[[1, 1]]) /. x -> x + 3; Row[{ ...


1

As suggested by the Documentation Center, you can remove excess (last 3) conditions. s = NDSolve[{D[u[x, t], t] == -D[u[x, t], x] - u[x, t], D[v[x, t], t] == -D[v[x, t], x] - v[x, t], D[w[x, t], t] == -D[w[x, t], x] - w[x, t], D[z[x, t], t] == -D[z[x, t], x] - z[x, t], u[x, 0] == 1, v[x, 0] == 1, w[x, 0] == 1, z[x, 0] == 1, u[0, t] ...


4

There is no solution to your equation. If you specify Reals for k Mathematica outputs an empty list as solution: NSolve[113.68/k + 1345.6/k^2*(1 - Exp[-k/11.6]) == -4.9, k, Reals] (*{}*) If you plot the righ and left hand side of the equation they don't cut each other: Plot[{113.68/k + 1345.6/k^2*(1 - Exp[-k/11.6]), -4.9}, {k, -60, 60}]


4

The corrected equation can be solved using FindRoot: FindRoot[(113.68 t/k - (1345.6/(k^2))*(1 - Exp[-k*t/11.6]) == -4.9 t^2) /. t -> 1, {k, 0.5}] (* {k -> 0.235142} *) This solves the equation for the value of $k$ corresponding to $t$ = 1 second. FindRoot requires an initial "guess" for the value of $k$; in this case, I've used $k = 0.5$. Other ...


3

If I carefully avoid any use of division to rearrange a few of your simpler equations and use the results for substitutions thus: sys = {yha Facx + yhb Fbcx == Ic αc, (rcp Cos[θ] Flay+rcp Sin[θ] Flax)-(rcp Cos[θ] Fray+rcp Sin[θ] Frax)==Ia αa, (rcp Cos[θ] Flby+rcp Sin[θ] Flbx)-(rcp Cos[θ] Frby+rcp Sin[θ] Frbx)==Ib αb, Falx + Fblx + fs1l == ml alx, Faly + ...


2

Clear[range] range[v0_, theta_] := v0^2 Sin[2 theta]/g Solve[{D[range[v0, theta], theta] == 0, 0 <= theta <= 90 Degree}, theta] (* Out: {{theta -> π/4}} *)


10

Here is how you would do it using the standard add-on package VariationalMethods, which is meant for calculations like this: Clear[m, k, c, x, t]; T = 1/2 m x'[t]^2; V = 1/2 k x[t]^2; L = T - V; Needs["VariationalMethods`"] hamiltonianEq = h == FirstIntegral[t] /. Last[FirstIntegrals[L, {x[t]}, t]] (* ==> h == 1/2 (k x[t]^2 + m ...


5

genCoords = {x[t]}; ke = 1/2 m x'[t]^2; v = 1/2 k x[t]^2; q = -c x'[t]; l = ke - v; Solve for x'[t] in terms of p[t]: rule = First@Solve[p[t] == D[l, x'[t]], x'[t]] (* {x'[t] -> p[t]/m} *) and then replace this expression into the Hamiltonian: x'[t] D[l, x'[t]] - l /. rule (* p[t]^2/(2 m) + 1/2 k x[t]^2 *) Note that I have used lower-case symbols ...


1

I corrected errors to get you started, but the physical equations themselves may not be accurate. springalt[c_, a_, x_, rs_, vs_, tmax_] := NDSolve[{ϕ'[t] == ω[t], ω'[t] == -c (((Sqrt[(Cos[ϕ[t]] + a)^2 + (Sin[ϕ[t]])^2] - 3)/ Sqrt[(Cos[ϕ[t]] + a)^2 + (Sin[ϕ[t]])^2])*a* Sin[ϕ[t]] + (((\[Sqrt]((x - Cos[ϕ[t]])^2 + ...


1

After help from everybody. this question has been resolved. we can do as follows; α= 1; β= 1; tmp = 0.1316; ρ= 0.01; t = -2; fe[m_, p_] := 1/2*(t - 1)*p^2 + 1/4*p^4 + (1/2*α^2*β*m^2*(t - tmp)) + 1/4 α^2*(β)*(m^4) + 1/2*(ρ*(p^2)*(m^2)) Show[SliceContourPlot3D[ z - fe[m, p], {z == -3}, {m, -3, 3}, {p, -3, 3}, {z, -6, 6}], SliceContourPlot3D[-z, ...


3

One or both of the following plots may be what you looking for. α = 1; β = 1; Tmp = 0.1316; ρ = 0.01; T = -2; FreeEnergy = 1/2*(T - 1)*P^2 + 1/4*P^4 + (1/2*α^2*β*M^2*(T - Tmp)) + 1/4 α^2*(β)*(M^4) + 1/2*(ρ*(P^2)*(M^2)); Plot[Evaluate[FreeEnergy /. M -> 0], {P, -2.35669, 2.35669}] Plot[Evaluate[FreeEnergy /. P -> 0], {M, -2.05216, ...


3

Assuming this is not just ContourPlot. Just minor changes: α = 1; β = 1; tmp = 0.1316; ρ = 0.01; t = -2; fe[m_, p_] := 1/2*(t - 1)*p^2 + 1/4*p^4 + (1/2*α^2*β*m^2*(t - tmp)) + 1/4 α^2*(β)*(m^4) + 1/2*(ρ*(p^2)*(m^2)) Now, Show[SliceContourPlot3D[ z - fe[m, p], {z == -4}, {m, -2.05216, 2.05217}, {p, -2.35669, 2.35669}, {z, -5, 0}], ...


1

The difficulties here are due exclusively to syntax errors, such as interchanging Set and Equal. If the code is rewritten as, γ = 28; Subscript[μ, 0] = 1.25*10^-6; Subscript[M, 0] = 800*10^-3/Subscript[μ, 0]; Subscript[B, dc] = 200*10^-3; Subscript[B, eff] = {Subscript[B, dc], 0, 0} - Subscript[μ, 0]*Subscript[M, 0] Dot[m[t], {0, 0, 1}]; ...


7

Here is a way to generate the mesh including region markers and different refinement in different regions: Needs["NDSolve`FEM`"] L = 1; i1 = 0.625; i2 = 0.25; (bmesh = ToBoundaryMesh[ "Coordinates" -> {{0, -L}, {10, -L}, {10, -L + i1}, {11, -L + i2}, {11, L - i2}, {10, L - i1}, {10, L}, {0, L}, {10, -5}, {12, -5}, {12, 5}, {10, 5}}, ...



Top 50 recent answers are included