TransWikia.com

How to Solve a function f[x[y],y] == 0 in Mathematica? i.e. a function of 2 variables, where one is dependent on other

Mathematica Asked on March 7, 2021

I am new to Mathematica and am trying to solve an equation to calculate amplitude as a function of frequency numerically.amplitude v frequency

The parameters are as follows :-

L = 31.5*10^(-6);
m = 2.6969*10^(-13);
f1 =  551715;
f2 = 3.90463*10^6;
emr1 = 0.46399;
emr2 = 0.44793;
meff1 = emr1*m
meff2 = emr2*m
[Alpha]1 = 0.044;
[Alpha]2 = -18.6;
G = 2*10^(-3);
keff1 = meff1*(2*[Pi]*f1)^2
keff2 = meff2*(2*[Pi]*f2)^2
Q = 1500;

The equation is :-

f[y_,[Omega]_] := ((([Omega] -(2*[Pi]*f1))/(2*[Pi]*f1))-(3*[Alpha]1*((y[[Omega]])^2)/(8*L^2))^2  + (1/(2*Q))^2)*(y[[Omega]])^2 -((G/(2*keff1))^2)

Here y is amplitude, omega is frequency in the range :-

{[Omega]in = 0.85*(2*[Pi]*f1), [Omega]end = 1.15*(2*[Pi]*f1), [Omega]step = 0.01*(2*[Pi]*f1)}

2 Answers

First try to solve analytically

sol= Solve[x2 == a /((([Omega] - [Omega]R)/[Omega]R - b x2)^2 + c), x2]

and substitute the parameters.

Answered by Ulrich Neumann on March 7, 2021

I recommend solving for the square of x instead of x itself:

L = 31.5*10^(-6);
m = 2.6969*10^(-13);
f1 = 551715;
f2 = 3.90463*10^6;
emr1 = 0.46399;
emr2 = 0.44793;
meff1 = emr1*m;
meff2 = emr2*m;
α1 = 0.044;
α2 = -18.6;
G = 2*10^(-3);
keff1 = meff1*(2*π*f1)^2;
keff2 = meff2*(2*π*f2)^2;
Q = 1500;
eq = (((ω - (2*π*f1))/(2*π* f1)) - (3*α1*(xsquare)/(8*L^2))^2 + (1/(2*Q))^2)* xsquare - ((G/(2*keff1))^2) == 0;
Solve[eq, xsquare]
Solve[eq, xsquare, Reals] (* If you only want real-valued solutions *)

You can also use FindRoot when you need to find a numerical solution for a problem Solve can't handle.

Answered by Sjoerd Smit on March 7, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP