Solving a system of equations.
1 回表示 (過去 30 日間)
古いコメントを表示
For
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/153588/image.png)
and
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/153589/image.png)
where
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/153590/image.png)
How do I write a code that will take a given x and y value and output an alpha and delta value?
1 件のコメント
回答 (1 件)
Vineeth Kartha
2016 年 2 月 3 日
Hi Christopher,
The following lines of code will do the trick:
>> syms alpha delta
>> solver = @(x,y) solve(x ==alpha / delta^2 , y ==(( (3*alpha*(1+delta)^2) + ( (1+alpha)*(1+alpha*delta^2)))^(0.5))/((1+alpha)^2), alpha, delta,'IgnoreProperties', true);
>> sol = solver(x,y);
Pass the desired values of x and y to the function named "solver". This will return a structure that contains the values of "alpha" and "delta", for the given x and y values.
2 件のコメント
Walter Roberson
2016 年 2 月 3 日
Your delta is always squared so algebraically both negative and positive values are valid. The message is warning you that multiple solutions have been returned but that they might not all make sense in the overall context.
参考
カテゴリ
Help Center および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!