## Solve an equation in mathematica without replacing the value of the parameter

Suppose I want to solve a simple equation in mathematica x-a=0.So I am writing the mathematica code for this as below:

Solve[x - a == 0, x] 

So the output will be as below:

{{x -> a}} 

Now suppose I have assigned a value for ‘a’ beforehand and then want to solve the same equation.So my code will look like below:

a = 1; Solve[x - a == 0, x] 

And the output in this case will be like below:

{{x -> 1}} 

Now if I want an output in this case as {{x -> a}},what modification should I do in my code ?

Note: Clear[a] will work,but I don’t want to remove permanently the assigned value to a

## Von Neumann Equation Density Matrix Implementation

I’m trying to implement the von Neumann Equation for a given 4×4 density Matrix with a time dependent Hamiltonian Hp[t_] in Mathematica but I get stuck.

Format[y[a__]] := Subscript[y, a] rho[t_] := Array[x[##][t] &, {4, 4}]  sol = NDSolve[{I*rho'[t] == Hp[t].rho[t] - rho[t].Hp[t],     rho[0] == rhoIni}, {rho}, {t, 0, 10}] 

However I only get the output

{{rho -> rho}} 

So I guess something is structurally wrong with my code. I try to extract a solution by writing

rho[t_] = rho[t] /. sol 

But this doesn’t work as there is no solution anyways. Maybe you can help me

## How can I find in mathematica if my equation have solution or not on a given interval?

I’m new to mathematica, I usually used wolfram alpha, however since the equation that I’m working with is a long equation I need to use mathematica. This is an example of the problem. So, I want to know if the equation will have solution or not when m>=4 and n>=3.41421m. I don’t know what command to use and when I enter this, it said that m>=4 is not a valid variable. What should I do?

Solve[{Binomial[n-1,2]-2[(Binomial[m-1,2])+(n-m)(m-1)-1]<=0}, {m>=4, n>=3.41421m}, Reals]

## Does anyone here know how can we extract Lambda from the following equation

I am working on an estimation problem where I have the following

Code is

A = 1 + Pi*Csc[(1 + Pi)*\[Lambda]]^2*     (Pi + Sin[2*(1 + Pi)*\[Lambda]]) 

Can anyone help me how can we extract $$\lambda$$ from this equation in Mathematica?

## NSolve connot solve my equation

I’m trying to solve $$\left(\frac{hc}{k_B} – 5x\right)e^{hc/k_Bx} + 5x = 0,$$ where $$h = 6.626 \times 10^{-34}$$, $$k = 1.381 \times 10^{-23}$$ and $$c = 3 \times 10^8$$. My code is

h = 6.626*^-34; k = 1.381*^-23; c = 3*^8; NSolve[((h c)/k - 5 x) Exp[(h c)/k x] + 5 x == 0, x] 

but Mathematica doesn’t solve the equation, am I doing something wrong?

## finding FWHM of a dataset with unknown mathematical equation

I have a dataset. I have plotted using "Listloglinearplot". Now I need to find the FWHM (full width half maxima) of the same, However I dont know which mathematical eqution describes best to fit my dataset to find out FWHM. I have the following data and plot:

dataset={{0., 0.0518175}, {1., 0.0306299}, {1.9, 0.610295}, {2.,    1.32653}, {2.2, 4.01183}, {2.5, 6.37931}, {3., 6.50091}, {5.,    6.54052}, {6., 6.57276}, {8.2, 6.59119}, {15., 6.56125}, {20.,    6.5267}, {30., 6.4484}, {45., 6.2987}, {60., 6.11953}, {75.,    5.84962}, {90., 5.43738}, {100., 4.96757}, {105., 4.54382}, {120.,    3.42917}, {135., 2.23092}, {150., 1.55222}, {165., 0.679385}, {180.,    0.444479}} dataplot =   ListLogLinearPlot[dataset,    PlotStyle -> {Dashing[{.0071, 0.005, 0.005}], Blue},    PlotMarkers -> {\[FilledCircle], 15}, Frame -> True,    FrameStyle -> Directive[Black, Thickness[0.002]],    FrameLabel -> {Style["x", Black, FontFamily -> "Times New Roman",       FontSize -> 26],      Style["y", Black, FontFamily -> "Times", FontSize -> 26]},    PlotRange -> {{0, 190}, {1, 7.2}}, FrameTicks -> Automatic,    ImageSize -> 650,    BaseStyle -> {FontFamily -> "Times", FontSize -> 10}] 

Thank you.

## Nonlinear Differential Equation with Paramaters in Sqrt Function

For a university project, I am trying to see if my system will have choked flow and also plot the resulting pressure spike. I set up the system below to try to model the transient response.

I am able to solve the equations TEq and mEq simultaneously if I use the mDotOutChoked equation in place of the mDotOut equation. But I want to know if it ever even reaches the choked condition, and what the steady-state pressure and temperature will be so I want to start with just using the mDotOut equation.

When I run this as it is below, I get "This computation has exceeded the time limit for your plan" followed by "{sol1} is neither a list or replacement rules nor a valid dispatch table, and so…" for all the graphs.

If I replace the pressure term with just a constant, I can get some limited success depending on the value I use. This makes me think there might be an issue with having the T[t] and P[t] terms in the square root in the mDotOut equation.

Is there some issue in {sol1} or is that issue just a result of me needing to upgrade for more compute power?

ClearAll["Global*"]  Q =  100 ;(*Heat into the shroud in Watts. Based on roughly 1350 W/m^2 from the solar simulator on one face of the shroud*) QAmb = 0  ;(*Heat loss to ambinet. Zero for now*) A =  2*1.935*10^-5 ;(*Area of orifice m^2  Based on 1/4 inch pipe with 0.028 inch wall thickness (two outlets)*) h =  199000 ;(*Heat of vaporization of LN2 J/kg*) Cp =  1039 ;(*Specific heat of nitrogen J/(kg K) *) R =  296.8 ;(*Gas constant for nitrogen J/(kg K)*) γ = 1.40  ;(*Specific heat ratio*) V = 0.001 ; (*Enclosed volume m^3*) Pe = 101000 ; (*External pressure in pa*) ρo = 4 ;(*Approx density of nitrogen at 80K in kg/m^3. This was the lowest temp data I could find*) tf = 300 ;(*Final time in seconds*)  P = m[t]*R*T[t]/V ;(*Pressure term*) mDotEvap = Q/h ; (*rate of evap*) mDotOut = (P*A/Sqrt[T[t]])*Sqrt[(2γ/(R(γ-1)))*((Pe/P)^(2/γ)-(Pe/P)^((γ+1)/γ))];  (*mass flow out of the orifice*) mDotOutChoked =  (P*A/Sqrt[T[t]])*Sqrt[γ/R]*(2/(γ+1))^((γ+1)/(2(γ-1))); (*mass flow out of the orifice if choked*)  TEq = T'[t] == 1/(m[t]*Cp)(mDotEvap*h-mDotOut*Cp*T[t]-QAmb) ; (*Diff Eq for Temperature in the cavity*) mEq = m'[t] == mDotEvap - mDotOut ; (*Conservation of mass*)  icT = T[0] == 77 ;(*initial temp in the cavity in K*) icm = m[0] == ρo*V ;(*initial mass of the vaporized gas. Assuming it just starts at 77k at 1atm and then adding heat*)  sol1 = NDSolve[{TEq,mEq, icT, icm}, {T[t], m[t]},{t, 0, tf} ] ; P2[t_] = m[t]*R*T[t]/V /.sol1 ; (*Plugging back to get shroud pressure as functon of time*)  Plot[{T[t]/.sol1},{t,0,tf},PlotRange -> Automatic, ImageSize->"Large",PlotLabels->Automatic, AxesLabel -> {Time (s),Temperature (K) }] Plot[{m[t]/.sol1},{t,0,tf},PlotRange -> Automatic, ImageSize->"Large",PlotLabels->Automatic,  AxesLabel -> {Time (s),Mass (Kg) }] Plot[P2[t], {t, 0, tf}, PlotRange -> Automatic, ImageSize -> "Large", PlotLabels -> Automatic,  AxesLabel -> {Time (s),Pressure (Pa) }] 

## Trascendental equation in Mathematica

I cannot make my Mathematica solve with Solve the following trascendental equation with coefficient A,B,C,D,F uniform but symbolic:

-Aexp[-C]-Bexp[+D] = (1 – Ax^[-C] – Bx^[+D])/log[x] – exp[2]*(F/x)^2

Would someone please help to find a solution, if an analytical exists? I do not have hypothetical solution x where start from. I could try to guess the numerical value of the constants A,B,C,D,F, but not trivial

## Using output from Solve or Reduce as a value in subsequent equation

I’m trying to run a simulation. I will number sentences to make response easier. (1) Here is my first equation:

𝑗[LBar_, y_, x1_, σ_, X2M_, w_, X1M_]:=(LBar(𝜎−1)⁄𝜎 + 𝑦(𝜎−1)⁄𝜎−x1(𝜎−1)⁄𝜎)𝜎⁄(𝜎−1)−(𝑦−X2M+𝑤(LBar+X1M)−𝑤x1) 

(2) I insert some parameter values and Reduce:

Reduce[𝜕x1(𝑗[100,𝑦,x1,13⁄,42,.23,80])==0 && x1>0, x1, Reals] 

(3) This produces output:

x1 == 119.575 

(4) When I try to call the output value (119.575) I run into problems. (5) For instance

2 % 

results in:

2 (x1 == 119.575) 

(6) and

j[100, 80, %[[2]], 1/3, 42, .23, 80] 

produces this output:

-79.4 + 1/Sqrt[41/160000 - 1/239.149[[2]]^2] + 0.23 239.149[[2]] `

## How do i use Streamplot to plot a non homogenous differential equation

I have the following equations:

x’ = x-y y’ = x+y-2xy

I used the following code to do the streamplot: I apologize for only having an image, as I am using Mathematica through my school servers I cannot copy and paste the data.

But I do not get any results, so then I linearize the equations and plot them separately, but I cannot figure out how to combine the plots to show in one plot.:

Is there any way to use Streamplot with nonhomogenous DE’s or a better way to combine the equations?