Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9053327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:23:49+00:00 2026-06-16T13:23:49+00:00

i wrote a simple code to solve a steady state fermentation problem. It looks

  • 0

i wrote a simple code to solve a steady state fermentation problem. It looks a lot because of so much variables.

function y = f (x)

mumax = 1.10; %h-1
Ksx = 1.32; %gl^-1
Pix=1.39; %gl^-1
Pmx=49.9; %gl^-1
Kix=304; %gl^-1
Pis=47.1; %gl^-1
Pms=95.5; %gl^-1
Kis=140; %gl^-1
qsmax=3.42; %gg^-1h^-1
Kss=2.05; %gl^-1
alp=0.39;
qpmax=3.02; %gg^-1h^-1
Ksp=2.05;  %gl^-1
Kip=140;  %gl^-1
Pip=47.1;  %gl^-1
Pmp=95.5;  %gl^-1
F=240;
S=40;
V=120;
D=0.5;
mu= (mumax*x(2)) / (Ksx+x(2));


  y=[x(1)*(-D+mu*(1-(x(3)-Pix)/(Pmx-Pix))*(Kix/(Kix+x(2))));
  D*(S-x(2))-(qsmax*(x(2)/(Kss+x(2)))*(1-((x(3)-Pis)/(Pms-Pis)))*(Kis/(Kis+x(2))))*x(1);
  -x(3)*D+x(1)*(-D+mu*(1-(x(3)-Pix)/(Pmx-Pix))*(Kix/(Kix+x(2))))*alp+qpmax*(x(2)/(Ksp+x(2)))*(1-(x(3)-Pip)/(Pmp-Pip))*x(1)*(Kip/(Kip+x(2)));]; 

endfunction


[x, fval,  info] = fsolve (@f, [2; 10; 30])

I defined D as 0.5 but actually i need the solutions for D in the interval between 0 and 1 and then plotting all x(1),x(2),x(3) vs D.
I tried something like

for i=0:0.1:1
D=num2str(i)

but its not working maybe i put it in a wrong way? Best would be to save all into one matrix to plot it easily.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:23:50+00:00Added an answer on June 16, 2026 at 1:23 pm

    There’s this workaround from the MATLAB help on fsolve for dealing with more than one input argument. Define D as a parameter:

    function y = fffff (x,D)
    

    then you can create an anonymous function to pry off the parameter for fsolve. try something like

    ivals=linspace(0,1);
    for j=ivals;D=j;
      [x, fval,  info] = fsolve (@(x) fffff(x,D), [2; 10; 30]);
      Q=[Q x];
    end
    

    If you want to test a lot of values for D (or if you are doing time evolution) then you would not build Q in this manner, but playing with fsolve like this should get the job done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've wrote this simple piece of code. And I have a slight problem with
I wrote a simple code to capture the netdevice notifications and simply print their
Hello every one I have wrote a simple code in html5 in which I
I wrote this simple C code and compiled it using Visual Studio 2010, with
I wrote a simple plugin which sets some css code using wp_options. It all
I wrote a simple example that I expected would do it. The relevant code
Below is some jQuery code the i wrote to make a simple animation. However
Years ago, I wrote a code template that took a few simple parameters (points)
Wrote the following code: GEvent.addListener(marker, click, function() { // Delete all markers. map.clearOverlays(); jQuery(points_array).each(function(i,
I'm trying to solve a simple parsing problem and I elected to use enums

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.