# Tag Info

5

I think there is some confusion here on terminology. You said in the title of your question solve with constant. So $c$ in your ode is a constant which can't be changed. So the solution should be valid for any value of $c$. The ode is \begin{align*} y^{\prime}\left( x\right) & =cx\\ y\left( 0\right) & =0\\ y\left( 1\right) & =1 \end{...

5

Is this acceptable? sol = DSolveValue[{y'[x] == c x, y[0] == 0}, y[x], x] sol /. Solve[(sol /. x -> 1) == 1, c] {x^2}

5

If you use two-dimensional integration you will get a result without messages: In[2]:= NIntegrate[1/(x^5 + 3), {z, 0, 4}, {x, 0, z}] Out[2]= 1.43507 (Voting to close as "easily found in the documentation.")

4

DSolve is not set up to solve BVPs with parameters, even though theoretically it could. Below is a modification of the Todd-Gayley trick used in Accessing Reduce from DSolve that hacks the algorithm at the point Solve is used to solve the BCs for the integration constant(s): InternalInheritedBlock[{Solve}, Unprotect[Solve]; Solve[eq_, v_, opts___] /; ! ...

4

Here's a different way to solve the problem. We tell DSolve that c has to be solved for as well by turning it into a constant function: DSolve[ {y'[x] == c[x] x, c'[x] == 0, y[1] == 1 && y[0] == 0}, {y[x], c[x]}, x ] {{c[x] -> 2, y[x] -> x^2}} It's a nifty little trick that works from time to time.

4

If $y' = c x$, then we can isolate $c$ on one side of the equation and differentiate to obtain a higher-order ODE that doesn't depend on $c$ at all: $$\frac{d}{dx}\left(\frac{y'}{x}\right) = 0 \quad \Rightarrow \frac{y''}{x} - \frac{y'}{x^2} = 0$$ Mathematica can solve this ODE (and the associated initial conditions) readily: DSolve[{y''[x]/x - y'[x]/x^2 ==...

3

The message you see is because the version of Mathematica that you use does not have the nonlinear finite element solver implemented. When I run your system in Version 13.0 with a coarser then default mesh: mesh = NDSolveFEM`ToElementMesh[Cuboid[-25*{1, 1, 1}, 25*{1, 1, 1}], "MaxCellMeasure" -> 50] NDSolveValue[{eqn1, eqn2, eqn3, eqn4, ...

3

3

p2 = ListLinePlot[{{{0, 0}, {1, 1}}, {{0, 0}, {1, .8}}} , Epilog -> Inset[LineLegend[{ColorData[97][1], ColorData[97][2]}, {"1", "2"}], {.8, .4}] ] Head[%] Image[p2] EDIT-1 From the docs: Inset[obj,pos] is one of the available syntax. In response to the OP's comment, a manipulate is being added to show usage. As soon ...

2

Note that "plot" has a head of "Legended". I do not know a straight way to change this into an image: However, a work around could be to save the plot as a PNG file and then importing as an image. However, the quality could be better. Export["d:/tmp/test.png", plot] img = Import["d:/tmp/test.png"]

1

Simple solution: ImportString[ExportString[plot, "PNG"], "PNG"] Lossless solution: Export["test.svg", plot] img = ResourceFunction["SVGImport"]["test.svg"]

1

I couldn't find a duplicate along the lines of "How to check if a function worked?" It's a basic question, but not one that is easy to look up in the docs, imo. Many have figured this out for themselves, but I think the question deserves an answer on the site. There are a couple of standard(?) approaches. You can test if the result has the ...

1

Since no data was supplied, I made some up. See What does the construct f[x_] := f[x] = ... mean? for memoization and the mem pattern. The main idea below is to use Integrate[InterpolatingFunction[<..>][x], x] to compute the integral $\int_0^x f(t) \; dt$, which it does by integrating symbolically the piecewise polynomial function of the interpolating ...

Only top voted, non community-wiki answers of a minimum length are eligible